diff options
author | Jose Castillo <jose.mfcastillo@gmail.com> | 2019-11-08 14:28:40 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2019-11-13 15:57:31 +0000 |
commit | 932ff9094993d649222f73e463d9cd88ec4676ee (patch) | |
tree | fbc0c26b0ee09c915f3600501593b5563d7eabf7 | |
parent | 4dca9302270fbda6700986b9da2bde7fde0f272f (diff) | |
download | sos-932ff9094993d649222f73e463d9cd88ec4676ee.tar.gz |
[pcp] Fix FileNotFoundError exception
After API command consolidation via commit e8bb94c and commit
e51d3e6, pcp started throwing a FileNotFound exception since the
plugin treats the command output as the name of a path to open.
Remove the open and just use the content of the 'output' entry
directly.
Resolves: #1852
Signed-off-by: Jose Castillo <jose.mfcastillo@gmail.com>
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
-rw-r--r-- | sos/plugins/pcp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/plugins/pcp.py b/sos/plugins/pcp.py index c3a7bf0a..7869208b 100644 --- a/sos/plugins/pcp.py +++ b/sos/plugins/pcp.py @@ -129,7 +129,7 @@ class Pcp(Plugin, RedHatPlugin, DebianPlugin): self.pcp_hostname, '*') pmlogger_ls = self.exec_cmd("ls -t1 %s" % path) if pmlogger_ls['status'] == 0: - for line in open(pmlogger_ls['output']).read().splitlines(): + for line in pmlogger_ls['output'].splitlines(): self.add_copy_spec(line, sizelimit=0) files_collected = files_collected + 1 if self.countlimit and files_collected == self.countlimit: |