Skip to content

Commit

Permalink
Merge pull request #431 from Kandarimegha/network_settings
Browse files Browse the repository at this point in the history
Error message is not specific when Global Pool is edited with invalid IPs
  • Loading branch information
madhansansel authored Oct 16, 2024
2 parents 7a44dc0 + eae3fe1 commit 2754840
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions plugins/modules/network_settings_workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,26 @@ def validate_input(self):
}
}

invalid_params_type = []

for config_item in self.config:
ip_pool = config_item.get("global_pool_details", {}).get("settings", {}).get("ip_pool", [])

for pool in ip_pool:
# Check for 'dhcp_server_ips'
if not isinstance(pool["dhcp_server_ips"], list):
invalid_params_type.append("'dhcp_server_ips' should be a list.")

# Check for 'dns_server_ips'
if not isinstance(pool["dns_server_ips"], list):
invalid_params_type.append("'dns_server_ips' should be a list.")

if invalid_params_type:
self.msg = "Invalid required parameter(s): {0}".format(', '.join(invalid_params_type))
self.result['response'] = self.msg
self.status = "failed"
return self

# Validate playbook params against the specification (temp_spec)
valid_temp, invalid_params = validate_list_of_dicts(self.config, temp_spec)
if invalid_params:
Expand Down

0 comments on commit 2754840

Please sign in to comment.