Fix number of columns obtained from PCS output

All faults tests checking pacemaker resources were failing on certain
OSP releases because an unexpected column with '*' characters was
obtained from parsing the command output
That column needs to be removed before processing the table

Change-Id: Ic48907b3e3bca6d368c791103c4880cf3b78c91d
This commit is contained in:
Eduardo Olivares 2020-06-11 13:03:16 +02:00
parent 1b980a3841
commit 353ff110c0
1 changed files with 2 additions and 1 deletions

View File

@ -67,9 +67,10 @@ def get_pcs_resources_table():
output = sh.execute("sudo pcs status | grep ocf",
ssh_client=ssh_client,
expect_exit_status=None).stdout
# remove the first column when it only includes '*' characters
output = output.replace('*', '').strip()
stream = six.StringIO(output)
table = pandas.read_csv(stream, delim_whitespace=True, header=None)
table.columns = ['resource', 'resource_type', 'resource_state',
'overcloud_node']
except ValueError: