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
b01da1b7
Commit
b01da1b7
authored
10 years ago
by
jjshoe
Committed by
James Cammarata
10 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure the validation string has %s in it
parent
1248d2ce
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
0 deletions
+6
-0
library/files/copy
+2
-0
library/files/lineinfile
+2
-0
library/files/replace
+2
-0
No files found.
library/files/copy
View file @
b01da1b7
...
@@ -204,6 +204,8 @@ def main():
...
@@ -204,6 +204,8 @@ def main():
os
.
unlink
(
dest
)
os
.
unlink
(
dest
)
open
(
dest
,
'w'
)
.
close
()
open
(
dest
,
'w'
)
.
close
()
if
validate
:
if
validate
:
if
"
%
s"
not
in
validate
:
module
.
fail_json
(
msg
=
"validate must contain
%%
s:
%
s"
%
(
validate
))
(
rc
,
out
,
err
)
=
module
.
run_command
(
validate
%
src
)
(
rc
,
out
,
err
)
=
module
.
run_command
(
validate
%
src
)
if
rc
!=
0
:
if
rc
!=
0
:
module
.
fail_json
(
msg
=
"failed to validate: rc:
%
s error:
%
s"
%
(
rc
,
err
))
module
.
fail_json
(
msg
=
"failed to validate: rc:
%
s error:
%
s"
%
(
rc
,
err
))
...
...
This diff is collapsed.
Click to expand it.
library/files/lineinfile
View file @
b01da1b7
...
@@ -154,6 +154,8 @@ def write_changes(module,lines,dest):
...
@@ -154,6 +154,8 @@ def write_changes(module,lines,dest):
validate
=
module
.
params
.
get
(
'validate'
,
None
)
validate
=
module
.
params
.
get
(
'validate'
,
None
)
valid
=
not
validate
valid
=
not
validate
if
validate
:
if
validate
:
if
"
%
s"
not
in
validate
:
module
.
fail_json
(
msg
=
"validate must contain
%%
s:
%
s"
%
(
validate
))
(
rc
,
out
,
err
)
=
module
.
run_command
(
validate
%
tmpfile
)
(
rc
,
out
,
err
)
=
module
.
run_command
(
validate
%
tmpfile
)
valid
=
rc
==
0
valid
=
rc
==
0
if
rc
!=
0
:
if
rc
!=
0
:
...
...
This diff is collapsed.
Click to expand it.
library/files/replace
View file @
b01da1b7
...
@@ -90,6 +90,8 @@ def write_changes(module,contents,dest):
...
@@ -90,6 +90,8 @@ def write_changes(module,contents,dest):
validate
=
module
.
params
.
get
(
'validate'
,
None
)
validate
=
module
.
params
.
get
(
'validate'
,
None
)
valid
=
not
validate
valid
=
not
validate
if
validate
:
if
validate
:
if
"
%
s"
not
in
validate
:
module
.
fail_json
(
msg
=
"validate must contain
%%
s:
%
s"
%
(
validate
))
(
rc
,
out
,
err
)
=
module
.
run_command
(
validate
%
tmpfile
)
(
rc
,
out
,
err
)
=
module
.
run_command
(
validate
%
tmpfile
)
valid
=
rc
==
0
valid
=
rc
==
0
if
rc
!=
0
:
if
rc
!=
0
:
...
...
This diff is collapsed.
Click to expand it.
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