Commit 1f401432 by e0d Committed by Feanil Patel

removing camel case

parent 21832855
...@@ -11,7 +11,7 @@ author: Edward Zarecor ...@@ -11,7 +11,7 @@ author: Edward Zarecor
options: options:
function: function:
description: description:
- The function to apply, currently ['zipToDict','flatten'] - The function to apply, currently ['zip_to_dict','flatten']
required: true required: true
input: input:
description: description:
...@@ -25,7 +25,7 @@ options: ...@@ -25,7 +25,7 @@ options:
EXAMPLES = ''' EXAMPLES = '''
- name: Apply function to results from ec2_scaling_policies - name: Apply function to results from ec2_scaling_policies
util_map: util_map:
function: 'zipToDict' function: 'zip_to_dict'
input: "{{ created_policies.results }}" input: "{{ created_policies.results }}"
args: args:
- "name" - "name"
...@@ -74,7 +74,7 @@ def flatten(module, input): ...@@ -74,7 +74,7 @@ def flatten(module, input):
module.exit_json(function_output = flat) module.exit_json(function_output = flat)
def zipToDict(module, input, key_key, value_key): def zip_to_dict(module, input, key_key, value_key):
""" """
Takes an array of dicts and flattens it to a single dict by extracting the values Takes an array of dicts and flattens it to a single dict by extracting the values
of a provided key as the keys in the new dict and the values of the second of a provided key as the keys in the new dict and the values of the second
...@@ -106,7 +106,7 @@ def zipToDict(module, input, key_key, value_key): ...@@ -106,7 +106,7 @@ def zipToDict(module, input, key_key, value_key):
def main(): def main():
arg_spec = dict( arg_spec = dict(
function=dict(required=True,choices=['zipToDict','flatten']), function=dict(required=True,choices=['zip_to_dict','flatten']),
input=dict(required=True, type='str'), input=dict(required=True, type='str'),
args=dict(required=False, type='list'), args=dict(required=False, type='list'),
) )
...@@ -118,8 +118,8 @@ def main(): ...@@ -118,8 +118,8 @@ def main():
input = ast.literal_eval(module.params.get('input')) input = ast.literal_eval(module.params.get('input'))
args = module.params.get('args') args = module.params.get('args')
if target == 'zipToDict': if target == 'zip_to_dict':
zipToDict(module, input, *args) zip_to_dict(module, input, *args)
elif target == 'flatten': elif target == 'flatten':
flatten(module,input) flatten(module,input)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment