summaryrefslogtreecommitdiff
path: root/commands/command.py
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@lodoss.net>2014-12-14 22:53:21 +0000
committerFederico G. Schwindt <fgsch@lodoss.net>2014-12-14 22:53:21 +0000
commit3fca5e587694989cf74808d49341b83b487a782b (patch)
tree2e0e40741888d1d4ecbb6339d40d3cb52dd59c56 /commands/command.py
parentb0c94cd6f634bccc3f2393a28a1e60478097483b (diff)
downloadansible-modules-core-3fca5e587694989cf74808d49341b83b487a782b.tar.gz
Allow globbing in creates= and removes= directives
Fixes 1904
Diffstat (limited to 'commands/command.py')
-rw-r--r--commands/command.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/commands/command.py b/commands/command.py
index c584d6fe..bc286d68 100644
--- a/commands/command.py
+++ b/commands/command.py
@@ -20,6 +20,7 @@
import sys
import datetime
+import glob
import traceback
import re
import shlex
@@ -161,7 +162,7 @@ def main():
# and the filename already exists. This allows idempotence
# of command executions.
v = os.path.expanduser(creates)
- if os.path.exists(v):
+ if glob.glob(v):
module.exit_json(
cmd=args,
stdout="skipped, since %s exists" % v,
@@ -175,7 +176,7 @@ def main():
# and the filename does not exist. This allows idempotence
# of command executions.
v = os.path.expanduser(removes)
- if not os.path.exists(v):
+ if not glob.glob(v):
module.exit_json(
cmd=args,
stdout="skipped, since %s does not exist" % v,