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
f0000a89
Commit
f0000a89
authored
12 years ago
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1480 from dagwieers/command-fix2
Use return codes > 255 for Ansible-specific errors.
parents
730031ec
8d4f9feb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
library/command
+4
-4
No files found.
library/command
View file @
f0000a89
...
...
@@ -84,7 +84,7 @@ def main():
args
=
module
.
params
[
'args'
]
if
args
.
strip
()
==
''
:
module
.
fail_json
(
rc
=
25
5
,
msg
=
"no command given"
)
module
.
fail_json
(
rc
=
25
6
,
msg
=
"no command given"
)
if
chdir
:
os
.
chdir
(
os
.
path
.
expanduser
(
chdir
))
...
...
@@ -99,7 +99,7 @@ def main():
except
(
OSError
,
IOError
),
e
:
module
.
fail_json
(
rc
=
e
.
errno
,
msg
=
str
(
e
),
cmd
=
args
)
except
:
module
.
fail_json
(
rc
=
25
4
,
msg
=
traceback
.
format_exc
(),
cmd
=
args
)
module
.
fail_json
(
rc
=
25
7
,
msg
=
traceback
.
format_exc
(),
cmd
=
args
)
endd
=
datetime
.
datetime
.
now
()
delta
=
endd
-
startd
...
...
@@ -178,9 +178,9 @@ class CommandModule(AnsibleModule):
elif
m
.
group
(
2
)
==
"chdir"
:
v
=
os
.
path
.
expanduser
(
v
)
if
not
(
os
.
path
.
exists
(
v
)
and
os
.
path
.
isdir
(
v
)):
self
.
fail_json
(
rc
=
25
3
,
msg
=
"cannot change to directory '
%
s': path does not exist"
%
v
)
self
.
fail_json
(
rc
=
25
8
,
msg
=
"cannot change to directory '
%
s': path does not exist"
%
v
)
elif
v
[
0
]
!=
'/'
:
self
.
fail_json
(
rc
=
25
2
,
msg
=
"the path for 'chdir' argument must be fully qualified"
)
self
.
fail_json
(
rc
=
25
9
,
msg
=
"the path for 'chdir' argument must be fully qualified"
)
params
[
'chdir'
]
=
v
args
=
r
.
sub
(
""
,
args
)
params
[
'args'
]
=
args
...
...
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