summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2016-04-29 20:33:06 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2016-04-29 20:33:35 -0700
commit1846de28095794f96914f10136af51f4e2676710 (patch)
treeeda250235787fb1024e9d1d335e638013e2dfc34 /files
parent3a7e4b58349511eca1d6ce9c12781f1299fd8e78 (diff)
downloadansible-modules-extras-1846de28095794f96914f10136af51f4e2676710.tar.gz
Switch blockinfile to using the latest best way to get ansible version
Diffstat (limited to 'files')
-rw-r--r--files/blockinfile.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/files/blockinfile.py b/files/blockinfile.py
index 3ff1bc7c..eadf3a62 100644
--- a/files/blockinfile.py
+++ b/files/blockinfile.py
@@ -150,8 +150,6 @@ import re
import os
import tempfile
-from ansible import __version__
-
def write_changes(module, contents, dest):
@@ -246,7 +244,7 @@ def main():
marker1 = re.sub(r'{mark}', 'END', marker)
if present and block:
# Escape seqeuences like '\n' need to be handled in Ansible 1.x
- if __version__.startswith('1.'):
+ if module.constants['ANSIBLE_VERSION'].startswith('1.'):
block = re.sub('', block, '')
blocklines = [marker0] + block.splitlines() + [marker1]
else: