From Yaniv Bronhaim <ybron...@redhat.com>:

Yaniv Bronhaim has uploaded a new change for review.

Change subject: sos: fix addCopySpecLimit call
......................................................................

sos: fix addCopySpecLimit call

sosreport 3.4 replace add_copy_spec_limit with
add_copy_spec.
commit 2e2559d4f3dd7625e52aad3314379ef1ee2afe41 replaced
this call but apperantly in prior sosreport versions,
number of parameters of add_copy_spec method was different and
caused a TypeError.

Change-Id: I52695ec43a65367b80d7291e213790dfd98ca4af
Signed-off-by: Irit Goihman <igoih...@redhat.com>
Bug-Url: https://bugzilla.redhat.com/1471663
---
M vdsm/sos/vdsm.py.in
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/41/79541/1

diff --git a/vdsm/sos/vdsm.py.in b/vdsm/sos/vdsm.py.in
index b08bb6e..03ef206 100644
--- a/vdsm/sos/vdsm.py.in
+++ b/vdsm/sos/vdsm.py.in
@@ -66,6 +66,11 @@
     # Make compatible com sos version >= 3
     if not hasattr(Plugin, 'addCopySpec'):
         addCopySpec = Plugin.add_copy_spec
+        # sosreport 3.4 replaced add_copy_spec_limit with add_copy_spec
+        if hasattr(Plugin, 'add_copy_spec_limit'):
+            addCopySpecLimit = Plugin.add_copy_spec_limit
+        else:
+            addCopySpecLimit = Plugin.add_copy_spec
         collectExtOutput = Plugin.add_cmd_output
         getOption = Plugin.get_option
         addForbiddenPath = Plugin.add_forbidden_path
@@ -89,7 +94,10 @@
         self.addCopySpec("/tmp/vds_bootstrap*")
         self.addCopySpec("/etc/vdsm/*")
         logsize = self.getOption('logsize')
-        self.addCopySpec("/var/log/vdsm/*", logsize)
+        if logsize is not None:
+            self.addCopySpecLimit("/var/log/vdsm/*", logsize)
+        else:
+            self.addCopySpec("/var/log/vdsm/*")
         self._addVdsmRunDir()
         self.addCopySpec("@HOOKSDIR@")
         self.addCopySpec("@VDSMLIBDIR@")


-- 
To view, visit https://gerrit.ovirt.org/79541
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I52695ec43a65367b80d7291e213790dfd98ca4af
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.1
Gerrit-Owner: Yaniv Bronhaim <ybron...@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to