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
1f53c89b
Commit
1f53c89b
authored
Mar 14, 2012
by
Seth Vidal
Committed by
Michael DeHaan
Mar 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert so they handle argsfiles rather than arguments
parent
a9a9e3af
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
4 deletions
+72
-4
library/command
+21
-1
library/git
+24
-1
library/service
+27
-2
No files found.
library/command
View file @
1f53c89b
...
...
@@ -27,6 +27,8 @@ import subprocess
import
sys
import
datetime
import
traceback
import
shlex
import
os
if
len
(
sys
.
argv
)
==
1
:
print
json
.
dumps
({
...
...
@@ -35,7 +37,25 @@ if len(sys.argv) == 1:
})
sys
.
exit
(
1
)
args
=
sys
.
argv
[
1
:]
argfile
=
sys
.
argv
[
1
]
if
not
os
.
path
.
exists
(
argfile
):
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"Argument file not found"
})
sys
.
exit
(
1
)
args
=
open
(
argfile
,
'r'
)
.
read
()
args
=
shlex
.
split
(
args
)
if
not
len
(
args
):
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"the command module requires arguments (-a)"
})
sys
.
exit
(
1
)
startd
=
datetime
.
datetime
.
now
()
try
:
...
...
library/git
View file @
1f53c89b
...
...
@@ -37,8 +37,31 @@ import subprocess
# to a dictionary
# FIXME: make more idiomatic
args
=
" "
.
join
(
sys
.
argv
[
1
:])
if
len
(
sys
.
argv
)
==
1
:
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"the command module requires arguments (-a)"
})
sys
.
exit
(
1
)
argfile
=
sys
.
argv
[
1
]
if
not
os
.
path
.
exists
(
argfile
):
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"Argument file not found"
})
sys
.
exit
(
1
)
args
=
open
(
argfile
,
'r'
)
.
read
()
items
=
shlex
.
split
(
args
)
if
not
len
(
items
):
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"the command module requires arguments (-a)"
})
sys
.
exit
(
1
)
params
=
{}
for
x
in
items
:
(
k
,
v
)
=
x
.
split
(
"="
)
...
...
library/service
View file @
1f53c89b
...
...
@@ -31,8 +31,33 @@ import subprocess
# to a dictionary
# FIXME: make more idiomatic
args
=
" "
.
join
(
sys
.
argv
[
1
:])
items
=
shlex
.
split
(
args
)
if
len
(
sys
.
argv
)
==
1
:
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"the command module requires arguments (-a)"
})
sys
.
exit
(
1
)
argfile
=
sys
.
argv
[
1
]
if
not
os
.
path
.
exists
(
argfile
):
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"Argument file not found"
})
sys
.
exit
(
1
)
args
=
open
(
argfile
,
'r'
)
.
read
()
itmes
=
shlex
.
split
(
args
)
if
not
len
(
items
):
print
json
.
dumps
({
"failed"
:
True
,
"msg"
:
"the command module requires arguments (-a)"
})
sys
.
exit
(
1
)
params
=
{}
for
x
in
items
:
(
k
,
v
)
=
x
.
split
(
"="
)
...
...
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