summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelogs/fragments/nios_a_record_delete_failure_with_uppercase_name.yaml2
-rw-r--r--lib/ansible/module_utils/net_tools/nios/api.py5
2 files changed, 7 insertions, 0 deletions
diff --git a/changelogs/fragments/nios_a_record_delete_failure_with_uppercase_name.yaml b/changelogs/fragments/nios_a_record_delete_failure_with_uppercase_name.yaml
new file mode 100644
index 0000000000..904635e906
--- /dev/null
+++ b/changelogs/fragments/nios_a_record_delete_failure_with_uppercase_name.yaml
@@ -0,0 +1,2 @@
+bugfixes:
+ - Fixes bug where nios_a_record wasn't getting deleted if an uppercase named a_record was being passed. (https://github.com/ansible/ansible/pull/51539)
diff --git a/lib/ansible/module_utils/net_tools/nios/api.py b/lib/ansible/module_utils/net_tools/nios/api.py
index d1830fae2a..8b96c0200f 100644
--- a/lib/ansible/module_utils/net_tools/nios/api.py
+++ b/lib/ansible/module_utils/net_tools/nios/api.py
@@ -356,6 +356,11 @@ class WapiModule(WapiBase):
test_obj_filter = dict([('name', name)])
else:
test_obj_filter = dict([('name', name), ('view', obj_filter['view'])])
+ elif (ib_obj_type == NIOS_A_RECORD):
+ # resolves issue where a_record with uppercase name was returning null and was failing
+ test_obj_filter = obj_filter
+ test_obj_filter['name'] = test_obj_filter['name'].lower()
+ # check if test_obj_filter is empty copy passed obj_filter
else:
test_obj_filter = dict([('name', name)])
ib_obj = self.get_object(ib_obj_type, test_obj_filter.copy(), return_fields=ib_spec.keys())