diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-11-13 16:33:25 +0100 |
---|---|---|
committer | Pavel Moravec <pmoravec@redhat.com> | 2020-01-09 08:54:44 +0100 |
commit | 0e68c5067ecc94a1de263c0d0766c9c212d306a6 (patch) | |
tree | a3c3cd2431fb7f9a568eae1e2af17977280e1df6 | |
parent | 2224137c2b6e7931f2bb8bb8c48c414a7fa023f1 (diff) | |
download | sos-0e68c5067ecc94a1de263c0d0766c9c212d306a6.tar.gz |
[sapnw] implement collect_cmd_output API change
Since e8bb94c, collect_cmd_output returns a dict instead of filename.
Reflect the change in testing command output.
Resolves: #1859
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r-- | sos/plugins/sapnw.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sos/plugins/sapnw.py b/sos/plugins/sapnw.py index 9ce9c8ed..8e2b262a 100644 --- a/sos/plugins/sapnw.py +++ b/sos/plugins/sapnw.py @@ -32,14 +32,13 @@ class sapnw(Plugin, RedHatPlugin): "/usr/sap/hostctrl/exe/saphostctrl -function ListInstances", suggest_filename="SAPInstances" ) - if not inst_out: + if inst_out['status'] != 0: return sidsunique = set() # Cycle through all the instances, get 'sid', 'instance_number' # and 'vhost' to determine the proper profile - p = open(inst_out, "r").read().splitlines() - for inst_line in p: + for inst_line in inst_out['output'].splitlines(): if "DAA" not in inst_line: fields = inst_line.strip().split() sid = fields[3] @@ -99,11 +98,10 @@ class sapnw(Plugin, RedHatPlugin): suggest_filename="SAPDatabases" ) - if not db_out: + if db_out['status'] != 0: return - dbl = open(db_out, "r").read().splitlines() - for line in dbl: + for line in db_out['output'].splitlines(): if "Instance name" in line: fields = line.strip().split() dbadm = fields[2][:-1] |