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
Labels
Merge Requests
17
Merge Requests
17
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
759e78d1
Commit
759e78d1
authored
Jun 13, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Garbage collect hosting subscription to prevent getting the same title twice in validated state.
parent
d366868b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
1 deletion
+125
-1
master/bt5/vifib_upgrader/ExtensionTemplateItem/VifibUpgrader.py
...bt5/vifib_upgrader/ExtensionTemplateItem/VifibUpgrader.py
+25
-0
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/ERP5Site_garbageCollectHostingSubscription.xml
...b_upgrader/ERP5Site_garbageCollectHostingSubscription.xml
+71
-0
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/HostingSubscription_garbageCollectForMigration.xml
...grader/HostingSubscription_garbageCollectForMigration.xml
+28
-0
master/bt5/vifib_upgrader/bt/revision
master/bt5/vifib_upgrader/bt/revision
+1
-1
No files found.
master/bt5/vifib_upgrader/ExtensionTemplateItem/VifibUpgrader.py
View file @
759e78d1
...
@@ -243,6 +243,31 @@ def SlapDocument_migrateSlapState(self):
...
@@ -243,6 +243,31 @@ def SlapDocument_migrateSlapState(self):
slap_document
.
updateLocalRolesOnSecurityGroups
()
slap_document
.
updateLocalRolesOnSecurityGroups
()
real
(
self
)
real
(
self
)
def
HostingSubscription_garbageCollectForMigration
(
self
):
@
WorkflowMethod
.
disable
def
real
(
self
):
slap_document
=
self
portal
=
self
.
getPortalObject
()
title
=
slap_document
.
getTitle
()
instance_state
=
'destroy_requested'
for
software_instance
in
slap_document
.
getPredecessorValueList
():
if
software_instance
.
getTitle
()
==
title
:
if
software_instance
.
getSlapState
()
!=
'destroy_requested'
:
instance_state
=
software_instance
.
getSlapState
()
break
if
instance_state
==
'destroy_requested'
:
_jumpToStateFor
=
portal
.
portal_workflow
.
_jumpToStateFor
_jumpToStateFor
(
slap_document
,
instance_state
,
'instance_slap_interface_workflow'
)
assert
(
slap_document
.
getSlapState
()
==
instance_state
)
_jumpToStateFor
(
slap_document
,
'archived'
,
'hosting_subscription_workflow'
)
assert
(
slap_document
.
getValidationState
()
==
'archived'
)
# Update Local Roles
slap_document
.
updateLocalRolesOnSecurityGroups
()
real
(
self
)
def
SalePackingListLine_deliver
(
self
):
def
SalePackingListLine_deliver
(
self
):
@
WorkflowMethod
.
disable
@
WorkflowMethod
.
disable
def
real
(
self
):
def
real
(
self
):
...
...
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/ERP5Site_garbageCollectHostingSubscription.xml
0 → 100644
View file @
759e78d1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
context.getPortalObject().portal_catalog.searchAndActivate(\n
portal_type=[\'Hosting Subscription\'],\n
validation_state=\'validated\',\n
method_id=\'HostingSubscription_garbageCollectForMigration\'\n
)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
ERP5Site_garbageCollectHostingSubscription
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/HostingSubscription_garbageCollectForMigration.xml
0 → 100644
View file @
759e78d1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"ExternalMethod"
module=
"Products.ExternalMethod.ExternalMethod"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_function
</string>
</key>
<value>
<string>
HostingSubscription_garbageCollectForMigration
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
VifibUpgrader
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
HostingSubscription_garbageCollectForMigration
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_upgrader/bt/revision
View file @
759e78d1
116
117
\ No newline at end of file
\ No newline at end of file
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