diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2012-11-29 21:13:01 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2012-11-29 21:13:01 +0000 |
commit | 377be073191b06c7141ec1a67bddeb0a9243c8d5 (patch) | |
tree | 4842db62945aa9ed94306e31b665f0ed95c827eb | |
parent | 7426d0a2bc1e3743efc72a7d102a0729d60c493a (diff) | |
download | sos-377be073191b06c7141ec1a67bddeb0a9243c8d5.tar.gz |
Fix addCopySpecLimit when no path matches fname glob
If addCopySpecLimit is passed a glob that matches no files it will
throw an exception since it assumes that files[0] is valid. Check
as soon as the file list is created and return if it is empty.
-rw-r--r-- | sos/plugins/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py index 31efe783..edd7b73e 100644 --- a/sos/plugins/__init__.py +++ b/sos/plugins/__init__.py @@ -363,6 +363,8 @@ class Plugin(object): files = glob.glob(fname) files.sort() + if len(files) == 0: + return cursize = 0 limit_reached = False sizelimit *= 1024 * 1024 # in MB |