mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 03:01:06 -03:30
Merge pull request #1 from AlanCoding/npithon
Follow comments, split non-list objects
This commit is contained in:
@@ -196,7 +196,7 @@ class LookupModule(LookupBase):
|
|||||||
if isinstance(rule[field_name], int):
|
if isinstance(rule[field_name], int):
|
||||||
rule[field_name] = [rule[field_name]]
|
rule[field_name] = [rule[field_name]]
|
||||||
# If its not a list, we need to split it into a list
|
# If its not a list, we need to split it into a list
|
||||||
if isinstance(rule[field_name], list):
|
if not isinstance(rule[field_name], list):
|
||||||
rule[field_name] = rule[field_name].split(',')
|
rule[field_name] = rule[field_name].split(',')
|
||||||
for value in rule[field_name]:
|
for value in rule[field_name]:
|
||||||
# If they have a list of strs we want to strip the str incase its space delineated
|
# If they have a list of strs we want to strip the str incase its space delineated
|
||||||
@@ -210,7 +210,9 @@ class LookupModule(LookupBase):
|
|||||||
|
|
||||||
def process_list(self, field_name, rule, valid_list, rule_number):
|
def process_list(self, field_name, rule, valid_list, rule_number):
|
||||||
return_values = []
|
return_values = []
|
||||||
rule[field_name] = rule[field_name].split(',')
|
# If its not a list, we need to split it into a list
|
||||||
|
if not isinstance(rule[field_name], list):
|
||||||
|
rule[field_name] = rule[field_name].split(',')
|
||||||
for value in rule[field_name]:
|
for value in rule[field_name]:
|
||||||
value = value.strip()
|
value = value.strip()
|
||||||
if value not in valid_list:
|
if value not in valid_list:
|
||||||
|
|||||||
Reference in New Issue
Block a user