in deploy/ansible/action_plugins/public_api.py [0:0]
def clean_structure(self, structure):
# Apply cleaning to the structure recursively
if isinstance(structure, dict):
cleaned_structure = {}
for k, v in structure.items():
if k == "parameters" and isinstance(v, list):
cleaned_structure[k] = self.clean_parameters(v)
else:
cleaned_structure[k] = self.clean_structure(v)
return cleaned_structure
elif isinstance(structure, list):
return [self.clean_structure(item) for item in structure if item != ""]
else:
return structure