[node-patches] Change in ovirt-node[master]: utils: Let SystemRelease publish the CPE string
fabiand at fedoraproject.org
fabiand at fedoraproject.org
Fri Aug 30 12:06:13 UTC 2013
Fabian Deutsch has uploaded a new change for review.
Change subject: utils: Let SystemRelease publish the CPE string
......................................................................
utils: Let SystemRelease publish the CPE string
Change-Id: Ia24fc128891bcf3aa22252a0dc66dc22638a345f
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/system.py
1 file changed, 13 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/16/18716/1
diff --git a/src/ovirt/node/utils/system.py b/src/ovirt/node/utils/system.py
index e95a91f..55b4ec5 100644
--- a/src/ovirt/node/utils/system.py
+++ b/src/ovirt/node/utils/system.py
@@ -173,15 +173,20 @@
def load(self):
"""Parse the CPE FILE
"""
+ cpe_uri = self.cpe()
+ self.logger.debug("Read CPE URI: %s" % cpe_uri)
+ cpe_parts = cpe_uri.split(":")
+ self.logger.debug("Parsed CPE parts: %s" % cpe_parts)
+ if cpe_parts[0] != "cpe":
+ raise RuntimeError("Can not parse CPE string in %s" %
+ self.CPE_FILE)
+ self.VENDOR, self.PRODUCT, self.VERSION = cpe_parts[2:5]
+
+ def cpe(self):
+ """Return the CPE URI
+ """
with open(self.CPE_FILE, "r") as f:
- cpe_uri = f.read().strip()
- self.logger.debug("Read CPE URI: %s" % cpe_uri)
- cpe_parts = cpe_uri.split(":")
- self.logger.debug("Parsed CPE parts: %s" % cpe_parts)
- if cpe_parts[0] != "cpe":
- raise RuntimeError("Can not parse CPE string in %s" %
- self.CPE_FILE)
- self.VENDOR, self.PRODUCT, self.VERSION = cpe_parts[2:5]
+ return f.read().strip()
def is_fedora(self):
"""Determin if this system is a fedora system
--
To view, visit http://gerrit.ovirt.org/18716
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia24fc128891bcf3aa22252a0dc66dc22638a345f
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>
More information about the node-patches
mailing list