Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1479838 Details for
Bug 1597532
"AttributeError: module 'stat' has no attribute 'ISBLK'" seen on ppc64le
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Create leading path components in sos.archive.Archive
sos-make_leading_paths.patch (text/plain), 2.06 KB, created by
Bryn M. Reeves
on 2018-08-30 16:17:20 UTC
(
hide
)
Description:
Create leading path components in sos.archive.Archive
Filename:
MIME Type:
Creator:
Bryn M. Reeves
Created:
2018-08-30 16:17:20 UTC
Size:
2.06 KB
patch
obsolete
>diff --git a/sos/archive.py b/sos/archive.py >index 5d99170f..3c5a96ad 100644 >--- a/sos/archive.py >+++ b/sos/archive.py >@@ -200,7 +200,7 @@ class FileCacheArchive(Archive): > raise ValueError("path '%s' exists and is not a directory" % > dest_dir) > elif not os.path.exists(dest_dir): >- self._makedirs(dest_dir) >+ self._make_leading_paths(src) > > def is_special(mode): > return any([ >@@ -344,8 +344,33 @@ class FileCacheArchive(Archive): > raise e > shutil.copystat(path, dest) > >- def _makedirs(self, path, mode=0o700): >- os.makedirs(path, mode) >+ def _make_leading_paths(self, src, mode=0o700): >+ """Create leading path components >+ >+ The standard python `os.makedirs` is insufficient for our >+ needs: it will only create directories, and ignores the fact >+ that some path components may be symbolic links. >+ """ >+ src = os.path.join("/", src) if not src.startswith("/") else src >+ src_dir = os.path.split(src)[0] >+ root = self._archive_root >+ >+ # Build a list of path components in root-to-leaf order. >+ path = src_dir >+ path_comps = [] >+ while path != '/': >+ head, tail = os.path.split(path) >+ path_comps.append(tail) >+ path = head >+ path_comps.reverse() >+ >+ # Check and create components as needed >+ path = root >+ for comp in path_comps: >+ path = os.path.join(path, comp) >+ if not os.path.exists(path): >+ # FIXME Handle symlinked directory creation >+ os.mkdir(path, mode) > > def name_max(self): > if 'PC_NAME_MAX' in os.pathconf_names: >@@ -365,7 +390,7 @@ class FileCacheArchive(Archive): > if not dest: > return > >- self._makedirs(self.dest_path(path)) >+ self._make_leading_paths(path, mode=mode) > self.log_debug("created directory at '%s' in FileCacheArchive '%s'" > % (path, self._archive_root)) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1597532
: 1479838