Skip to content

Commit

Permalink
[sapnw] Fix IndexError exception
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jcastill authored and TurboTurtle committed Aug 12, 2021
1 parent fd75745 commit dd803bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sos/report/plugins/sapnw.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def collect_list_instances(self):
# 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]
Expand Down

0 comments on commit dd803bd

Please sign in to comment.