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
1d8c76a5
Commit
1d8c76a5
authored
Feb 21, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: try to keep existing Software Product title, description and image
parent
806f1777
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
9 deletions
+47
-9
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_triggerFullSiteMigrationToVirtualMasterStep3.py
...ader/Base_triggerFullSiteMigrationToVirtualMasterStep3.py
+0
-8
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_triggerFullSiteMigrationToVirtualMasterStep7.py
...ader/Base_triggerFullSiteMigrationToVirtualMasterStep7.py
+18
-0
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Project_checkSoftwareProductToVirtualMaster.py
...s_upgrader/Project_checkSoftwareProductToVirtualMaster.py
+29
-1
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_triggerFullSiteMigrationToVirtualMasterStep3.py
View file @
1d8c76a5
...
...
@@ -17,14 +17,6 @@ portal.portal_catalog.searchAndActivate(
**
packet_kw
)
# Delete existing old product only
if
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Software Release"
)
is
not
None
:
portal
.
portal_catalog
.
searchAndActivate
(
method_id
=
'Base_deleteProcessedDocumentDuringPurge'
,
portal_type
=
[
"Software Product"
,
"Software Release"
],
**
packet_kw
)
############################################
# Gather compute node informations
############################################
...
...
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Base_triggerFullSiteMigrationToVirtualMasterStep7.py
View file @
1d8c76a5
...
...
@@ -19,4 +19,22 @@ portal.portal_catalog.searchAndActivate(
**
packet_kw
)
# Delete existing old product only
if
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Software Release"
)
is
not
None
:
not_migrated_select_dict
=
{
'default_follow_up_uid'
:
None
}
portal
.
portal_catalog
.
searchAndActivate
(
method_id
=
'Base_deleteProcessedDocumentDuringPurge'
,
portal_type
=
"Software Release"
,
**
packet_kw
)
portal
.
portal_catalog
.
searchAndActivate
(
method_id
=
'Base_deleteProcessedDocumentDuringPurge'
,
portal_type
=
"Software Product"
,
select_dict
=
not_migrated_select_dict
,
left_join_list
=
not_migrated_select_dict
.
keys
(),
default_follow_up_uid
=
None
,
**
packet_kw
)
context
.
activate
(
after_tag
=
tag
,
priority
=
4
).
getId
()
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Project_checkSoftwareProductToVirtualMaster.py
View file @
1d8c76a5
...
...
@@ -109,9 +109,37 @@ for soft, variation_dict in soft_dict.items():
parent_uid
=
software_product
.
getUid
()
)
if
software_release_variation
is
None
:
software_release_variation_title
=
software_release
# Search previous Software Release object
# to copy the title and the Software Product image
old_software_release
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Software Release"
,
url_string
=
{
'query'
:
software_release
,
'key'
:
'ExactMatch'
},
validation_state
=
'published_alive'
)
if
old_software_release
is
not
None
:
old_software_product
=
old_software_release
.
getAggregateValue
()
if
old_software_product
is
not
None
:
software_release_variation_title
=
old_software_release
.
getReference
()
software_product
.
edit
(
title
=
old_software_product
.
getTitle
(),
description
=
old_software_product
.
getDescription
(),
activate_kw
=
activate_kw
)
old_image
=
old_software_product
.
getDefaultImageValue
()
if
old_image
is
not
None
:
new_image
=
software_product
.
getDefaultImageValue
()
if
new_image
is
None
:
new_image
=
software_product
.
newContent
(
portal_type
=
"Embedded File"
,
id
=
"default_image"
,
activate_kw
=
activate_kw
)
new_image
.
edit
(
data
=
old_image
.
getData
(),
activate_kw
=
activate_kw
)
software_product
.
newContent
(
portal_type
=
"Software Product Release Variation"
,
title
=
software_release
,
title
=
software_release
_variation_title
,
url_string
=
software_release
,
activate_kw
=
activate_kw
)
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