43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
From c496d2bec8cae175faf986567e73d16d401d8564 Mon Sep 17 00:00:00 2001
|
|
From: "Bryn M. Reeves" <bmr@redhat.com>
|
|
Date: Fri, 31 Aug 2018 12:52:38 +0100
|
|
Subject: [PATCH 0024/1146] [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>
|
|
---
|
|
sos/archive.py | 8 ++++----
|
|
1 file 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))
|
|
|
|
--
|
|
2.26.0.windows.1
|
|
|