Skip to content

Commit

Permalink
[pfsense_inferface_group] Check that members list is unique
Browse files Browse the repository at this point in the history
  • Loading branch information
opoplawski committed Dec 23, 2023
1 parent dc6b953 commit f49e16f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/module_utils/interface_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ def _validate_params(self):
self.module.fail_json(msg='Group name cannot have more than 15 characters.')
if re.match('[0-9]$', params['name']) is not None:
self.module.fail_json(msg='Group name cannot end with a digit.')
# Make sure list of interfaces is a unique set
if len(params['members']) > len(set(params['members'])):
self.module.fail_json(msg='List of members is not unique.')
# TODO - check that name isn't in use by any interfaces

##############################
Expand Down

0 comments on commit f49e16f

Please sign in to comment.