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
7440f417
Commit
7440f417
authored
Mar 07, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: print
parent
ce879ddf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
29 deletions
+29
-29
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration.py
...kins/slapos_upgrader/Base_reportVirtualMasterMigration.py
+7
-7
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration2.py
...ins/slapos_upgrader/Base_reportVirtualMasterMigration2.py
+4
-4
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration3.py
...ins/slapos_upgrader/Base_reportVirtualMasterMigration3.py
+6
-6
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration4.py
...ins/slapos_upgrader/Base_reportVirtualMasterMigration4.py
+12
-12
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration.py
View file @
7440f417
# https://playground.diagram.codes/d/graph
# https://playground.diagram.codes/d/graph
print
"ARROWS"
print
(
"ARROWS"
)
print
""
print
(
""
)
project_dict
=
{}
project_dict
=
{}
remote_project_dict
=
{}
remote_project_dict
=
{}
...
@@ -46,8 +46,8 @@ for project_uid, project_value_dict in project_dict.items():
...
@@ -46,8 +46,8 @@ for project_uid, project_value_dict in project_dict.items():
display_dict
[
remote_key
][
'title'
]
=
'%s
\
n
%s'
%
(
display_dict
[
remote_key
][
'title'
],
project_value_dict
[
'title'
])
display_dict
[
remote_key
][
'title'
]
=
'%s
\
n
%s'
%
(
display_dict
[
remote_key
][
'title'
],
project_value_dict
[
'title'
])
for
display_key
,
display_value
in
display_dict
.
items
():
for
display_key
,
display_value
in
display_dict
.
items
():
print
'"%s" as %s'
%
(
display_value
[
'title'
],
display_key
)
print
(
'"%s" as %s'
%
(
display_value
[
'title'
],
display_key
)
)
print
''
print
(
''
)
for
display_key
,
display_value
in
display_dict
.
items
():
for
display_key
,
display_value
in
display_dict
.
items
():
has_remote
=
False
has_remote
=
False
...
@@ -55,10 +55,10 @@ for display_key, display_value in display_dict.items():
...
@@ -55,10 +55,10 @@ for display_key, display_value in display_dict.items():
if
remote_uid
in
display_dict
:
if
remote_uid
in
display_dict
:
# only not destroyed links
# only not destroyed links
has_remote
=
True
has_remote
=
True
print
'%s->%s'
%
(
display_key
,
remote_uid
)
print
(
'%s->%s'
%
(
display_key
,
remote_uid
)
)
if
(
not
has_remote
)
and
(
display_key
not
in
remote_project_dict
):
if
(
not
has_remote
)
and
(
display_key
not
in
remote_project_dict
):
print
'%s->%s'
%
(
display_key
,
display_key
)
print
(
'%s->%s'
%
(
display_key
,
display_key
)
)
print
''
print
(
''
)
return
printed
return
printed
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration2.py
View file @
7440f417
...
@@ -27,7 +27,7 @@ for sql_result in sql_result_list:
...
@@ -27,7 +27,7 @@ for sql_result in sql_result_list:
soft_proj_dict
[
soft
][
'project_list'
].
append
(
project
)
soft_proj_dict
[
soft
][
'project_list'
].
append
(
project
)
soft_proj_dict
[
soft
][
'count'
]
=
soft_proj_dict
[
soft
][
'count'
]
+
int
(
sql_result
[
'count(*)'
])
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
...
@@ -38,13 +38,13 @@ for project, soft_dict in project_soft_dict.items():
...
@@ -38,13 +38,13 @@ for project, soft_dict in project_soft_dict.items():
ordered_list
=
soft_proj_dict
.
items
()
ordered_list
=
soft_proj_dict
.
items
()
ordered_list
.
sort
()
ordered_list
.
sort
()
for
soft
,
info_dict
in
ordered_list
:
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'
]
))))
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'])):
for proj in list(set(info_dict['project_list'])):
print '<li><p>%s</p></li>' % (proj)
print '<li><p>%s</p></li>' % (proj)
"""
"""
print
'</li>'
print
(
'</li>'
)
print
'</ul>'
print
(
'</ul>'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
return
printed
return
printed
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration3.py
View file @
7440f417
...
@@ -25,8 +25,8 @@ for sql_result in portal.portal_catalog(title='slapmigration',
...
@@ -25,8 +25,8 @@ for sql_result in portal.portal_catalog(title='slapmigration',
instance_tree_dict
[
instance_tree
.
getRelativeUrl
()]
=
instance_tree
instance_tree_dict
[
instance_tree
.
getRelativeUrl
()]
=
instance_tree
print
'<h1>Broken instances (allocated on multiple virtual master)</h1>'
print
(
'<h1>Broken instances (allocated on multiple virtual master)</h1>'
)
print
'<ol>'
print
(
'<ol>'
)
print_info_list
=
[]
print_info_list
=
[]
for
instance_tree_relative_url
,
instance_tree
in
instance_tree_dict
.
items
():
for
instance_tree_relative_url
,
instance_tree
in
instance_tree_dict
.
items
():
...
@@ -55,11 +55,11 @@ for instance_tree_relative_url, instance_tree in instance_tree_dict.items():
...
@@ -55,11 +55,11 @@ for instance_tree_relative_url, instance_tree in instance_tree_dict.items():
sorted
(
print_info_list
,
key
=
lambda
print_info
:
print_info
[
0
])
sorted
(
print_info_list
,
key
=
lambda
print_info
:
print_info
[
0
])
print_info_list
.
sort
()
print_info_list
.
sort
()
for
print_info
in
print_info_list
:
for
print_info
in
print_info_list
:
print
'<li><p><b>%s</b> <a href="%s">%s</a> (%s) </p><ul>'
%
print_info
[:
-
1
]
print
(
'<li><p><b>%s</b> <a href="%s">%s</a> (%s) </p><ul>'
%
print_info
[:
-
1
])
for
instance_info
in
print_info
[
-
1
]:
for
instance_info
in
print_info
[
-
1
]:
print
'<li><i>%s</i> <a href="%s">%s</a></li>'
%
instance_info
print
(
'<li><i>%s</i> <a href="%s">%s</a></li>'
%
instance_info
)
print
'</ul></li>'
print
(
'</ul></li>'
)
print
'</ol>'
print
(
'</ol>'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
return
printed
return
printed
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_reportVirtualMasterMigration4.py
View file @
7440f417
...
@@ -22,8 +22,8 @@ for sql_result in portal.portal_catalog(source_section__uid='%',
...
@@ -22,8 +22,8 @@ for sql_result in portal.portal_catalog(source_section__uid='%',
missing_price_project_dict
[
software_product
.
getFollowUp
()].
append
(
software_product
)
missing_price_project_dict
[
software_product
.
getFollowUp
()].
append
(
software_product
)
print
'<h1>Missing price</h1>'
print
(
'<h1>Missing price</h1>'
)
print
'<ol>'
print
(
'<ol>'
)
print_info_list
=
[]
print_info_list
=
[]
for
_
,
software_product_list
in
missing_price_project_dict
.
items
():
for
_
,
software_product_list
in
missing_price_project_dict
.
items
():
...
@@ -31,11 +31,11 @@ for _, software_product_list in missing_price_project_dict.items():
...
@@ -31,11 +31,11 @@ for _, software_product_list in missing_price_project_dict.items():
print_info_list
.
sort
()
print_info_list
.
sort
()
for
print_info
in
print_info_list
:
for
print_info
in
print_info_list
:
print
'<li><p><b>%s</b></p><ul>'
%
print_info
[
0
]
print
(
'<li><p><b>%s</b></p><ul>'
%
print_info
[
0
])
for
software_product
in
print_info
[
1
]:
for
software_product
in
print_info
[
1
]:
print
'<li><i><a href="%s">%s</a></i></li>'
%
(
software_product
.
getRelativeUrl
(),
software_product
.
getTitle
(
))
print
(
'<li><i><a href="%s">%s</a></i></li>'
%
(
software_product
.
getRelativeUrl
(),
software_product
.
getTitle
()
))
print
'</ul></li>'
print
(
'</ul></li>'
)
print
'</ol>'
print
(
'</ol>'
)
#############################################
#############################################
# Item without Subscription Request
# Item without Subscription Request
...
@@ -59,8 +59,8 @@ for sql_result in portal.portal_catalog(
...
@@ -59,8 +59,8 @@ for sql_result in portal.portal_catalog(
orphaned_item_project_dict
[
item
.
getFollowUp
()]
=
[]
orphaned_item_project_dict
[
item
.
getFollowUp
()]
=
[]
orphaned_item_project_dict
[
item
.
getFollowUp
()].
append
(
item
)
orphaned_item_project_dict
[
item
.
getFollowUp
()].
append
(
item
)
print
'<h1>Subscription not created</h1>'
print
(
'<h1>Subscription not created</h1>'
)
print
'<ol>'
print
(
'<ol>'
)
print_info_list
=
[]
print_info_list
=
[]
for
_
,
item_list
in
orphaned_item_project_dict
.
items
():
for
_
,
item_list
in
orphaned_item_project_dict
.
items
():
...
@@ -68,16 +68,16 @@ for _, item_list in orphaned_item_project_dict.items():
...
@@ -68,16 +68,16 @@ for _, item_list in orphaned_item_project_dict.items():
print_info_list
.
sort
()
print_info_list
.
sort
()
for
print_info
in
print_info_list
:
for
print_info
in
print_info_list
:
print
'<li><p><b>%s</b></p><ul>'
%
print_info
[
0
]
print
(
'<li><p><b>%s</b></p><ul>'
%
print_info
[
0
])
for
item
in
print_info
[
1
]:
for
item
in
print_info
[
1
]:
product_dict
=
item
.
InstanceTree_getSoftwareProduct
()
product_dict
=
item
.
InstanceTree_getSoftwareProduct
()
if
product_dict
[
0
]
is
not
None
:
if
product_dict
[
0
]
is
not
None
:
product_title
=
product_dict
[
0
].
getTitle
()
product_title
=
product_dict
[
0
].
getTitle
()
else
:
else
:
product_title
=
""
product_title
=
""
print
'<li><i><a href="%s">%s</a></i> (%s)</li>'
%
(
item
.
getRelativeUrl
(),
item
.
getTitle
(),
product_title
)
print
(
'<li><i><a href="%s">%s</a></i> (%s)</li>'
%
(
item
.
getRelativeUrl
(),
item
.
getTitle
(),
product_title
)
)
print
'</ul></li>'
print
(
'</ul></li>'
)
print
'</ol>'
print
(
'</ol>'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
context
.
REQUEST
.
RESPONSE
.
setHeader
(
'Content-Type'
,
'text/html'
)
return
printed
return
printed
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