Skip to content

Commit

Permalink
Merge pull request #1 from AlanCoding/npithon
Browse files Browse the repository at this point in the history
Follow comments, split non-list objects
  • Loading branch information
npithonDR committed Feb 24, 2023
2 parents 951eee9 + 3051384 commit 335ac63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions awx_collection/plugins/lookup/schedule_rruleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def process_integer(self, field_name, rule, min_value, max_value, rule_number):
if isinstance(rule[field_name], int):
rule[field_name] = [rule[field_name]]
# 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(',')
for value in rule[field_name]:
# If they have a list of strs we want to strip the str incase its space delineated
Expand All @@ -210,7 +210,9 @@ def process_integer(self, field_name, rule, min_value, max_value, rule_number):

def process_list(self, field_name, rule, valid_list, rule_number):
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]:
value = value.strip()
if value not in valid_list:
Expand Down

0 comments on commit 335ac63

Please sign in to comment.