Skip to content

Commit

Permalink
Resolved issue with empty params (when it was resetting)
Browse files Browse the repository at this point in the history
  • Loading branch information
y0rune committed Jan 8, 2023
1 parent 5b1d2b7 commit 6941512
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plugins/modules/meraki_mx_content_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,17 @@ def main():
if module.params['state'] == 'present':
payload = dict()
if meraki.params['allowed_urls']:
payload['allowedUrlPatterns'] = meraki.params['allowed_urls']
if meraki.params['allowed_urls'] == ['None']: # Corner case for resetting
payload['allowedUrlPatterns'] = []
else:
payload['allowedUrlPatterns'] = meraki.params['allowed_urls']
if meraki.params['blocked_urls']:
payload['blockedUrlPatterns'] = meraki.params['blocked_urls']
if meraki.params['blocked_urls'] == ['None']: # Corner case for resetting
payload['blockedUrlPatterns'] = []
else:
payload['blockedUrlPatterns'] = meraki.params['blocked_urls']
if meraki.params['blocked_categories']:
if len(meraki.params['blocked_categories']) == 0: # Corner case for resetting
if meraki.params['blocked_categories'] == ['None']: # Corner case for resetting
payload['blockedUrlCategories'] = []
else:
category_path = meraki.construct_path('categories', net_id=net_id)
Expand Down

0 comments on commit 6941512

Please sign in to comment.