aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2018-08-31 12:52:38 +0100
committerBryn M. Reeves <bmr@redhat.com>2018-08-31 12:52:38 +0100
commitc496d2bec8cae175faf986567e73d16d401d8564 (patch)
tree0e413e40f4362b565d0c2808855452960ec3d47a
parent2e07f7c4778145d4366476ecc4383d491458b541 (diff)
downloadsos-c496d2bec8cae175faf986567e73d16d401d8564.tar.gz
[archive] simplify FileCacheArchive.makedirs()
Simplify the makedirs() method of FileCacheArchive and have it bypass _check_path() and directly call os.makedirs(): a subsequent patch will restrict the use of the method to setting up the sos_* directories in the archive root. File, directory and other object type add_* methods will use a new method that correctly handles symbolic links in intermediate path components. Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r--sos/archive.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sos/archive.py b/sos/archive.py
index 5d99170f..ffa54036 100644
--- a/sos/archive.py
+++ b/sos/archive.py
@@ -361,11 +361,11 @@ class FileCacheArchive(Archive):
return self._archive_root
def makedirs(self, path, mode=0o700):
- dest = self._check_path(path, P_DIR)
- if not dest:
- return
+ """Create path, including leading components.
- self._makedirs(self.dest_path(path))
+ Used by sos.sosreport to set up sos_* directories.
+ """
+ os.makedirs(os.path.join(self._archive_root, path), mode=mode)
self.log_debug("created directory at '%s' in FileCacheArchive '%s'"
% (path, self._archive_root))