diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2013-06-07 17:06:55 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2013-06-07 17:06:55 +0100 |
commit | 3946e7d80a615b05911db3d6bb7f59b7d27c8cfe (patch) | |
tree | 1ba7e51aa4f0493e703f68e8f339480f0ff9155c | |
parent | 641b1a7e34bea9fef35dc8a65a96d2adc6b55aee (diff) | |
download | sos-3946e7d80a615b05911db3d6bb7f59b7d27c8cfe.tar.gz |
Tidy up archive initialisation code
Improve code formatting and readability in _set_archive() ahead
of new temporary tree archive code.
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/sosreport.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sos/sosreport.py b/sos/sosreport.py index df9be1ee..c58f6310 100644 --- a/sos/sosreport.py +++ b/sos/sosreport.py @@ -558,15 +558,16 @@ class SoSReport(object): def _set_archive(self): if self.opts.compression_type not in ('auto', 'zip', 'bzip2', 'gzip', 'xz'): - raise Exception("Invalid compression type specified. Options are: auto, zip, bzip2, gzip and xz") + raise Exception("Invalid compression type specified. Options are:" + + "auto, zip, bzip2, gzip and xz") archive_name = os.path.join(self.opts.tmp_dir,self.policy.get_archive_name()) if self.opts.compression_type == 'auto': auto_archive = self.policy.preferred_archive_name() - self.archive = auto_archive(archive_name) + self.archive = auto_archive(archive_name, self.opts.tmp_dir) elif self.opts.compression_type == 'zip': - self.archive = ZipFileArchive(archive_name) + self.archive = ZipFileArchive(archive_name, self.opts.tmp_dir) else: - self.archive = TarFileArchive(archive_name) + self.archive = TarFileArchive(archive_name, self.opts.tmp_dir) def _set_directories(self): self.cmddir = 'sos_commands' |