summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorQ <thread13@users.noreply.github.com>2015-06-02 13:32:22 +1000
committerGreg DeKoenigsberg <greg@eucalyptus.com>2015-06-16 11:33:13 -0400
commit927d490f7644f0bbda3cd167f66c2d74ccb68c5f (patch)
treed1ebe507f6ad4d08c67f78d39d5f28fb364f62df /files
parent391df0ffe0f7fbf622b0e9261a8fb32e2849a67a (diff)
downloadansible-modules-extras-927d490f7644f0bbda3cd167f66c2d74ccb68c5f.tar.gz
patch module: 'backup_copy' parameter renamed to 'backup'
Diffstat (limited to 'files')
-rw-r--r--files/patch.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/files/patch.py b/files/patch.py
index 0932ed35..085784e7 100644
--- a/files/patch.py
+++ b/files/patch.py
@@ -65,7 +65,7 @@ options:
required: false
type: "int"
default: "0"
- backup_copy:
+ backup:
description:
- passes --backup --version-control=numbered to patch,
producing numbered backup copies
@@ -133,8 +133,9 @@ def main():
'basedir': {},
'strip': {'default': 0, 'type': 'int'},
'remote_src': {'default': False, 'type': 'bool'},
- # don't call it "backup" since the semantics differs from the default one
- 'backup_copy': { 'default': False, 'type': 'bool' }
+ # NB: for 'backup' parameter, semantics is slightly different from standard
+ # since patch will create numbered copies, not strftime("%Y-%m-%d@%H:%M:%S~")
+ 'backup': { 'default': False, 'type': 'bool' }
},
required_one_of=[['dest', 'basedir']],
supports_check_mode=True
@@ -168,7 +169,7 @@ def main():
if not is_already_applied(patch_func, p.src, p.basedir, dest_file=p.dest, strip=p.strip):
try:
apply_patch( patch_func, p.src, p.basedir, dest_file=p.dest, strip=p.strip,
- dry_run=module.check_mode, backup=p.backup_copy )
+ dry_run=module.check_mode, backup=p.backup )
changed = True
except PatchError, e:
module.fail_json(msg=str(e))