Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible: minor python2/3 compat fix #1607

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ansible/plugins/filter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


def match_key(value, dictionary, raise_error=True, feedback_name='os'):
for key, val in dictionary.iteritems():
for key, val in dictionary.items():
# yes, yes; we can lambda this but my old self in
# two years will cry having to understand
if type(val) is list:
Expand Down
8 changes: 4 additions & 4 deletions ansible/plugins/inventory/nodejs_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def main():
config.read('ansible.cfg')

for host_types in hosts['hosts']:
for host_type, providers in host_types.iteritems():
for host_type, providers in host_types.items():
export[host_type] = {}
export[host_type]['hosts'] = []

Expand All @@ -96,8 +96,8 @@ def main():
}

for provider in providers:
for provider_name, hosts in provider.iteritems():
for host, metadata in hosts.iteritems():
for provider_name, hosts in provider.items():
for host, metadata in hosts.items():

# some hosts have metadata appended to provider
# which requires underscore
Expand All @@ -111,7 +111,7 @@ def main():

try:
parsed_host = parse_host(hostname)
for k, v in parsed_host.iteritems():
for k, v in parsed_host.items():
c.update({k: v[0] if type(v) is dict else v})
except Exception, e:
raise Exception('Failed to parse host: %s' % e)
Expand Down
2 changes: 1 addition & 1 deletion ansible/plugins/library/ssh_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@


def multi_replace(content, to_replace):
for key, val in to_replace.iteritems():
for key, val in to_replace.items():
content = content.replace(key, val)
return content

Expand Down