Commit dc1fdcf2 by Kevin Falcone

Compatibility with Ansible 1.9

1.9 requires that you import * from ansible.module_utils.basic
and to_native doesn't exist in 1.9, however this works fine for
our uses on 16.04.
parent dc465a66
...@@ -237,8 +237,7 @@ status: ...@@ -237,8 +237,7 @@ status:
import os import os
import glob import glob
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import *
from ansible.module_utils._text import to_bytes, to_native
# =========================================== # ===========================================
# Main control flow # Main control flow
...@@ -285,7 +284,7 @@ def main(): ...@@ -285,7 +284,7 @@ def main():
# load return of systemctl show into dictionary for easy access and return # load return of systemctl show into dictionary for easy access and return
k = None k = None
multival = [] multival = []
for line in to_native(out).split('\n'): # systemd can have multiline values delimited with {} for line in out.split('\n'): # systemd can have multiline values delimited with {}
if line.strip(): if line.strip():
if k is None: if k is None:
if '=' in line: if '=' in line:
......
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