Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/ansible/plugins/lookup/jerakia.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def get_config(self, configfile=os.environ.get('ANSIBLE_JERAKIA_CONFIG', 'jeraki
if os.path.isfile(configfile):
data = open(configfile, "r")
defined_config = yaml.load(data)
combined_config = dict(defaults.items() + defined_config.items())
combined_config = defaults.copy()
combined_config.update(defined_config)
return combined_config
else:
raise AnsibleError("Unable to find configuration file %s" % configfile)
Expand Down Expand Up @@ -77,7 +78,7 @@ def scope(self, variables):
scope_conf = self.config['scope']
if not self.config['scope']:
return {}
for key, val in scope_conf.iteritems():
for key, val in scope_conf.items():
metadata_entry = "metadata_%(key)s" % locals()
scope_value = self.dot_to_dictval(variables, val)
scope_data[metadata_entry] = scope_value
Expand All @@ -101,7 +102,8 @@ def lookup(self, key, namespace, policy='default', variables=None):
'policy': policy,
}

params = dict(scope.items() + options.items())
params = scope.copy()
params.update(options)
headers = self.headers()

response = requests.get(endpoint_url, params=params, headers=headers)
Expand Down