Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
aa704a61
Commit
aa704a61
authored
Sep 04, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backuplocal => backup_local for API standardization reasons
parent
b97e2a6f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
lib/ansible/module_common.py
+1
-1
library/assemble
+1
-1
library/copy
+1
-1
library/lineinfile
+2
-2
No files found.
lib/ansible/module_common.py
View file @
aa704a61
...
...
@@ -276,7 +276,7 @@ class AnsibleModule(object):
infile.close()
return digest.hexdigest()
def backuplocal(self, fn):
def backup
_
local(self, fn):
'''make a date-marked backup of the specified file, return True or False on success or failure'''
# backups named basename-YYYY-MM-DD@HH:MM~
ext = time.strftime("
%
Y-
%
m-
%
d@
%
H:
%
M~", time.localtime(time.time()))
...
...
library/assemble
View file @
aa704a61
...
...
@@ -75,7 +75,7 @@ def main():
if
pathmd5
!=
destmd5
:
if
backup
and
destmd5
is
not
None
:
module
.
backuplocal
(
dest
)
module
.
backup
_
local
(
dest
)
shutil
.
copy
(
path
,
dest
)
changed
=
True
...
...
library/copy
View file @
aa704a61
...
...
@@ -63,7 +63,7 @@ def main():
try
:
if
backup
:
if
os
.
path
.
exists
(
dest
):
backup_file
=
module
.
backuplocal
(
dest
)
backup_file
=
module
.
backup
_
local
(
dest
)
shutil
.
copyfile
(
src
,
dest
)
except
shutil
.
Error
:
module
.
fail_json
(
msg
=
"failed to copy:
%
s and
%
s are the same"
%
(
src
,
dest
))
...
...
library/lineinfile
View file @
aa704a61
...
...
@@ -70,7 +70,7 @@ def present(module, name, regexp, line, insertafter, backup):
if
changed
:
if
backup
:
module
.
backuplocal
(
name
)
module
.
backup
_
local
(
name
)
f
=
open
(
name
,
'wb'
)
f
.
writelines
(
lines
)
f
.
close
()
...
...
@@ -93,7 +93,7 @@ def absent(module, name, regexp, backup):
changed
=
len
(
found
)
>
0
if
changed
:
if
backup
:
module
.
backuplocal
(
name
)
module
.
backup
_
local
(
name
)
f
=
open
(
name
,
'wb'
)
f
.
writelines
(
lines
)
f
.
close
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment