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
0
Merge Requests
0
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
Léo-Paul Géneau
slapos.core
Commits
cbd2ab8e
Commit
cbd2ab8e
authored
Sep 07, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: fix Hosting Subscription migration
parent
7adf49d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.py
...plateItem/portal_components/extension.erp5.SlapOSCloud.py
+9
-11
No files found.
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.py
View file @
cbd2ab8e
...
@@ -136,19 +136,17 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False)
...
@@ -136,19 +136,17 @@ def HostingSubscription_checkInstanceTreeMigrationConsistency(self, fixit=False)
hosting_subscription_id
=
self
.
getId
()
hosting_subscription_id
=
self
.
getId
()
hosting_subscription_relative_url
=
self
.
getRelativeUrl
()
hosting_subscription_relative_url
=
self
.
getRelativeUrl
()
self
.
getParentValue
().
_delObject
(
hosting_subscription_id
)
container
=
aq_inner
(
self
.
getParentValue
())
self
=
cloneDocumentWithANewPortalType
(
self
,
'Instance Tree'
)
self
.
__class__
=
klass
container
.
_delObject
(
hosting_subscription_id
)
# self.upgradeObjectClass(returnTrue, 'erp5.portal_type.Hosting Subscription', 'erp5.portal_type.Instance Tree', returnTrue)
portal
.
instance_tree_module
.
_setOb
(
hosting_subscription_id
,
self
)
self
.
portal_type
=
'Instance Tree'
instance_tree
=
portal
.
instance_tree_module
.
restrictedTraverse
(
hosting_subscription_id
)
assert
self
.
getPortalType
()
==
'Instance Tree'
if
(
getattr
(
self
,
'workflow_history'
,
None
)
is
not
None
)
and
\
assert
instance_tree
.
getPortalType
()
==
'Instance Tree'
(
'hosting_subscription_workflow'
in
self
.
workflow_history
):
self
.
workflow_history
[
'instance_tree_workflow'
]
=
self
.
workflow_history
.
pop
(
'hosting_subscription_workflow'
)
portal
.
instance_tree_module
.
_setOb
(
hosting_subscription_id
,
aq_base
(
self
))
if
(
getattr
(
instance_tree
,
'workflow_history'
,
None
)
is
not
None
)
and
\
instance_tree
=
portal
.
instance_tree_module
.
_getOb
(
hosting_subscription_id
)
(
'hosting_subscription_workflow'
in
instance_tree
.
workflow_history
):
instance_tree
.
workflow_history
[
'instance_tree_workflow'
]
=
instance_tree
.
workflow_history
.
pop
(
'hosting_subscription_workflow'
)
instance_tree
.
reindexObject
()
instance_tree
.
reindexObject
()
# Migrate Predecessor/Successor if the instance wasn't migrated before.
# Migrate Predecessor/Successor if the instance wasn't migrated before.
...
...
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