Change in vdsm[ovirt-4.1]: sos: fix addCopySpecLimit call

2017-07-18 Thread Code Review
From Yaniv Bronhaim :

Yaniv Bronhaim has posted comments on this change.

Change subject: sos: fix addCopySpecLimit call
..


Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I52695ec43a65367b80d7291e213790dfd98ca4af
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.1
Gerrit-Owner: Yaniv Bronhaim 
Gerrit-Reviewer: Francesco Romani 
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Peřina 
Gerrit-Reviewer: Piotr Kliczewski 
Gerrit-Reviewer: Yaniv Bronhaim 
Gerrit-Reviewer: gerrit-hooks 
Gerrit-HasComments: No
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org


Change in vdsm[ovirt-4.1]: sos: fix addCopySpecLimit call

2017-07-18 Thread Code Review
From Yaniv Bronhaim :

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 
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 
___
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org