From ac11027d58598277dcdd15d0875e272a2516dda5 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Thu, 1 Mar 2018 10:03:32 -0500 Subject: [PATCH] Convert key to snake. Fixes #36845. (#36887) (#36904) --- lib/ansible/module_utils/k8s/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/k8s/common.py b/lib/ansible/module_utils/k8s/common.py index 315c4ff79f2..e8e7738b9f7 100644 --- a/lib/ansible/module_utils/k8s/common.py +++ b/lib/ansible/module_utils/k8s/common.py @@ -192,7 +192,7 @@ class KubernetesAnsibleModule(AnsibleModule): elif key in self.helper.argspec and value is not None: parameters[key] = value elif isinstance(value, dict): - self._add_parameter(value, [key], parameters) + self._add_parameter(value, [to_snake(key)], parameters) return parameters def _add_parameter(self, request, path, parameters): @@ -200,12 +200,12 @@ class KubernetesAnsibleModule(AnsibleModule): if path: param_name = '_'.join(path + [to_snake(key)]) else: - param_name = self.helper.attribute_to_snake(key) + param_name = to_snake(key) if param_name in self.helper.argspec and value is not None: parameters[param_name] = value elif isinstance(value, dict): continue_path = copy.copy(path) if path else [] - continue_path.append(self.helper.attribute_to_snake(key)) + continue_path.append(to_snake(key)) self._add_parameter(value, continue_path, parameters) else: self.fail_json(