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
Boxiang Sun
slapos.core
Commits
11b7de08
Commit
11b7de08
authored
Dec 05, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate url_string of instances.
parent
422d6ebc
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
1 deletion
+141
-1
master/bt5/slapos_upgrader/ExtensionTemplateItem/SlapOSUpgrader.py
...5/slapos_upgrader/ExtensionTemplateItem/SlapOSUpgrader.py
+24
-0
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/00_ERP5Site_migrateUrlString.xml
...al_skins/slapos_upgrader/00_ERP5Site_migrateUrlString.xml
+87
-0
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Instance_migrateUrlString.xml
...ortal_skins/slapos_upgrader/Instance_migrateUrlString.xml
+28
-0
master/bt5/slapos_upgrader/bt/revision
master/bt5/slapos_upgrader/bt/revision
+1
-1
master/bt5/slapos_upgrader/bt/template_extension_id_list
master/bt5/slapos_upgrader/bt/template_extension_id_list
+1
-0
No files found.
master/bt5/slapos_upgrader/ExtensionTemplateItem/SlapOSUpgrader.py
0 → 100644
View file @
11b7de08
from
Products.ERP5Type.Base
import
WorkflowMethod
def
Instance_migrateUrlString
(
obj
):
@
WorkflowMethod
.
disable
def
real
(
obj
):
property_id
=
'root_software_release_url'
if
obj
.
getPortalType
()
not
in
(
'Hosting Subscription'
,
'Software Instance'
,
'Slave Instance'
):
raise
TypeError
(
obj
.
getPortalType
())
old_url
=
getattr
(
obj
.
aq_base
,
property_id
,
None
)
new_url
=
obj
.
getUrlString
()
if
not
old_url
and
not
new_url
:
raise
ValueError
(
'%s has no url defined at all'
%
obj
.
getPath
())
if
old_url
:
obj
.
setUrlString
(
old_url
)
assert
(
obj
.
getUrlString
()
==
old_url
)
delattr
(
obj
.
aq_base
,
property_id
)
if
type
(
obj
)
==
type
([]):
for
o
in
obj
:
real
(
o
[
0
])
else
:
real
(
obj
)
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/00_ERP5Site_migrateUrlString.xml
0 → 100644
View file @
11b7de08
<?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>
portal = context.getPortalObject()\n
tag = script.id\n
method_id = \'Instance_migrateUrlString\'\n
for module in (\n
portal.hosting_subscription_module,\n
portal.software_instance_module,\n
):\n
module.recurseCallMethod(\n
method_id,\n
max_depth=1,\n
min_depth=1,\n
max_retry=0,\n
activity_count=50,\n
activate_kw={\n
\'tag\': script.id,\n
\'group_method_id\': method_id,\n
\'group_method_cost\': 1./50, # fire up 50 activities in same transaction\n
}\n
)\n
\n
return \'Done.\'\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
00_ERP5Site_migrateUrlString
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/Instance_migrateUrlString.xml
0 → 100644
View file @
11b7de08
<?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>
Instance_migrateUrlString
</string>
</value>
</item>
<item>
<key>
<string>
_module
</string>
</key>
<value>
<string>
SlapOSUpgrader
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Instance_migrateUrlString
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_upgrader/bt/revision
View file @
11b7de08
5
\ No newline at end of file
6
\ No newline at end of file
master/bt5/slapos_upgrader/bt/template_extension_id_list
0 → 100644
View file @
11b7de08
SlapOSUpgrader
\ 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