Alon Bar-Lev has uploaded a new change for review.

Change subject: node: support plugin features instead by version
......................................................................

node: support plugin features instead by version

Change-Id: I60647e0e51670ea58b3313e5e7b06e8ecf63dffe
Signed-off-by: Alon Bar-Lev <[email protected]>
---
M src/ovirt_host_deploy/constants.py
M src/plugins/ovirt-host-deploy/kdump/packages.py
M src/plugins/ovirt-host-deploy/node/detect.py
3 files changed, 23 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-host-deploy 
refs/changes/69/33069/1

diff --git a/src/ovirt_host_deploy/constants.py 
b/src/ovirt_host_deploy/constants.py
index 590a011..ce561cc 100644
--- a/src/ovirt_host_deploy/constants.py
+++ b/src/ovirt_host_deploy/constants.py
@@ -115,7 +115,7 @@
     CHECK_VIRT_HARDWARE = 'VDSM/checkVirtHardware'
     OVIRT_NODE = 'VDSM/node'
     OVIRT_NODE_HAS_OWN_BRIDGES = 'VDSM/nodeHasOwnBridges'
-    NODE_PLUGIN_VDSM_VERSION = 'VDSM/nodePluginVdsmVersion'
+    NODE_PLUGIN_VDSM_FEATURES = 'VDSM/nodePluginVdsmFeatures'
     CONFIG_OVERRIDE = 'VDSM/configOverride'
     DISABLE_NETWORKMANAGER = 'VDSM/disableNetworkManager'
     CONFIG_PREFIX = 'VDSM_CONFIG/'
diff --git a/src/plugins/ovirt-host-deploy/kdump/packages.py 
b/src/plugins/ovirt-host-deploy/kdump/packages.py
index 02010c3..7f9dc94 100644
--- a/src/plugins/ovirt-host-deploy/kdump/packages.py
+++ b/src/plugins/ovirt-host-deploy/kdump/packages.py
@@ -136,17 +136,10 @@
         result = False
 
         if self.environment[odeploycons.VdsmEnv.OVIRT_NODE]:
-            # on node check ovirt-node-plugin-vdsm version
-            plugin_version = self.environment[
-                odeploycons.VdsmEnv.NODE_PLUGIN_VDSM_VERSION
+            # on node check ovirt-node-plugin-vdsm features
+            result = 'kdump' in self.environment[
+                odeploycons.VdsmEnv.NODE_PLUGIN_VDSM_FEATURES
             ]
-            result = (
-                plugin_version is not None and
-                compareEVR(
-                    (None, plugin_version[0], plugin_version[1]),
-                    (None, '0.2.0', None)
-                ) >= 0
-            )
         else:
             # on standard host use packager
             min_version = self._get_min_kexec_tools_version()
diff --git a/src/plugins/ovirt-host-deploy/node/detect.py 
b/src/plugins/ovirt-host-deploy/node/detect.py
index b850465..97329b6 100644
--- a/src/plugins/ovirt-host-deploy/node/detect.py
+++ b/src/plugins/ovirt-host-deploy/node/detect.py
@@ -41,7 +41,7 @@
 
     Environment:
         VdsmEnv.OVIRT_NODE -- is node.
-        VdsmEnv.NODE_PLUGIN_VDSM_VERSION -- version of ovirt-node-plugin-vdsm
+        VdsmEnv.NODE_PLUGIN_VDSM_FEATURES -- features of ovirt-node-plugin-vdsm
 
     """
 
@@ -59,8 +59,8 @@
     def __init__(self, context):
         super(Plugin, self).__init__(context=context)
 
-    def _get_node_plugin_version(self, plugin_name):
-        result = None
+    def _get_node_plugin_features(self, plugin_name):
+        features = []
         version_file = '/etc/default/version%s' % (
             '.%s' % plugin_name if plugin_name else ''
         )
@@ -71,18 +71,15 @@
                     m = self._PLUGIN_VER_FILE_RE.match(line)
                     if m is not None:
                         content[m.group('key')] = m.group('value')
-            result = (
-                content.get('VERSION', None),
-                content.get('RELEASE', None),
-            )
+            features = content.get('FEATURES', '').split()
 
         self.logger.debug(
-            "Plugin '%s' version: '%s'",
+            "Plugin '%s', features='%s'",
             plugin_name,
-            result,
+            features,
         )
 
-        return result
+        return features
 
     @plugin.event(
         stage=plugin.Stages.STAGE_INIT,
@@ -96,6 +93,10 @@
                 bool(glob.glob('/etc/ovirt-node-*-release'))
             )
         )
+        self.environment.setdefault(
+            odeploycons.VdsmEnv.NODE_PLUGIN_VDSM_FEATURES,
+            []
+        )
         self.environment[
             odeploycons.VdsmEnv.OVIRT_NODE_HAS_OWN_BRIDGES
         ] = len(glob.glob('/sys/class/net/br*/bridge/bridge_id')) != 0
@@ -105,11 +106,14 @@
                 odeploycons.CoreEnv.OFFLINE_PACKAGER,
                 True
             )
-            self.environment[
-                odeploycons.VdsmEnv.NODE_PLUGIN_VDSM_VERSION
-            ] = self._get_node_plugin_version(
-                'ovirt-node-plugin-vdsm'
-            )
+            if not self.environment[
+                odeploycons.VdsmEnv.NODE_PLUGIN_VDSM_FEATURES
+            ]:
+                self.environment[
+                    odeploycons.VdsmEnv.NODE_PLUGIN_VDSM_FEATURES
+                ] = self._get_node_plugin_features(
+                    'ovirt-node-plugin-vdsm'
+                )
 
 
 # vim: expandtab tabstop=4 shiftwidth=4


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60647e0e51670ea58b3313e5e7b06e8ecf63dffe
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-host-deploy
Gerrit-Branch: master
Gerrit-Owner: Alon Bar-Lev <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to