Browse Source

Declare is_failed_validation variable before if statement

Declare is_failed_validation variable before the if statement otherwise
if results is None, we hit a 'reference before assignment'

Change-Id: I293389c366fd49fbdde2ea55d3a3ebed1c598195
(cherry picked from commit 8edaf4ebbd)
changes/79/790979/1
matbu 7 months ago
committed by mbu
parent
commit
61390cc44d
  1. 2
      tripleoclient/v1/tripleo_validator.py

2
tripleoclient/v1/tripleo_validator.py

@ -429,13 +429,13 @@ class TripleOValidatorRun(command.Command):
except RuntimeError as e:
raise exceptions.CommandError(e)
is_failed_validation = False
if results:
# Build output
t = PrettyTable(border=True, header=True, padding_width=1)
# Set Field name by getting the result dict keys
t.field_names = results[0].keys()
t.align = 'l'
is_failed_validation = False
for r in results:
if r.get('Status_by_Host'):
h = []

Loading…
Cancel
Save