From 932ff9094993d649222f73e463d9cd88ec4676ee Mon Sep 17 00:00:00 2001 From: Jose Castillo Date: Fri, 8 Nov 2019 14:28:40 +0100 Subject: [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 Signed-off-by: Bryn M. Reeves --- sos/plugins/pcp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- cgit