Change in vdsm[ovirt-3.4]: sos: Support SOS version 3

dougsland at redhat.com dougsland at redhat.com
Mon Mar 10 07:57:37 UTC 2014


Hello Dan Kenigsberg,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/25553

to review the following change.

Change subject: sos: Support SOS version 3
......................................................................

sos: Support SOS version 3

This patch will add support to sos 3 API and keep compatible
with old API.

Change-Id: I52fbd9431506c5862cc762b4d3f0701ab5cf6a0b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1060383
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/25188
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/sos/vdsm.py.in
1 file changed, 17 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/53/25553/1

diff --git a/vdsm/sos/vdsm.py.in b/vdsm/sos/vdsm.py.in
index 6bc111a..d90940f 100644
--- a/vdsm/sos/vdsm.py.in
+++ b/vdsm/sos/vdsm.py.in
@@ -18,7 +18,15 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
-import sos.plugintools
+try:
+    from sos.plugins import Plugin, RedHatPlugin
+
+    class Base(Plugin, RedHatPlugin):
+        pass
+except ImportError:
+    import sos.plugintools
+    Base = sos.plugintools.PluginBase
+
 import subprocess
 import os
 
@@ -39,13 +47,20 @@
 config = _importVdsmPylibModule('config').config
 
 
-class vdsm(sos.plugintools.PluginBase):
+class vdsm(Base):
     """VDSM server related information
     """
 
     optionList = [("logsize", 'max size (MiB) to collect per log file', '',
                    False)]
 
+    # Make compatible com sos version >= 3
+    if not hasattr(Base, 'addCopySpec'):
+        addCopySpec = Base.add_copy_spec
+        addCopySpecLimit = Base.add_copy_spec_limit
+        collectExtOutput = Base.add_cmd_output
+        getOption = Base.get_option
+
     def __addCopySpecLogLimit(self, path, logsize=None):
         """
         Glob the files in path and ensure that the sorted cumulative


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52fbd9431506c5862cc762b4d3f0701ab5cf6a0b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list