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
Thomas Gambier
slapos
Commits
e18d01ba
Commit
e18d01ba
authored
Jun 02, 2014
by
Marco Mariani
Committed by
Cédric de Saint Martin
Aug 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsondump recipes: return paths and update files
(cherry picked from commit
362c2f6b
)
parent
9868d2c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
slapos/recipe/jsondump.py
slapos/recipe/jsondump.py
+5
-2
slapos/recipe/slapconfiguration.py
slapos/recipe/slapconfiguration.py
+7
-1
No files found.
slapos/recipe/jsondump.py
View file @
e18d01ba
...
@@ -10,10 +10,13 @@ class Recipe(object):
...
@@ -10,10 +10,13 @@ class Recipe(object):
if
key
not
in
[
'json-output'
,
'recipe'
]
if
key
not
in
[
'json-output'
,
'recipe'
]
}
}
with
os
.
fdopen
(
os
.
open
(
options
[
'json-output'
],
os
.
O_WRONLY
|
os
.
O_CREAT
|
os
.
O_TRUNC
,
0o600
),
'w'
)
as
fout
:
self
.
_json_output
=
options
[
'json-output'
]
with
os
.
fdopen
(
os
.
open
(
self
.
_json_output
,
os
.
O_WRONLY
|
os
.
O_CREAT
|
os
.
O_TRUNC
,
0o600
),
'w'
)
as
fout
:
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
fout
.
close
()
fout
.
close
()
def
install
(
self
):
def
install
(
self
):
return
[]
return
[
self
.
_json_output
]
update
=
install
slapos/recipe/slapconfiguration.py
View file @
e18d01ba
...
@@ -170,6 +170,12 @@ class Serialised(Recipe):
...
@@ -170,6 +170,12 @@ class Serialised(Recipe):
class
JsonDump
(
Recipe
):
class
JsonDump
(
Recipe
):
def
__init__
(
self
,
buildout
,
name
,
options
):
def
__init__
(
self
,
buildout
,
name
,
options
):
parameter_dict
=
self
.
fetch_parameter_dict
(
options
)
parameter_dict
=
self
.
fetch_parameter_dict
(
options
)
with
os
.
fdopen
(
os
.
open
(
options
[
'json-output'
],
os
.
O_WRONLY
|
os
.
O_CREAT
,
0600
),
'w'
)
as
fout
:
self
.
_json_output
=
options
[
'json-output'
]
with
os
.
fdopen
(
os
.
open
(
self
.
_json_output
,
os
.
O_WRONLY
|
os
.
O_CREAT
,
0600
),
'w'
)
as
fout
:
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
def
install
(
self
):
return
[
self
.
_json_output
]
update
=
install
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