aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index d8582670..2e30d86b 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -354,8 +354,14 @@ class Plugin(object):
else:
replacements = 0
except Exception as e:
- msg = "regex substitution failed for '%s' with: '%s'"
- self._log_error(msg % (path, e))
+ # if trying to regexp a nonexisting file, dont log it as an
+ # error to stdout
+ if e.errno == errno.ENOENT:
+ msg = "file '%s' not collected, substitution skipped"
+ self._log_debug(msg % path)
+ else:
+ msg = "regex substitution failed for '%s' with: '%s'"
+ self._log_error(msg % (path, e))
replacements = 0
return replacements