Alon Bar-Lev has posted comments on this change.
Change subject: sos - refactored engine sos plugin
......................................................................
Patch Set 3: (4 inline comments)
....................................................
File src/__main__.py
Line 822: 'compressor': compressor,
Line 823: 'directory': self.conf["local_tmp_dir"],
Line 824: }
Line 825: caller = Caller(config)
Line 826: caller.call('/bin/tar -cf %(report)s -C %(directory)s .')
Yes... but better in this case:
"tar -cf '%(report)s' -C '%(directory)s' ."
This applies to every parameter you are presenting to the other commands as
well...
Line 827: shutil.rmtree(self.conf["local_tmp_dir"])
Line 828: caller.call('%(compressor)s -1 %(report)s')
Line 829: md5_out = caller.call('/bin/md5sum %(compressed_report)s')
Line 830: checksum = md5_out.split()[0]
Line 824: }
Line 825: caller = Caller(config)
Line 826: caller.call('/bin/tar -cf %(report)s -C %(directory)s .')
Line 827: shutil.rmtree(self.conf["local_tmp_dir"])
Line 828: caller.call('%(compressor)s -1 %(report)s')
if size is so important (bz vs xz) why not use -9?
And while we at it, why not python implementation of compression[1]?
[1] http://docs.python.org/2/library/bz2.html
Line 829: md5_out = caller.call('/bin/md5sum %(compressed_report)s')
Line 830: checksum = md5_out.split()[0]
Line 831: with open("%s.md5" % self.conf["path"], 'w') as checksum_file:
Line 832: checksum_file.write(md5_out)
Line 826: caller.call('/bin/tar -cf %(report)s -C %(directory)s .')
Line 827: shutil.rmtree(self.conf["local_tmp_dir"])
Line 828: caller.call('%(compressor)s -1 %(report)s')
Line 829: md5_out = caller.call('/bin/md5sum %(compressed_report)s')
Line 830: checksum = md5_out.split()[0]
instead of splitting this... why not use the md5 of python?
Line 831: with open("%s.md5" % self.conf["path"], 'w') as checksum_file:
Line 832: checksum_file.write(md5_out)
Line 833:
Line 834: msg = ''
Line 836: archiveSize = '%.1fM' % (
Line 837: float(os.path.getsize(self.conf["path"])) / (1 << 20)
Line 838: )
Line 839:
Line 840: msg = _(
do you sure that gettext is enabled here, aka '_' is defined?
Line 841: 'Log files have been collected and placed in
{path}.\n'
Line 842: 'The MD5 for this file is {checksum} and its size is
{size}'
Line 843: ).format(
Line 844: path=self.conf["path"],
--
To view, visit http://gerrit.ovirt.org/13939
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib226ec23b98450a03ebd2a64043a911645a62235
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-log-collector
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Keith Robertson <[email protected]>
Gerrit-Reviewer: Kiril Nesenko <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches