From Yaniv Bronhaim <ybronhei(a)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 <igoihman(a)redhat.com>
Bug-Url:
https://bugzilla.redhat.com/1471663
---
M vdsm/sos/vdsm.py.in
1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/42/79542/1
diff --git a/vdsm/sos/vdsm.py.in b/vdsm/sos/vdsm.py.in
index 3dfe177..ec9d860 100644
--- a/vdsm/sos/vdsm.py.in
+++ b/vdsm/sos/vdsm.py.in
@@ -54,6 +54,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
@@ -70,8 +75,12 @@
self.addCopySpec("/etc/vdsm/*")
self.addCopySpec("/etc/vdsm-reg/*")
logsize = self.getOption('logsize')
- self.addCopySpec("/var/log/vdsm/*", logsize)
- self.addCopySpec("/var/log/vdsm-reg/*", logsize)
+ if logsize is not None:
+ self.addCopySpecLimit("/var/log/vdsm/*", logsize)
+ self.addCopySpecLimit("/var/log/vdsm-reg/*", logsize)
+ else:
+ self.addCopySpec("/var/log/vdsm/*")
+ self.addCopySpec("/var/log/vdsm-reg/*")
self._addVdsmRunDir()
self.addCopySpec("@TRUSTSTORE@")
self.addCopySpec("@HOOKSDIR@")
--
To view, visit
https://gerrit.ovirt.org/79542
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I52695ec43a65367b80d7291e213790dfd98ca4af
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Yaniv Bronhaim <ybronhei(a)redhat.com>