Skip to content

Commit

Permalink
Fixed python code to be python3 compatible. Fix compatibility for lat…
Browse files Browse the repository at this point in the history
…est Ansible 2.9.2 (#54)
  • Loading branch information
frank-u authored and nolte committed Jan 5, 2020
1 parent f8723d9 commit 6d45da9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions library/minecraft_server_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def __init__(self, module):
# Convert all values to strings. The default booleans in
# server.properties are represented by "true" and "false" instead of
# Python's "True" and "False", so convert them explicitly.
for name, value in properties.iteritems():
for name, value in properties.items():
properties[name] = (
str(value).lower() if isinstance(value, bool) else str(value)
)
Expand All @@ -169,7 +169,7 @@ def __init__(self, module):
else:
self.newlines.append(line)

for name, value in properties.iteritems():
for name, value in properties.items():
self.newlines.append("{}={}\n".format(name, value))
self._content_changed = True

Expand Down
2 changes: 1 addition & 1 deletion tasks/process_controll/systemd/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- include: Ubuntu.yml
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version | version_compare('16.04', '<')
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('16.04', '<')

- name: install units
template:
Expand Down

0 comments on commit 6d45da9

Please sign in to comment.