Comment 0 for bug 2024547

Revision history for this message
nikhil kshirsagar (nkshirsagar) wrote : bug in do_file_private_sub for the juju plugin

As described in https://github.com/sosreport/sos/issues/3261 , the flags=re.IGNORECASE argument cannot be passed with a compiled pattern.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sos/report/__init__.py", line 1459, in postproc
    plug.postproc()
  File "/usr/lib/python3/dist-packages/sos/report/plugins/juju.py", line 69, in postproc
    self.do_file_private_sub(agents_path)
  File "/usr/lib/python3/dist-packages/sos/report/plugins/__init__.py", line 1257, in do_file_private_sub
    self.do_file_sub(path, _certmatch, replace)
  File "/usr/lib/python3/dist-packages/sos/report/plugins/__init__.py", line 1287, in do_file_sub
    result, replacements = re.subn(regexp, subst, content,
  File "/usr/lib/python3.8/re.py", line 221, in subn
    return _compile(pattern, flags).subn(repl, string, count)
  File "/usr/lib/python3.8/re.py", line 299, in _compile
    raise ValueError(
ValueError: cannot process flags argument with a compiled pattern

The issue was introduced by this commit - https://github.com/sosreport/sos/commit/bb43ac3b0dddcecf9bf34e489490296e15a2addc

It is fixed by https://github.com/sosreport/sos/pull/3263