Change in vdsm[ovirt-3.5]: ppc: Over ppc arch vdsm reports UNKNOWN as operationSystem i...
ybronhei at redhat.com
ybronhei at redhat.com
Sun Sep 7 14:27:21 UTC 2014
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/32574
to review the following change.
Change subject: ppc: Over ppc arch vdsm reports UNKNOWN as operationSystem in getVdsCaps
......................................................................
ppc: Over ppc arch vdsm reports UNKNOWN as operationSystem in getVdsCaps
Vdsm currently checks only /etc/redhat-release path which exists over
fedora installation for ppc arch but not on PowerKVM platforms.
Over PowerKVM platforms we should read /etc/ibm_powerkvm-release to
retrieve the release version.
Change-Id: I5e6ef83353b4b47a22d91d222ef1a0122b9470d3
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1131965
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/32444
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/caps.py
1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/74/32574/1
diff --git a/vdsm/caps.py b/vdsm/caps.py
index 0993939..1d35d7c 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -66,6 +66,7 @@
FEDORA = 'Fedora'
RHEVH = 'RHEV Hypervisor'
DEBIAN = 'Debian'
+ POWERKVM = 'PowerKVM'
class AutoNumaBalancingStatus:
@@ -496,6 +497,8 @@
return OSName.RHEL
elif os.path.exists('/etc/debian_version'):
return OSName.DEBIAN
+ elif os.path.exists('/etc/ibm-powerkvm-release'):
+ return OSName.POWERKVM
else:
return OSName.UNKNOWN
@@ -514,8 +517,13 @@
version = linecache.getline('/etc/debian_version', 1).strip("\n")
release = "" # Debian just has a version entry
else:
+ if osname == OSName.POWERKVM:
+ release_path = '/etc/ibm_powerkvm-release'
+ else:
+ release_path = '/etc/redhat-release'
+
ts = rpm.TransactionSet()
- for er in ts.dbMatch('basenames', '/etc/redhat-release'):
+ for er in ts.dbMatch('basenames', release_path):
version = er['version']
release = er['release']
except:
--
To view, visit http://gerrit.ovirt.org/32574
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e6ef83353b4b47a22d91d222ef1a0122b9470d3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
More information about the vdsm-patches
mailing list