Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
5406f147
Commit
5406f147
authored
Jan 19, 2015
by
Luca Falavigna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port JSONLogger module to latest sbuild codebase
parent
dbed2678
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
debomatic-modules/JSONLogger.py
debomatic-modules/JSONLogger.py
+13
-14
No files found.
debomatic-modules/JSONLogger.py
View file @
5406f147
...
@@ -64,30 +64,29 @@ class DebomaticModule_JSONLogger:
...
@@ -64,30 +64,29 @@ class DebomaticModule_JSONLogger:
def
_set_json_logfile_name
(
self
,
args
):
def
_set_json_logfile_name
(
self
,
args
):
"""If debomatic config file has section [jsonlogger] try to get
"""If debomatic config file has section [jsonlogger] try to get
'jsonfile' option and override the default value."""
'jsonfile' option and override the default value."""
if
'opts'
in
args
and
\
if
(
args
.
opts
.
has_section
(
'jsonlogger'
)
and
args
[
'opts'
].
has_section
(
'jsonlogger'
)
and
\
args
.
opts
.
has_option
(
'jsonlogger'
,
'jsonfile'
)):
args
[
'opts'
].
has_option
(
'jsonlogger'
,
'jsonfile'
):
self
.
jsonfile
=
args
.
opts
.
get
(
'jsonlogger'
,
'jsonfile'
).
strip
()
self
.
jsonfile
=
args
[
'opts'
].
get
(
'jsonlogger'
,
'jsonfile'
).
strip
()
def
_get_package_json_filename
(
self
,
args
):
def
_get_package_json_filename
(
self
,
args
):
"""Get the path of package JSON file"""
"""Get the path of package JSON file"""
return
'%(directory)s/pool/%(package)s/%(package)s.json'
%
args
return
(
'%(directory)s/pool/%(package)s/%(package)s.json'
%
{
'directory'
:
args
.
directory
,
'package'
:
args
.
package
})
def
_get_distribution_status
(
self
,
args
):
def
_get_distribution_status
(
self
,
args
):
"""From args to distribution status"""
"""From args to distribution status"""
status
=
{}
status
=
{}
status
[
'status'
]
=
args
[
'cmd'
]
status
[
'status'
]
=
args
.
action
status
[
'distribution'
]
=
args
[
'distribution'
]
status
[
'distribution'
]
=
args
.
distribution
if
'success'
in
args
:
status
[
'success'
]
=
args
.
success
status
[
'success'
]
=
args
[
'success'
]
return
status
return
status
def
_get_package_status
(
self
,
args
):
def
_get_package_status
(
self
,
args
):
"""From args to package status"""
"""From args to package status"""
status
=
{}
status
=
{}
for
k
in
[
'package'
,
'distribution'
,
'uploader'
]:
status
[
'package'
]
=
args
.
package
if
k
in
args
:
status
[
'distribution'
]
=
args
.
distribution
status
[
k
]
=
args
[
k
]
status
[
'uploader'
]
=
args
.
uploader
return
status
return
status
def
_append_json_logfile
(
self
,
args
,
status
):
def
_append_json_logfile
(
self
,
args
,
status
):
...
@@ -145,9 +144,9 @@ class DebomaticModule_JSONLogger:
...
@@ -145,9 +144,9 @@ class DebomaticModule_JSONLogger:
def
post_build
(
self
,
args
):
def
post_build
(
self
,
args
):
status
=
self
.
_get_package_status
(
args
)
status
=
self
.
_get_package_status
(
args
)
status
[
'status'
]
=
'build'
status
[
'status'
]
=
'build'
status
[
'success'
]
=
args
[
'success'
]
status
[
'success'
]
=
args
.
success
status
[
'files'
]
=
{}
status
[
'files'
]
=
{}
resultdir
=
os
.
path
.
join
(
args
[
'directory'
],
'pool'
,
args
[
'package'
]
)
resultdir
=
os
.
path
.
join
(
args
.
directory
,
'pool'
,
args
.
package
)
for
filename
in
os
.
listdir
(
resultdir
):
for
filename
in
os
.
listdir
(
resultdir
):
if
filename
.
endswith
(
'.json'
):
if
filename
.
endswith
(
'.json'
):
continue
continue
...
...
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