Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
3266b808
Commit
3266b808
authored
Dec 06, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: change report output
parent
385d4651
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration2.py
...ins/slapos_upgrader/Base_reportVirtualMasterMigration2.py
+20
-0
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration2.py
View file @
3266b808
...
@@ -3,28 +3,48 @@ sql_result_list = context.getPortalObject().portal_catalog(
...
@@ -3,28 +3,48 @@ sql_result_list = context.getPortalObject().portal_catalog(
select_list
=
group_by_list
+
[
'count(*)'
],
select_list
=
group_by_list
+
[
'count(*)'
],
portal_type
=
"Instance Tree"
,
portal_type
=
"Instance Tree"
,
title
=
"_remote_%"
,
title
=
"_remote_%"
,
#url_string="https://lab.nexedi.com/nexedi/slapos/%",
slap_state
=
[
"start_requested"
,
"stop_requested"
],
slap_state
=
[
"start_requested"
,
"stop_requested"
],
group_by
=
group_by_list
,
group_by
=
group_by_list
,
#sort_on=[['count(*)', 'DESC']]
#sort_on=[['count(*)', 'DESC']]
)
)
project_soft_dict
=
{}
project_soft_dict
=
{}
soft_proj_dict
=
{}
for
sql_result
in
sql_result_list
:
for
sql_result
in
sql_result_list
:
soft
=
sql_result
[
'url_string'
].
split
(
'/'
)[
-
2
]
+
' <i>'
+
sql_result
[
'source_reference'
]
+
'</i>'
soft
=
sql_result
[
'url_string'
].
split
(
'/'
)[
-
2
]
+
' <i>'
+
sql_result
[
'source_reference'
]
+
'</i>'
project
=
sql_result
[
'follow_up_title'
]
project
=
sql_result
[
'follow_up_title'
]
"""
if project not in project_soft_dict:
if project not in project_soft_dict:
project_soft_dict[project] = {}
project_soft_dict[project] = {}
if soft not in project_soft_dict[project]:
if soft not in project_soft_dict[project]:
project_soft_dict[project][soft] = 0
project_soft_dict[project][soft] = 0
project_soft_dict[project][soft] = project_soft_dict[project][soft] + int(sql_result['count(*)'])
project_soft_dict[project][soft] = project_soft_dict[project][soft] + int(sql_result['count(*)'])
"""
if
soft
not
in
soft_proj_dict
:
soft_proj_dict
[
soft
]
=
{
'project_list'
:
[],
'count'
:
0
}
soft_proj_dict
[
soft
][
'project_list'
].
append
(
project
)
soft_proj_dict
[
soft
][
'count'
]
=
soft_proj_dict
[
soft
][
'count'
]
+
int
(
sql_result
[
'count(*)'
])
print
'<ul>'
print
'<ul>'
"""
for project, soft_dict in project_soft_dict.items():
for project, soft_dict in project_soft_dict.items():
print '<li><p>%s</p><ul>' % project
print '<li><p>%s</p><ul>' % project
for soft, count in soft_dict.items():
for soft, count in soft_dict.items():
print '<li><p>%s <b>%i</b></p></li>' % (soft, count)
print '<li><p>%s <b>%i</b></p></li>' % (soft, count)
print '</ul></li>'
print '</ul></li>'
"""
ordered_list
=
soft_proj_dict
.
items
()
ordered_list
.
sort
()
for
soft
,
info_dict
in
ordered_list
:
print
'<li><p>%s <b>%i</b> %s</p>'
%
(
soft
,
info_dict
[
'count'
],
str
(
list
(
set
(
info_dict
[
'project_list'
]))))
"""
for proj in list(set(info_dict['project_list'])):
print '<li><p>%s</p></li>' % (proj)
"""
print
'</li>'
print
'</ul>'
print
'</ul>'
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
...
...
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