Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
iv
slapos
Commits
e18d01ba
Commit
e18d01ba
authored
10 years ago
by
Marco Mariani
Committed by
Cédric de Saint Martin
10 years ago
Browse files
Options
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):
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
.
close
()
def
install
(
self
):
return
[]
return
[
self
.
_json_output
]
update
=
install
This diff is collapsed.
Click to expand it.
slapos/recipe/slapconfiguration.py
View file @
e18d01ba
...
...
@@ -170,6 +170,12 @@ class Serialised(Recipe):
class
JsonDump
(
Recipe
):
def
__init__
(
self
,
buildout
,
name
,
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
))
def
install
(
self
):
return
[
self
.
_json_output
]
update
=
install
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