From fc5ade402039bbdc519e24700fbf190b5626d299 Mon Sep 17 00:00:00 2001 From: Kei Nohguchi Date: Sat, 16 Apr 2016 13:04:37 -0700 Subject: [PATCH] ops_template.py: Taking care of the JSON src variable (#3313) * ops_template.py: Taking care of the JSON src variable * ops_template.py: Specify type='str' for src argument to be explicit --- lib/ansible/modules/network/openswitch/ops_template.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/openswitch/ops_template.py b/lib/ansible/modules/network/openswitch/ops_template.py index 91c737b6173..0f07baee156 100644 --- a/lib/ansible/modules/network/openswitch/ops_template.py +++ b/lib/ansible/modules/network/openswitch/ops_template.py @@ -168,7 +168,7 @@ def main(): """ argument_spec = dict( - src=dict(type='dict'), + src=dict(type='str'), force=dict(default=False, type='bool'), backup=dict(default=False, type='bool'), config=dict(type='dict'), @@ -180,8 +180,6 @@ def main(): mutually_exclusive=mutually_exclusive, supports_check_mode=True) - src = module.params['src'] - result = dict(changed=False) contents = get_config(module) @@ -189,6 +187,7 @@ def main(): if module.params['transport'] in ['ssh', 'rest']: config = contents + src = module.from_json(module.params['src']) changeset = diff(src, config) candidate = merge(changeset, config)