aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Castillo <jcastillo@redhat.com>2021-08-12 11:43:57 +0200
committerJake Hunsaker <jhunsake@redhat.com>2021-08-12 10:05:50 -0400
commitdd803bd6fc646efc5cde1ef75035486f0ffb3f13 (patch)
tree5a265e427316e16e391ac39167140f56793b137a
parentfd75745e7a5a6c5def8e6d23190227872b9912c3 (diff)
downloadsos-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.py3
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]