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
Labels
Merge Requests
107
Merge Requests
107
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
362c2f6b
Commit
362c2f6b
authored
Jun 02, 2014
by
Marco Mariani
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsondump recipes: return paths and update files
parent
bb742760
Changes
2
Hide 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 @
362c2f6b
...
...
@@ -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
slapos/recipe/slapconfiguration.py
View file @
362c2f6b
...
...
@@ -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
Kirill Smelkov
@kirr
mentioned in commit
e18d01ba
·
Feb 21, 2016
mentioned in commit
e18d01ba
mentioned in commit e18d01baf20b83d1e8d851e4d0e229f92d6cbb11
Toggle commit list
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