Simone Tiraboschi has uploaded a new change for review.

Change subject: packaging: setup: reading VDSM supported cluster levels from 
file
......................................................................

packaging: setup: reading VDSM supported cluster levels from file

VDSM can still be not ready/configured. Intead of getting the
supported cluster levels from API it's safer to directly
read them from a file.

Change-Id: I79c8a254cae27a918a6d2de9dc6b37867bd7f8ce
Bug-Url: https://bugzilla.redhat.com/1100236
Signed-off-by: Simone Tiraboschi <stira...@redhat.com>
---
M packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsmi.py
1 file changed, 7 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/42/32142/1

diff --git 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsmi.py 
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsmi.py
index 90e8cfd..3eca7fe 100644
--- 
a/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsmi.py
+++ 
b/packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/all-in-one/vdsmi.py
@@ -22,6 +22,7 @@
 
 import gettext
 _ = lambda m: gettext.dgettext(message=m, domain='ovirt-engine-setup')
+import sys
 import time
 import distutils.version
 
@@ -208,21 +209,16 @@
                 pv=osetupconfig.PACKAGE_VERSION,
             )
         )
-        from vdsm import vdscli
-        result = vdscli.connect().getVdsCapabilities()
-        code, message = result['status']['code'], result['status']['message']
-        if code != 0 or 'info' not in result:
-            raise RuntimeError(
-                'Failed to get vds capabilities. Error code: '
-                '"%s" message: "%s"' % (code, message)
-            )
-        vSupportedClusterLevels = result['info']['clusterLevels']
+        VDSM_DIR = '/usr/share/vdsm'
+        sys.path.append(VDSM_DIR)
+        import dsaversion
+        vSupportedClusterLevels = dsaversion.version_info['clusterLevels']
 
         self.logger.debug(
             'VDSM SupportedClusterLevels [{levels}], '
-            'PACKAGE_VERSION [{pv}],'.format(
+            'VDSM VERSION [{rv}],'.format(
                 levels=vSupportedClusterLevels,
-                pv=result['info']['packages2']['vdsm']['version'],
+                rv=dsaversion.raw_version_revision,
             )
         )
 


-- 
To view, visit http://gerrit.ovirt.org/32142
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79c8a254cae27a918a6d2de9dc6b37867bd7f8ce
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <stira...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to