diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2014-07-01 21:03:18 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2014-07-01 21:03:18 +0100 |
commit | 9a128b957c25a5c5ac3fa2b8afa53777f9f840c2 (patch) | |
tree | ef925ba443a5323557ec6857c92b78fa5f126fce | |
parent | 59ac4fb00ce5f98303d6b79c30d0d3b7c138fbe2 (diff) | |
download | sos-9a128b957c25a5c5ac3fa2b8afa53777f9f840c2.tar.gz |
[plugin] handle lstat exceptions in do_copy_path()
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index c225fe69..3785d610 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -290,7 +290,11 @@ class Plugin(object): if not dest: dest = srcpath - st = os.lstat(srcpath) + try: + st = os.lstat(srcpath) + except OSError, IOError: + self.log_info("failed to stat '%s'" % srcpath) + return if stat.S_ISLNK(st.st_mode): self.copy_symlink(srcpath) |