[node-patches] Change in ovirt-node[master]: system: Fix is_el(…) semantics
fabiand at redhat.com
fabiand at redhat.com
Tue Aug 12 13:15:36 UTC 2014
Fabian Deutsch has uploaded a new change for review.
Change subject: system: Fix is_el(…) semantics
......................................................................
system: Fix is_el(…) semantics
Previously the command raised and error, but that is rather cumbersome.
Now the semantics of the command are that it will only be true if it's
el* and the specified version.
Change-Id: Ia97bac4bafca347596e61af71e651821cca2a4a5
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/system.py
1 file changed, 2 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/02/31402/1
diff --git a/src/ovirt/node/utils/system.py b/src/ovirt/node/utils/system.py
index 68fac19..0853d44 100644
--- a/src/ovirt/node/utils/system.py
+++ b/src/ovirt/node/utils/system.py
@@ -433,18 +433,12 @@
def is_min_el(self, minversion):
"""Determin if this system is an EL and at min version minversion
"""
- if not self.is_el():
- raise RuntimeError("Expected el product, but got: %s" %
- self.PRODUCT)
- return (int(self.VERSION) >= minversion)
+ return (self.is_el() and int(self.VERSION) >= minversion)
def is_max_el(self, maxversion):
"""Determin if this system is an EL and at max version maxversion
"""
- if not self.is_el():
- raise RuntimeError("Expected el product, but got: %s" %
- self.PRODUCT)
- return (int(self.VERSION) <= maxversion)
+ return (self.is_el() and int(self.VERSION) <= maxversion)
class ProductInformation(base.Base):
--
To view, visit http://gerrit.ovirt.org/31402
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia97bac4bafca347596e61af71e651821cca2a4a5
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
More information about the node-patches
mailing list