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:
matbu 2021-04-02 16:00:20 +02:00 committed by mbu
parent 54766681f5
commit f44a61ec06
1 changed files with 1 additions and 1 deletions

View File

@ -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 = []