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
changes/70/784570/1
matbu 2 weeks ago
parent
commit
8edaf4ebbd
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      tripleoclient/v1/tripleo_validator.py

+ 1
- 1
tripleoclient/v1/tripleo_validator.py View File

@ -421,13 +421,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