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
)
This commit is contained in:
parent
54766681f5
commit
f44a61ec06
|
@ -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…
Reference in New Issue