summaryrefslogtreecommitdiff
path: root/lib/ansible/module_utils/facts
diff options
context:
space:
mode:
authorSam Doran <sdoran@ansible.com>2017-10-03 23:38:58 -0400
committerGitHub <noreply@github.com>2017-10-03 23:38:58 -0400
commit00df1fda1072223580022a9e42d25fba393c494a (patch)
tree7c0a2f00ee6ce00dd3530cc132d5a317144a3b95 /lib/ansible/module_utils/facts
parentaa4b3f14c57735e0295a88c3960a701ed0261e15 (diff)
downloadansible-00df1fda1072223580022a9e42d25fba393c494a.tar.gz
Correctly write SELinux config file (#31251)
* Add new lines to end of config file lines * Properly write out selinux config file Change module behavior to not always report a change but warn if a reboot is needed and return reboot_required. Improve the output messages. Add strip parameter to get_file_lines utility to help with parsing the selinux config file. * Add return documentation * Add integration tests for selinux module * Use consistent capitalization for SELinux * Use atomic_move in selinux module * Don't copy the config file initially There's no need to make a copy just for reading. * Put message after set_config_policy in case the change fails * Add aliases to selinux tests
Diffstat (limited to 'lib/ansible/module_utils/facts')
-rw-r--r--lib/ansible/module_utils/facts/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/facts/utils.py b/lib/ansible/module_utils/facts/utils.py
index 2446ae678c..728934c1a5 100644
--- a/lib/ansible/module_utils/facts/utils.py
+++ b/lib/ansible/module_utils/facts/utils.py
@@ -36,9 +36,9 @@ def get_file_content(path, default=None, strip=True):
return data
-def get_file_lines(path):
+def get_file_lines(path, strip=True):
'''get list of lines from file'''
- data = get_file_content(path)
+ data = get_file_content(path, strip=strip)
if data:
ret = data.splitlines()
else: