summaryrefslogtreecommitdiffstats
path: root/lib/postmap
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2013-11-29 22:43:19 +0100
committerGuilhem Moulin <guilhem@fripost.org>2015-06-07 02:50:59 +0200
commit5c7776d957e9396a481066e1d9cf1acd78b52fe6 (patch)
treedda6282c38406aa0e0071da93c1393381d9d6020 /lib/postmap
parent89958abf4bc85a4e376cc68d98a721604af1ea77 (diff)
wibble
Diffstat (limited to 'lib/postmap')
-rw-r--r--lib/postmap10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/postmap b/lib/postmap
index c0bf03b..5691c48 100644
--- a/lib/postmap
+++ b/lib/postmap
@@ -68,8 +68,10 @@ def main():
)
params = module.params
- src = params['src']
- cmd = params['cmd']
+ src = params['src']
+ db = params['db']
+ cmd = params['cmd']
+ instance = params['instance']
if os.path.isabs(src):
src = src
@@ -80,7 +82,7 @@ def main():
module.fail_json(src=src, msg="no such file")
try:
- dst = "%s.%s" % (src, file_suffix(params['instance'], params['db']))
+ dst = "%s.%s" % (src, file_suffix(instance, db))
params['dest'] = dst
file_args = module.load_file_common_arguments(params)
@@ -89,7 +91,7 @@ def main():
if not os.path.exists(dst) or os.path.getmtime(dst) <= os.path.getmtime(src):
changed = True
if not module.check_mode:
- msg = compile( params['cmd'], params['instance'], params['db'], src)
+ msg = compile( cmd, instance, db, src)
except subprocess.CalledProcessError, e:
module.fail_json(rv=e.returncode, msg=e.output.rstrip())