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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
40f92aae
Commit
40f92aae
authored
Aug 10, 2012
by
Antoine Catton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the ability to specify filemode to template recipe
(cherry picked from commit
3143874b
)
parent
7cf3adc5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
slapos/recipe/template.py
slapos/recipe/template.py
+8
-2
No files found.
slapos/recipe/template.py
View file @
40f92aae
...
...
@@ -24,17 +24,23 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
os
from
slapos.recipe.librecipe
import
GenericBaseRecipe
class
Recipe
(
GenericBaseRecipe
):
def
install
(
self
):
mapping
=
self
.
options
.
copy
()
for
key
in
(
'output'
,
'template'
,
'recipe'
,
):
del
mapping
[
key
]
for
key
in
(
'output'
,
'template'
,
'recipe'
,
'mode'
):
if
key
in
mapping
:
del
mapping
[
key
]
with
open
(
self
.
options
[
'output'
],
'w'
)
as
output
,
\
open
(
self
.
options
[
'template'
],
'r'
)
as
template
:
output
.
write
(
template
.
read
()
%
mapping
)
if
'mode'
in
self
.
options
:
os
.
chmod
(
self
.
options
[
'output'
],
int
(
self
.
options
[
'mode'
],
8
))
return
[
self
.
options
[
'output'
],
]
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