Alon Bar-Lev has uploaded a new change for review. Change subject: vdsm: support ibm_powerkvm distro ......................................................................
vdsm: support ibm_powerkvm distro Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1131177 Change-Id: Ic5e37d07812ad774ab76538f3e05fe290384bd42 Signed-off-by: Alon Bar-Lev <[email protected]> --- M ChangeLog M src/plugins/ovirt-host-deploy/vdsm/software.py 2 files changed, 32 insertions(+), 24 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-host-deploy refs/changes/50/32350/1 diff --git a/ChangeLog b/ChangeLog index db342dc..e4a3108 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ ????-??-?? - Version 1.2.3 + * vdsm: support ibm_powerkvm distribution, rhbz#1131177. 2014-06-22 - Version 1.2.2 diff --git a/src/plugins/ovirt-host-deploy/vdsm/software.py b/src/plugins/ovirt-host-deploy/vdsm/software.py index 2f0ec80..5024913 100644 --- a/src/plugins/ovirt-host-deploy/vdsm/software.py +++ b/src/plugins/ovirt-host-deploy/vdsm/software.py @@ -35,6 +35,21 @@ class Plugin(plugin.PluginBase): """Hardware prerequisites plugin.""" + _SUPPORTED = [ + { + 'distro': ('redhat', 'centos'), + 'version': '6.2', + }, + { + 'distro': ('fedora', ), + 'version': '17', + }, + { + 'distro': ('ibm_powerkvm', ), + 'version': '2.1.0', + }, + ] + def __init__(self, context): super(Plugin, self).__init__(context=context) @@ -43,32 +58,24 @@ ) def _validation(self): dist, ver = platform.linux_distribution(full_distribution_name=0)[:2] - if dist in ('redhat', 'centos'): - if LooseVersion(ver) < LooseVersion('6.2'): - raise RuntimeError( - _( - 'Distribution {distribution} version {version} ' - 'is not supported' - ).format( - distribution=dist, - version=ver, - ) - ) - elif dist == 'fedora': - if LooseVersion(ver) < LooseVersion('17'): - raise RuntimeError( - _( - 'Distribution {distribution} version {version} ' - 'is not supported' - ).format( - distribution=dist, - version=ver, - ) - ) - else: + + supported = False + for entry in self._SUPPORTED: + if ( + dist in entry['distro'] and + LooseVersion(ver) >= LooseVersion(entry['version']) + ): + supported = True + break + + if not supported: raise RuntimeError( - _('Distribution {distribution} is not supported').format( + _( + 'Distribution {distribution} version {version} ' + 'is not supported' + ).format( distribution=dist, + version=ver, ) ) -- To view, visit http://gerrit.ovirt.org/32350 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5e37d07812ad774ab76538f3e05fe290384bd42 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-host-deploy Gerrit-Branch: ovirt-host-deploy-1.2 Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
