diff options
author | Jose Castillo <jcastillo@redhat.com> | 2021-08-12 11:43:57 +0200 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2021-08-12 10:05:50 -0400 |
commit | dd803bd6fc646efc5cde1ef75035486f0ffb3f13 (patch) | |
tree | 5a265e427316e16e391ac39167140f56793b137a | |
parent | fd75745e7a5a6c5def8e6d23190227872b9912c3 (diff) | |
download | sos-dd803bd6fc646efc5cde1ef75035486f0ffb3f13.tar.gz |
[sapnw] Fix IndexError exception
This patch solves the situation where the
command:
/usr/sap/hostctrl/exe/saphostctrl
-function ListInstances
returns:
No instances found
And a non-zero return code.
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
-rw-r--r-- | sos/report/plugins/sapnw.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sos/report/plugins/sapnw.py b/sos/report/plugins/sapnw.py index 4104e5ab..2794075c 100644 --- a/sos/report/plugins/sapnw.py +++ b/sos/report/plugins/sapnw.py @@ -35,7 +35,8 @@ class sapnw(Plugin, RedHatPlugin): # Cycle through all the instances, get 'sid', 'instance_number' # and 'vhost' to determine the proper profile for inst_line in inst_out['output'].splitlines(): - if "DAA" not in inst_line: + if ("DAA" not in inst_line and not + inst_line.startswith("No instances found")): fields = inst_line.strip().split() sid = fields[3] inst = fields[5] |