Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos
Commits
fbf207fc
Commit
fbf207fc
authored
Dec 03, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass extra parameters through the wrapper
parent
e6b93ecf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
slapos/recipe/librecipe/__init__.py
slapos/recipe/librecipe/__init__.py
+1
-0
slapos/recipe/librecipe/generic.py
slapos/recipe/librecipe/generic.py
+7
-2
No files found.
slapos/recipe/librecipe/__init__.py
View file @
fbf207fc
...
...
@@ -154,6 +154,7 @@ class BaseSlapRecipe:
self
.
_writeExecutable
(
wrapper_path
,
file_content
)
return
wrapper_path
# XXX methinks the following method is unused / obsolete.
def
createReportRunningWrapper
(
self
,
file_content
):
"""Creates report runnig wrapper and returns its path"""
report_wrapper_path
=
os
.
path
.
join
(
self
.
wrapper_report_directory
,
...
...
slapos/recipe/librecipe/generic.py
View file @
fbf207fc
...
...
@@ -127,7 +127,7 @@ class GenericBaseRecipe(object):
path
,
arguments
=
arguments
)[
0
]
return
script
def
createWrapper
(
self
,
name
,
command
,
parameters
,
comments
=
[]):
def
createWrapper
(
self
,
name
,
command
,
parameters
,
comments
=
[]
,
parameters_extra
=
False
):
"""
Creates a very simple (one command) shell script for process replacement.
Takes care of quoting.
...
...
@@ -141,12 +141,17 @@ class GenericBaseRecipe(object):
lines
.
append
(
'exec %s'
%
shlex
.
quote
(
command
))
for
param
in
parameters
:
if
len
(
lines
[
-
1
])
<
3
0
:
if
len
(
lines
[
-
1
])
<
4
0
:
lines
[
-
1
]
+=
' '
+
shlex
.
quote
(
param
)
else
:
lines
[
-
1
]
+=
'
\
\
'
lines
.
append
(
'
\
t
'
+
shlex
.
quote
(
param
))
if
parameters_extra
:
# pass-through further parameters
lines
[
-
1
]
+=
'
\
\
'
lines
.
append
(
'
\
t
$@'
)
content
=
'
\
n
'
.
join
(
lines
)
+
'
\
n
'
return
self
.
createFile
(
name
,
content
,
0700
)
...
...
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