Merge "Refactor the groups property in Validation class."

This commit is contained in:
Zuul 2021-03-04 14:58:32 +00:00 committed by Gerrit Code Review
commit 125bbf01c7
1 changed files with 1 additions and 5 deletions

View File

@ -219,11 +219,7 @@ class Validation(object):
['group1', 'group2']
"""
if self.has_metadata_dict:
groups = self.dict['vars']['metadata'].get('groups')
if groups:
return groups
else:
return []
return self.dict['vars']['metadata'].get('groups', [])
else:
raise NameError(
"No metadata found in validation {}".format(self.id)