Commit 0a0d2470 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Simplify erp5_upgrader to be possible upgrade any project just enabling the...

Simplify erp5_upgrader to be possible upgrade any project just enabling the alarms that all Constraints will be called and fixed.

The alarms were renamed to cover each step of upgrader and give the possibility to call each step manually one-by-one. Also, all Scripts that the logic can be done by installing Business Template was removed.

Also added:
 - Constraints that can be used in the upgrader
 - Unit test to check different scenarios
 - Extend external method to be possible dump workflow chains to be compared with all configuration defined on Business Templates
parent 97a6db68
......@@ -32,9 +32,8 @@
from App.config import getConfiguration
from Products.ERP5Type.Log import log
from Products.CMFActivity.ActiveResult import ActiveResult
from time import sleep
import os
from Acquisition import aq_base
def ERP5Site_editERP5SiteProperty(self, prop, value):
"""
......@@ -47,28 +46,6 @@ def ERP5Site_editERP5SiteProperty(self, prop, value):
method(prop, value)
return True
def ERP5Site_restartZopeInstance(self):
"""
Zope must be restart after update the Products or Software
But the restart into one activity, will make the activity always
fail and with the server will be restart many times.
This method use a flag to define if the server was already restarted.
If yes, the flag is removed and the restart will be ignored.
This method should be run into a single activity to prevent rollback
other parts.
"""
import Lifetime
Lifetime.shutdown(1,fast=1)
log("Zope Restart was launched.")
active_result = ActiveResult()
active_result.edit(summary="Zope Restart",
severity=0,
detail="Zope was restart Sucessfully.")
return active_result
def ERP5Site_clearActivities(self):
"""
This method is used to recreated the activities keeping the
......@@ -119,42 +96,26 @@ def ERP5Site_runVerificationScript(self, method_id):
if len(integrity_result) > 0:
return '%s : \n - %s ' % (method_id, '\n - '.join(integrity_result))
def ERP5Site_changeAuthoredDocumentListOwnership(self, old_owner, new_owner):
"""
Change owneship for all documents in the system belonging to
an user (i.e. represented by user_name/reference).
"""
# Move import to here prevents the raise error when this External
# Be imported during the upgrade.
from Products.ERP5Type.Utils import _setSuperSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from Products.ERP5Security.ERP5UserManager import SUPER_USER
result = []
orginal_security_manager = _setSuperSecurityManager(self, SUPER_USER)
portal = self.getPortalObject()
user_folder = portal.acl_users
new_owner_as_user = user_folder.getUserById(new_owner).__of__(user_folder)
document_list = portal.portal_catalog.unrestrictedSearchResults(owner = old_owner)
for document in document_list:
document = document.getObject()
# change document ownership
document.changeOwnership(new_owner_as_user)
# fix local roles
for item in document.get_local_roles():
user = item[0]
role_list = item[1]
if user == old_owner:
# replace old Owner with new One
document.manage_delLocalRoles((old_owner,))
document.manage_setLocalRoles(new_owner, role_list)
result.append(document.getRelativeUrl())
# finally reindex document
document.reindexObject()
# restore security
setSecurityManager(orginal_security_manager)
return dict(old_owner = old_owner, \
new_owner = new_owner, \
changed_document_list = result)
def ERP5Site_dumpWorkflowChainByPortalType(self, REQUEST=None):
# This method outputs the workflow chain by portal type
# ---
# {"Account": ['account_workflow', "edit_workflow"]}
# ---
#
if REQUEST:
raise RuntimeError("You can not call this script from the url")
workflow_tool = self.getPortalObject().portal_workflow
cbt = workflow_tool._chains_by_type
ti = workflow_tool._listTypeInfo()
chain_by_type_dict = {}
for t in ti:
id = t.getId()
title = t.Title()
if title == id:
title = None
if cbt is not None and cbt.has_key(id):
chain = sorted(cbt[id])
else:
chain = ['(Default)']
chain_by_type_dict.setdefault(id, []).extend(chain)
return chain_by_type_dict
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Alarm" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_senseFullUpgradeNeed</string> </value>
</item>
<item>
<key> <string>alarm_notification_mode</string> </key>
<value>
<tuple>
<string>always</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This alarm checks that the upgrader is required. If yes, the upgrader have three steps:\n
\n
1. Pre-upgrade\n
This step will run all constraints that have contraint_type equal pre_upgrade.\n
\n
2. Upgrader\n
This step will run all constraints that have contraint_type equal upgrade. In this step is supposed to install/upgrade all Business Template required.\n
\n
3. Post-Upgrade\n
This step will run all constraints that have contraint_type equal post_upgrade.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>promise_check_upgrade</string> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_start_date</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1384423200.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>periodicity_week</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
</item>
<item>
<key> <string>sense_method_id</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>solve_method_id</string> </key>
<value> <string>Alarm_runFullUpgrader</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Run Full Upgrade</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -14,17 +14,13 @@
<key> <string>alarm_notification_mode</string> </key>
<value>
<tuple>
<string>never</string>
<string>always</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This alarms acts as a cron job. It will start an instance upgrade if any of the following this alarms sequence:\n
1) bt5_upgrader (supported)\n
2) finalize_upgrader (supported)\n
\n
"sense" a need of an upgrade. This alarm is likely to disappear soon as it\'s needed due to lack of functionality (which is that alarms can not automatically "solve" themselves).</string> </value>
<value> <string>This step will run all constraints that have contraint_type equal post_upgrade.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -32,7 +28,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>upgrader_controller</string> </value>
<value> <string>upgrader_check_post_upgrade</string> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
......@@ -48,7 +44,9 @@
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value> <int>30</int> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
......@@ -74,7 +72,7 @@
</tuple>
<state>
<tuple>
<float>1136073600.0</float>
<float>1384423200.0</float>
<string>GMT</string>
</tuple>
</state>
......@@ -97,9 +95,13 @@
<none/>
</value>
</item>
<item>
<key> <string>solve_method_id</string> </key>
<value> <string>Alarm_runPostUpgrade</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Upgrader Controller</string> </value>
<value> <string>Run Post Upgrade</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_senseUpgradeNeed</string> </value>
</item>
<item>
<key> <string>alarm_notification_mode</string> </key>
<value>
......@@ -16,7 +20,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This business template finalize the upgrade, this should contains the last steps of upgrade system (ie.: Clear Cache).</string> </value>
<value> <string>This step will run all constraints that have contraint_type equal pre_upgrade.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -24,7 +28,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>finalize_upgrader</string> </value>
<value> <string>upgrader_check_pre_upgrade</string> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
......@@ -68,7 +72,7 @@
</tuple>
<state>
<tuple>
<float>1136073600.0</float>
<float>1384423200.0</float>
<string>GMT</string>
</tuple>
</state>
......@@ -87,15 +91,17 @@
</item>
<item>
<key> <string>sense_method_id</string> </key>
<value> <string>Alarm_senseFinalizeUpgrade</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>solve_method_id</string> </key>
<value> <string>Alarm_upgradeFinalize</string> </value>
<value> <string>Alarm_runPreUpgrade</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Finalize Upgrader</string> </value>
<value> <string>Run Pre Upgrade</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -6,6 +6,10 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_senseUpgradeNeed</string> </value>
</item>
<item>
<key> <string>alarm_notification_mode</string> </key>
<value>
......@@ -16,7 +20,7 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This Alarm check that bt5 are the right ones. If not, it upgrades the bt5 using SVN (for dedicate instances) or using shared repository for Free / Express instances.</string> </value>
<value> <string>This step will run all constraints that have contraint_type equal upgrader.</string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -24,7 +28,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>bt5_upgrader</string> </value>
<value> <string>upgrader_check_upgrader</string> </value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
......@@ -68,7 +72,7 @@
</tuple>
<state>
<tuple>
<float>1136073600.0</float>
<float>1384423200.0</float>
<string>GMT</string>
</tuple>
</state>
......@@ -87,15 +91,17 @@
</item>
<item>
<key> <string>sense_method_id</string> </key>
<value> <string>Alarm_senseBT5Version</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>solve_method_id</string> </key>
<value> <string>Alarm_upgradeBT5Version</string> </value>
<value> <string>Alarm_runUpgrader</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>BT5 Upgrader</string> </value>
<value> <string>Run Upgrader</string> </value>
</item>
</dictionary>
</pickle>
......
<property_sheet_list>
<portal_type id="Template Tool">
<item>TemplateToolUpgraderConstraint</item>
</portal_type>
</property_sheet_list>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TemplateToolPostUpgradeConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Script Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>constraint_type/post_upgrade</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>workflow_chain_constraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Script Constraint</string> </value>
</item>
<item>
<key> <string>script_id</string> </key>
<value> <string>TemplateTool_checkPostUpgradeWorkflowChainConsistency</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Property Sheet" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>TemplateToolUpgraderConstraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Property Sheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Script Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>constraint_type/upgrader</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_installed_constraint</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Script Constraint</string> </value>
</item>
<item>
<key> <string>script_id</string> </key>
<value> <string>TemplateTool_checkUpgradeConsistency</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_col</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>Field</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>18</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>Type</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>19</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>Null</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>3</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>Key</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>3</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>Default</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
<dictionary>
<item>
<key> <string>name</string> </key>
<value> <string>Extra</string> </value>
</item>
<item>
<key> <string>null</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>t</string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</list>
</value>
</item>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>cmf_activity_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityTool_showMessageQueueTableColumns</string> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string>show columns from message_queue</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="SQL" module="Products.ZSQLMethods.SQL"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>arguments_src</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>connection_id</string> </key>
<value> <string>cmf_activity_sql_connection</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ActivityTool_upgradeMessageQueueTable</string> </value>
</item>
<item>
<key> <string>src</string> </key>
<value> <string>alter table message_queue add column `group_method_id` VARCHAR(255) NOT NULL DEFAULT \'\' AFTER `priority`</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -51,32 +51,27 @@
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
message_list = []\n
is_upgrade_required = 0\n
site_property_dict = portal.ERP5Site_getUpgraderSignature().get(\'erp5_site_property_dict\', {})\n
constraint_type_per_type, _ = context.Base_getConstraintTypeListPerPortalType()\n
constraint_type = filter_dict.get("constraint_type")\n
\n
for prop in site_property_dict:\n
if site_property_dict[prop] != getattr(portal,prop , None):\n
if not upgrade:\n
return ["Upgrade Required for Global Properties."]\n
is_upgrade_required = 1\n
break\n
\n
if is_upgrade_required:\n
for prop in site_property_dict:\n
portal.ERP5Site_editERP5SiteProperty(prop, site_property_dict[prop])\n
message_list.append("Upgrade Executed for Global Properties (%s)." % prop)\n
\n
return message_list\n
for portal_type, constraint_type_list in constraint_type_per_type.iteritems():\n
if not constraint_type and constraint_type not in constraint_type_list:\n
continue\n
method_kw = {\'fixit\': fixit,\n
\'filter\': filter_dict,\n
\'active_process\': active_process.getRelativeUrl()}\n
portal.portal_catalog.searchAndActivate(\'Base_postCheckConsistencyResult\',\n
portal_type=portal_type,\n
method_kw=method_kw)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
<value> <string>active_process, fixit=False, filter_dict={}</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeGlobalPropertyList</string> </value>
<value> <string>Alarm_checkUpgraderConsistency</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,38 +50,43 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Migrate Object Classes based on upgrade signature\n
"""\n
class_signature_list = context.ERP5Site_getUpgraderSignature().get(\'upgrade_object_class_list\', [])\n
<value> <string>if REQUEST is not None:\n
from zExceptions import Unauthorized\n
raise Unauthorized("You can not call this script from the url")\n
\n
alarm_id_list = ("upgrader_check_pre_upgrade",\n
"upgrader_check_upgrader",\n
"upgrader_check_post_upgrade")\n
\n
portal = context.getPortalObject()\n
portal_alarms = portal.portal_alarms\n
message_list = []\n
\n
test_only = not upgrade\n
\n
for object_class in class_signature_list:\n
folder, test_before , from_class, to_class , test_after = object_class\n
folder_object = portal.restrictedTraverse(folder)\n
test_before_method = getattr(context, test_before )\n
test_after_method = getattr(context, test_after )\n
result = folder_object.upgradeObjectClass(test_before_method, \n
from_class, \n
to_class, \n
test_after_method, \n
test_only)\n
message_list.extend(result)\n
for alarm_id in alarm_id_list:\n
alarm = getattr(portal_alarms, alarm_id, None)\n
if alarm is not None and alarm.sense():\n
last_active_process = alarm.getLastActiveProcess()\n
result_list = last_active_process.getResultList()\n
if result_list:\n
detail = result_list[0].detail\n
else:\n
detail = ["Require solve %s" % alarm_id,]\n
message_list.extend(detail)\n
\n
return message_list\n
active_process = portal.restrictedTraverse(active_process)\n
if message_list:\n
active_process.postActiveResult(\n
summary=context.getTitle(),\n
severity=1, detail=message_list)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
<value> <string>active_process, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeObjectClass</string> </value>
<value> <string>Alarm_postFullUpgradeNeed</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -53,35 +53,42 @@
<value> <string encoding="cdata"><![CDATA[
"""\n
Here we make sure the installed bt5 are the right ones.\n
If the installed bt5 are too old, then they must be upgraded\n
Run upgrader\n
"""\n
portal = context.getPortalObject()\n
portal_alarms = portal.portal_alarms\n
\n
NOTE: some day, we will mix multiple bt5 sources. The code\n
will be a bit longer. It could be a good idea to create\n
a kind of dict or a central data structure somewhere (like\n
the system signature in portal_introspections) instead of\n
having to repeat everywhere 5.4.3 or other release numbers.\n
def launchUpgraderAlarm(alarm_id, after_method_id=[]):\n
""" Get the alarm and use sense and solve """\n
upgrader_alarm = getattr(portal_alarms, alarm_id, None)\n
if upgrader_alarm is not None and upgrader_alarm.sense():\n
# call solve method\n
kw = dict(tag=alarm_id)\n
if len(after_method_id) > 0:\n
kw["after_method_id"] = after_method_id\n
method_id = upgrader_alarm.getSolveMethodId()\n
if method_id not in (None, \'\'):\n
method = getattr(upgrader_alarm.activate(**kw), method_id)\n
method()\n
return [method_id] + after_method_id\n
return after_method_id\n
\n
NOTE: the idea is to call a long list of "check list" scripts,\n
each of which has a "check" part and a "fix" (ie. upgrade) part, just like\n
constraints in ERP5. However, the order is very important\n
for upgrade, unlike constraints. And we need to be able\n
to override upgrade scripts for certain source releases.\n
previous_method_id = launchUpgraderAlarm(\'upgrader_check_pre_upgrade\')\n
\n
NOTE2: you can split if needed the upgrade process into more\n
alarms (this can be useful if restart is needed for example\n
between stages of upgrade)\n
"""\n
# Setup skins\n
context.ERP5Site_setupUpgraderSkinSelection()\n
previous_method_id.extend([\'recursiveImmediateReindexObject\',\n
\'immediateReindexObject\',\n
\'callMethodOnObjectList\'])\n
\n
# Right way is like this\n
# Now start the update\n
previous_method_id = launchUpgraderAlarm(\'upgrader_check_upgrader\',\n
after_method_id=previous_method_id)\n
\n
if len(context.ERP5Site_upgradeBusinessTemplateList()) > 0: \n
return True\n
previous_method_id.append(\'updateBusinessTemplateFromUrl\')\n
previous_method_id = launchUpgraderAlarm(\'upgrader_check_post_upgrade\',\n
after_method_id=previous_method_id)\n
\n
return False\n
# Nothing else to do, so we can disable.\n
context.setEnabled(False)\n
return\n
]]></string> </value>
......@@ -92,7 +99,7 @@ return False\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_senseBT5Version</string> </value>
<value> <string>Alarm_runFullUpgrader</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -51,32 +51,35 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
verify if the workflow was updated, if is not updated update it.\n
Run Post upgrade\n
"""\n
workflow_chain_dict = context.ERP5Site_getUpgraderSignature().get(\'workflow_chain_dict\', {})\n
if workflow_chain_dict is None:\n
# If no signature, ignore.\n
return []\n
portal_alarms = context.getPortalObject().portal_alarms\n
active_process = context.newActiveProcess()\n
\n
chain = context.portal_workflow.getWorkflowChainDict()\n
if chain == workflow_chain_dict:\n
return []\n
# We should not run post upgrade if upgrader was not solved or never executed\n
alarm = getattr(portal_alarms, \'upgrader_check_upgrader\')\n
if alarm.sense() in (None, True):\n
active_process.postActiveResult(summary=context.getTitle(),\n
severity=1,\n
detail="Is required run upgrade before solve it. " +\\\n
"You need run active sense once at least on this alarm")\n
return\n
\n
if int(upgrade) == 1:\n
context.portal_workflow.manage_changeWorkflows(default_chain = \'\',\n
props = workflow_chain_dict)\n
return ["Upgrade Executed for Workflow Chain."]\n
context.Alarm_checkUpgraderConsistency(fixit=True,\n
active_process=active_process,\n
filter_dict={"constraint_type": ["post_upgrade",]})\n
\n
return ["Upgrade Required for Workflow Chain."]\n
context.setEnabled(False)\n
return\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeWorkflowChain</string> </value>
<value> <string>Alarm_runPostUpgrade</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -51,22 +51,23 @@
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
First, change skin order based on introspection \n
of the current version which is installed\n
\n
XXX This configuration could be moved to upgrader signature\n
Run Pre upgrade\n
"""\n
context.Alarm_checkUpgraderConsistency(fixit=True,\n
active_process=context.newActiveProcess(),\n
filter_dict={"constraint_type": ["pre_upgrade"]})\n
\n
return True\n
context.setEnabled(False)\n
return\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_setupUpgraderSkinSelection</string> </value>
<value> <string>Alarm_runPreUpgrade</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -53,21 +53,51 @@
<value> <string encoding="cdata"><![CDATA[
"""\n
Finalize Upgrade is the final step of upgrader. Here should contains\n
the scripts that should be executed after the business template installation.\n
Run Upgrader\n
\n
IMPORTANT: Don\'t use the constraint_type upgrader to data migration or big amount of objects,\n
because this step is suppose to run all constraints in the same transaction. \n
To not kill the instance, searchAndActivate will be used if countResults() > REINDEX_SPLIT_COUNT\n
"""\n
# Setup skins\n
context.ERP5Site_setupUpgraderSkinSelection()\n
\n
alarm_dict = context.ERP5Site_getUpgraderSignature().get(\'alarm_dict\', {})\n
if not alarm_dict.get(context.getId(), True):\n
return False\n
REINDEX_SPLIT_COUNT = 100\n
portal = context.getPortalObject()\n
portal_alarms = portal.portal_alarms\n
active_process = context.newActiveProcess()\n
\n
# We should not run upgrader if pre upgrade was not solved or never executed \n
alarm = getattr(portal_alarms, \'upgrader_check_pre_upgrade\')\n
if alarm.sense() in (None, True):\n
active_process.postActiveResult(summary=context.getTitle(),\n
severity=1,\n
detail="Is required solve Pre Upgrade first. " +\\\n
"You need run active sense once at least on this alarm")\n
return\n
\n
_, type_per_constraint_type = context.Base_getConstraintTypeListPerPortalType()\n
portal_type_list = type_per_constraint_type.get(\'upgrader\', [])\n
\n
tool_portal_type = \'Template Tool\' \n
if tool_portal_type in portal_type_list:\n
portal_type_list.remove(tool_portal_type)\n
\n
method_kw = {\'fixit\': True,\n
\'filter\': {"constraint_type": \'upgrader\'},\n
\'active_process\': active_process.getRelativeUrl()}\n
\n
for script_id in context.ERP5Site_getUpgraderSignature().get(\'finalize_upgrade_script_list\', []):\n
if len(getattr(context, script_id)()) > 0:\n
return True\n
portal.portal_templates.Base_postCheckConsistencyResult(**method_kw)\n
for portal_type in portal_type_list:\n
if portal.portal_catalog.countResults(\n
portal_type=portal_type_list)[0][0] > REINDEX_SPLIT_COUNT:\n
portal.portal_catalog.searchAndActivate(\'Base_postCheckConsistencyResult\',\n
portal_type=portal_type,\n
method_kw=method_kw)\n
else:\n
for result in portal.portal_catalog(portal_type=portal_type):\n
result.Base_postCheckConsistencyResult(**method_kw)\n
\n
return False\n
context.setEnabled(False)\n
return\n
]]></string> </value>
......@@ -78,7 +108,7 @@ return False\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_senseFinalizeUpgrade</string> </value>
<value> <string>Alarm_runUpgrader</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>from Products.ERP5Type.Log import log\n
from Products.CMFActivity.ActiveResult import ActiveResult\n
\n
# Log Result to make debug easy in case of failure.\n
log("Summary: %s , Details: %s " % (summary, detail))\n
\n
active_result = ActiveResult()\n
active_result.edit(summary=summary, severity=severity, detail=detail)\n
return active_result\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>summary, severity=0, detail=\'\'</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_saveActiveResult</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -53,37 +53,51 @@
<value> <string encoding="cdata"><![CDATA[
"""\n
Verify if this instance is a properly configured one.\n
This script could be used in functional tests\n
Run upgrader\n
"""\n
portal = context.getPortalObject()\n
portal_alarms = portal.portal_alarms\n
\n
message_list = []\n
after_method_id = \'callMethodOnObjectList\'\n
def launchSenseAlarm(alarm_id, after_tag=[]):\n
""" Get the alarm and use sense"""\n
upgrader_alarm = getattr(portal_alarms, alarm_id, None)\n
if upgrader_alarm is not None:\n
# call solve method\n
kw = {"tag": alarm_id,\n
"after_method_id": after_method_id}\n
if len(after_tag) > 0:\n
kw["after_tag"] = after_tag\n
method_id = upgrader_alarm.getActiveSenseMethodId()\n
if method_id not in (None, \'\'):\n
method = getattr(upgrader_alarm.activate(**kw), method_id)\n
method()\n
return [alarm_id,]\n
return after_tag\n
\n
activity_failure_list = context.portal_activities.getMessageList(processing_node=-2)\n
previous_tag = launchSenseAlarm(\'upgrader_check_pre_upgrade\')\n
\n
if len(activity_failure_list) > 0:\n
message_list.append("Activity Failures was found (%s)." % (len(activity_failure_list),))\n
return message_list\n
previous_tag = launchSenseAlarm(\'upgrader_check_upgrader\',\n
after_tag=previous_tag)\n
\n
previous_tag = launchSenseAlarm(\'upgrader_check_post_upgrade\',\n
after_tag=previous_tag)\n
\n
active_process = context.newActiveProcess()\n
context.activate(after_tag=previous_tag,\n
after_method_id=after_method_id).Alarm_postFullUpgradeNeed(\n
active_process=active_process.getRelativeUrl())\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
<value> <string>REQUEST=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_verifyActivityIntegrity</string> </value>
<value> <string>Alarm_senseFullUpgradeNeed</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,92 +50,18 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
<value> <string>"""\n
Check if upgrader is required\n
"""\n
This script is used in an alarm that acts as a cron job.\n
It will start an instance upgrade if any of the following alarms:\n
- bt5_upgrader (supported)\n
\n
"sense" a need of an upgrade. This alarm is likely to disappear soon as it\'s needed \n
due to lack of functionality (which is that alarms can not automatically "solve" themselves).\n
"""\n
# If before script is present call it.\n
before_script = getattr(context, \'ERP5Site_beforeSenseUpgrade\', None)\n
if before_script is not None:\n
before_script()\n
\n
context.ERP5Site_setupUpgraderSkinSelection()\n
\n
portal_alarms = context.getPortalObject().portal_alarms\n
activate = context.portal_activities.activate\n
previous_tag = None\n
\n
# XXX get the last activate process if exists\n
active_process = context.getLastActiveProcess()\n
if active_process is None or ((DateTime() - active_process.getStartDate()) > 1):\n
active_process = context.newActiveProcess()\n
\n
active_process = active_process.getPath()\n
\n
def launchUpgraderAlarm(alarm_id, after_method_id=[]):\n
"""\n
Get the alarm and use sense and solve\n
"""\n
upgrader_alarm = getattr(portal_alarms, alarm_id, None)\n
if upgrader_alarm is not None and upgrader_alarm.sense():\n
# call solve method\n
activate(active_process=active_process,\n
activity=\'SQLQueue\', \n
priority=2).Alarm_saveActiveResult(\n
summary=upgrader_alarm.getTitle(), \n
severity=0, \n
detail="Upgrade Required for %s" % \\\n
(upgrader_alarm.getTitle()))\n
\n
kw = dict(tag=alarm_id)\n
if len(after_method_id) > 0:\n
kw["after_method_id"] = after_method_id\n
# alarm.solve() dos not support activate parameters\n
# so it is not possible to use it directly.\n
method_id = upgrader_alarm.getSolveMethodId()\n
if method_id not in (None, \'\'):\n
method = getattr(upgrader_alarm.activate(**kw), method_id)\n
method()\n
return [ method_id ]\n
return after_method_id\n
\n
# There is one strict order to run the alarms\n
# This is required because the one alarms depends the previous one be\n
# Fully done.\n
previous_method_id = launchUpgraderAlarm(\'bt5_upgrader\')\n
\n
previous_method_id.extend([\'updateBusinessTemplateFromUrl\',\n
\'immediateReindexObject\'])\n
\n
previous_method_id = launchUpgraderAlarm(\'finalize_upgrader\',\n
after_method_id = previous_method_id)\n
\n
for alarm_id in [\'bt5_upgrader\' , \'finalize_upgrader\']:\n
\n
upgrader_alarm = getattr(portal_alarms, alarm_id, None)\n
if upgrader_alarm is not None and upgrader_alarm.sense():\n
# Upgrade still needed for part.\n
#return\n
# XXX Do not retry run upgrader again, this is cause too much\n
# noise during this stage of development.\n
pass\n
\n
# Nothing else to do, so we can disable.\n
context.setEnabled(False)\n
return\n
]]></string> </value>
constraint_type = context.getId().replace("upgrader_check_", "")\n
context.Alarm_checkUpgraderConsistency(\n
active_process=context.newActiveProcess(),\n
filter_dict={"constraint_type": constraint_type})\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>REQUEST=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
<?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>"""\n
This script explains how to upgrade bt5. This script only update\n
the business templates, nothing else. Any other post script should\n
be handle by finalize upgrader.\n
"""\n
# Setup skins\n
context.ERP5Site_setupUpgraderSkinSelection()\n
\n
alarm_dict = context.ERP5Site_getUpgraderSignature().get(\'alarm_dict\', {})\n
if not alarm_dict.get(context.getId(), True):\n
return False\n
\n
portal_alarms = context.getPortalObject().portal_alarms\n
activate = context.portal_activities.activate\n
# Group Messages into the same active process.\n
active_process = portal_alarms.upgrader_controller.getLastActiveProcess()\n
if active_process is None:\n
active_process = context.newActiveProcess()\n
\n
active_process = active_process.getPath()\n
\n
message_list = []\n
\n
# update existing bt5\n
message_list.extend(context.ERP5Site_upgradeBusinessTemplateList(upgrade=1))\n
\n
activate(active_process=active_process,\n
activity=\'SQLQueue\',\n
priority=2).Alarm_saveActiveResult(summary="Upgrade BT5 Version",\n
severity=0,\n
detail=\'\\n\'.join(message_list))\n
\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_upgradeBT5Version</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
Finalize Upgrade is the final step of upgrader. Here should contains\n
the scripts that should be executed after the business template installation.\n
"""\n
# Setup skins\n
context.ERP5Site_setupUpgraderSkinSelection()\n
\n
clear_cache_kw = dict(activity=\'SQLQueue\', \n
priority=3, \n
tag="tag_upgrader_clear_cache")\n
\n
portal_alarms = context.getPortalObject().portal_alarms\n
activate = context.portal_activities.activate\n
# Group Messages into the same active process.\n
active_process = portal_alarms.upgrader_controller.getLastActiveProcess()\n
if active_process is None:\n
active_process = context.newActiveProcess()\n
\n
active_process = active_process.getPath()\n
\n
message_list = []\n
bt5_upgrader_sense = portal_alarms.bt5_upgrader.sense()\n
if bt5_upgrader_sense:\n
activate(active_process=active_process,\n
activity=\'SQLQueue\',\n
priority=2).Alarm_saveActiveResult(\n
summary="ERROR: Finalize Upgrader not started",\n
severity=0,\n
detail=\'BT5 Upgrader Sense: %s\' % (bt5_upgrader_sense))\n
\n
for script_id in context.ERP5Site_getUpgraderSignature().get(\'finalize_upgrade_script_list\', []):\n
message_list.extend(getattr(context, script_id)(upgrade=1))\n
\n
activate(active_process=active_process,\n
activity=\'SQLQueue\',\n
priority=2).Alarm_saveActiveResult(summary="Finalize Upgrade",\n
severity=0,\n
detail=\'\\n\'.join(message_list))\n
\n
clear_cache_kw[\'after_method_id\'] = [\'Alarm_saveActiveResult\',\'immediateReindexObject\']\n
context.portal_caches.activate(**clear_cache_kw).clearAllCache()\n
\n
activate(active_process=active_process,\n
activity=\'SQLQueue\',\n
priority=4,\n
after_tag=clear_cache_kw[\'tag\']).ERP5Site_notifyUpgradeIntegrity(active_process=active_process)\n
\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_upgradeFinalize</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,50 +50,69 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Verify if this instance is a properly configured one.\n
This script could be used in functional tests\n
"""\n
<value> <string>portal = context.getPortalObject()\n
constraint_type_list = portal.getPortalConstraintTypeList()\n
\n
portal = context.getPortalObject()\n
property_sheet_by_type_dict = {}\n
for portal_type in portal.portal_types.objectValues():\n
property_sheet_list = portal_type.getTypePropertySheetList()\n
if not property_sheet_list:\n
continue\n
for property_sheet in property_sheet_list:\n
property_sheet_by_type_dict.setdefault(\n
property_sheet, []).append(portal_type.getId())\n
\n
message_list = []\n
type_per_constraint_type = {}\n
constraint_type_per_id = {}\n
for property_sheet in portal.portal_property_sheets.objectValues():\n
constraint_list = property_sheet.objectValues(\n
portal_type=constraint_type_list)\n
if not constraint_list:\n
continue\n
type_list = []\n
type_list_append = type_list.append\n
property_sheet_id = property_sheet.getId()\n
for constraint in constraint_list:\n
method = getattr(constraint, \'getConstraintType\', None)\n
if not method:\n
continue\n
constraint_type = method()\n
if constraint_type:\n
if property_sheet_id in property_sheet_by_type_dict:\n
type_per_constraint_type.setdefault(\n
constraint_type, []).extend(\n
property_sheet_by_type_dict[property_sheet_id])\n
type_list_append(constraint_type)\n
if type_list:\n
constraint_type_per_id.setdefault(property_sheet_id, []).extend(type_list)\n
\n
message_list.extend(context.ERP5Site_upgradeBusinessTemplateList())\n
constraint_type_per_type = {}\n
for property_sheet_id, category_list in constraint_type_per_id.iteritems():\n
for portal_type in property_sheet_by_type_dict.get(property_sheet_id, []):\n
constraint_type_per_type.setdefault(portal_type, []).extend(category_list)\n
\n
message_list.extend(context.ERP5Site_upgradeGlobalPropertyList())\n
portal_type_tool = portal.portal_types\n
portal_type_list = constraint_type_per_type.keys()\n
\n
message_list.extend(context.ERP5Site_upgradeValidationStateList())\n
for portal_type in portal_type_list:\n
allowed_content_type_list = \\\n
portal_type_tool[portal_type].getTypeAllowedContentTypeList()\n
for allowed_content_type in allowed_content_type_list:\n
if allowed_content_type in portal_type_list:\n
type_list = constraint_type_per_type.pop(allowed_content_type)\n
for constraint_type in type_list:\n
type_per_constraint_type[constraint_type].remove(allowed_content_type)\n
\n
message_list.extend(context.ERP5Site_upgradeWorkflowChain())\n
\n
message_list.extend(context.ERP5Site_upgradeSQLCatalog())\n
\n
if getattr(context, \'WizardTool_isPersonReferenceGloballyUnique\', None) is not None:\n
if len(context.PersonModule_getUserAccountList(\'occupied\')) == 0 and \\\n
getattr(portal.acl_users, \'nexedi_authentication\', None) is not None:\n
# If there is collision this verification should not be launch be\n
# because it should fail anyway.\n
message_list.extend(context.ERP5Site_upgradeData())\n
\n
return message_list\n
return constraint_type_per_type, type_per_constraint_type\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_verifyUpgradeIntegrity</string> </value>
<value> <string>Base_getConstraintTypeListPerPortalType</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,17 +50,23 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n
portal.manage_addProperty(\'custom_property_without_meaning\', \'I was there\', \'string\')\n
<value> <string>"""\n
This script should returns always two list of Business Template.\n
- The first list is to resolve dependencies and upgrade.\n
- The second list is what you want to keep. This is useful if we want to keep \n
a old business template without updating it and without removing it\n
"""\n
\n
return (\'erp5_base\',), []\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>fixit=False</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_updateSitePropertyForTestOnly</string> </value>
<value> <string>Base_getUpgradeBusinessTemplateList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,36 +50,32 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Verify instance integrity launch all Integrity Verification scripts. \n
<value> <string>traverse = context.getPortalObject().restrictedTraverse\n
active_process = traverse(active_process)\n
\n
Run all verification scripts defined at Signature.\n
"""\n
message_list = []\n
# We don\'t need check more if something is already inconsistent\n
if (active_process.ActiveProcess_sense() and not fixit):\n
return\n
\n
for script_id in context.ERP5Site_getUpgraderSignature().get(\'integrity_verification_script_id_list\', []):\n
result = context.ERP5Site_runVerificationScript(script_id)\n
if result is not None:\n
message_list.append(result)\n
constraint_message_list = context.checkConsistency(fixit=fixit,\n
filter=filter)\n
\n
return message_list\n
if constraint_message_list and not active_process.getResultList():\n
summary = "%s Consistency - At least one inconsistent object found" % \\\n
(fixit and \'Fix\' or \'Check\')\n
active_process.postActiveResult(\n
severity=(not fixit and 1) or 0,\n
summary=summary,\n
detail=[m.message for m in constraint_message_list])\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
<value> <string>fixit, filter, active_process</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_verifyInstanceIntegrity</string> </value>
<value> <string>Base_postCheckConsistencyResult</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>ERP5Site_clearActivities</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5UpgraderUtils</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_clearActivities</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>ERP5Site_runVerificationScript</string> </value>
<value> <string>ERP5Site_dumpWorkflowChainByPortalType</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
......@@ -16,7 +16,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_runVerificationScript</string> </value>
<value> <string>ERP5Site_dumpWorkflowChainByPortalType</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
<?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>ERP5Site_editERP5SiteProperty</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5UpgraderUtils</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_editERP5SiteProperty</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
Site\'s version is the version of the erp5_core business template\n
This script could be moved to should use System Signature or \n
simple replaced by:\n
portal_instropections.getSystemSignature()["business_templates"]\n
"""\n
bt5 = context.getPortalObject().portal_templates.getInstalledBusinessTemplate("erp5_core")\n
return str(bt5.getVersion())\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_getBusinessTemplateVersion</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>ERP5Site_restartZopeInstance</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>ERP5UpgraderUtils</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_restartZopeInstance</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
"""\n
message_list = []\n
portal_alarms = context.portal_alarms\n
alarm_tool_configuration_list = context.ERP5Site_getUpgraderSignature().get(\'alarm_tool_configuration_list\', [])\n
if alarm_tool_configuration_list is None:\n
return message_list\n
\n
for alarm_id, is_enabled in alarm_tool_configuration_list: \n
obj = getattr(portal_alarms, alarm_id, None)\n
if obj is not None and int(obj.getEnabled()) != int(is_enabled):\n
message = "Upgrade is required for Alarm %s, enabled = %s (expected %s)" % \\\n
(alarm_id, obj.getEnabled(),is_enabled )\n
if int(upgrade) == 1:\n
obj.setEnabled(int(is_enabled))\n
message = "[ UPDATED ] " + message\n
message_list.append(message)\n
\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeAlarmToolConfiguration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 encoding="cdata"><![CDATA[
"""\n
Check installed business templates one \n
by one. If one of the business templates does not \n
use the latest revision, then we need to install.\n
"""\n
# Initialize variables\n
portal = context.getPortalObject()\n
portal_templates = portal.portal_templates\n
signature = portal.ERP5Site_getUpgraderSignature()\n
message_list = []\n
\n
previous_bt5_id = None\n
bt5_counter = 0\n
available_bt5_list = portal_templates.getRepositoryBusinessTemplateList(newest_only=True)\n
available_bt5_id_list = [x.title for x in available_bt5_list]\n
required_bt5_id_list = signature.get(\'required_bt5_id_list\', [])\n
upgradable_bt5_id_list = signature.get(\'upgradable_bt5_id_list\', [])\n
if len(upgradable_bt5_id_list) == 0:\n
# by default, we try to upgrade all installed business templates.\n
upgradable_bt5_id_list = portal_templates.getInstalledBusinessTemplateTitleList()\n
reinstallable_bt5_id_list = signature.get(\'reinstallable_bt5_id_list\', signature.get(\'reinstalable_bt5_id_list\', []))\n
before_triggered_bt5_id_dict = signature.get(\'before_triggered_bt5_id_dict\', {})\n
after_triggered_bt5_id_dict = signature.get(\'after_triggered_bt5_id_dict\', {})\n
update_catalog_bt5_id_list = signature.get(\'update_catalog_bt5_id_list\', [])\n
not_upgradable_id_list = signature.get(\'not_upgradable_id_list\', [])\n
\n
bt5_id_list = dict([(x, True) for x in list(required_bt5_id_list) + \\\n
list(upgradable_bt5_id_list) + \\\n
list(reinstallable_bt5_id_list) \\\n
if x in available_bt5_id_list and x not in not_upgradable_id_list]).keys()\n
\n
# sort by dependencies\n
bt5_list = [portal_templates.decodeRepositoryBusinessTemplateUid(x.uid) for x in \\\n
available_bt5_list if x.title in bt5_id_list]\n
bt5_list = portal_templates.sortBusinessTemplateList(bt5_list)\n
\n
installed_bt5_title_list = [o.getTitle() for o in portal_templates.getInstalledBusinessTemplateList()]\n
\n
bt5_counter = portal_templates.countFolder()[0][0]\n
\n
def installBT5(bt5_url, bt5_title, previous_bt5, bt5_counter, force=False):\n
bt5_id = "%s_%s" % (bt5_counter, bt5_title)\n
kw = dict(activity="SQLQueue", tag=bt5_id)\n
if previous_bt5 is not None:\n
kw[\'after_tag\'] = previous_bt5\n
# We must make sure all documents from previous installations \n
# are already indexed (specially categories).\n
kw[\'after_method_id\'] = "immediateReindexObject"\n
update_catalog = bt5_title in update_catalog_bt5_id_list\n
before_triggered_bt5_id_list = before_triggered_bt5_id_dict.get(bt5_title, ())\n
after_triggered_bt5_id_list = after_triggered_bt5_id_dict.get(bt5_title, ())\n
keep_original_list = signature.get(\'keep_original_dict\', {}).get(bt5_title, ())\n
if upgrade:\n
portal_templates.activate(**kw).updateBusinessTemplateFromUrl(\n
bt5_url, # id=bt5_id, \n
keep_original_list=keep_original_list,\n
before_triggered_bt5_id_list=before_triggered_bt5_id_list,\n
after_triggered_bt5_id_list=after_triggered_bt5_id_list,\n
update_catalog=update_catalog,\n
reinstall=force)\n
previous_bt5_id = bt5_id\n
bt5_counter += 1\n
message_list.append("%s will be installed" % bt5_url)\n
return bt5_id\n
\n
previous_bt5 = None\n
for repository, bt5_id in bt5_list:\n
new_bt = [x for x in available_bt5_list \\\n
if portal_templates.decodeRepositoryBusinessTemplateUid(x.uid) == (repository, bt5_id)][0]\n
bt5_url = \'/\'.join((repository, bt5_id))\n
bt5_title = new_bt.title\n
if bt5_title in reinstallable_bt5_id_list:\n
bt5_id = installBT5(bt5_url, bt5_title, previous_bt5, bt5_counter, force=True)\n
previous_bt5 = bt5_id\n
else:\n
installed_bt = portal_templates.getInstalledBusinessTemplate(bt5_title, strict=True)\n
if installed_bt is not None:\n
if int(installed_bt.getRevision() or 0) >= int(new_bt.revision or 0):\n
continue\n
if bt5_title in required_bt5_id_list:\n
bt5_counter += 1\n
bt5_id = installBT5(bt5_url, bt5_title, previous_bt5, bt5_counter)\n
previous_bt5 = bt5_id\n
elif bt5_title in installed_bt5_title_list: # update_bt5_id_list\n
bt5_counter += 1\n
bt5_id = installBT5(bt5_url, bt5_title, previous_bt5, bt5_counter)\n
previous_bt5 = bt5_id\n
\n
return message_list\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeBusinessTemplateList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
It is expected that some objects has some state in the after upgrade finish.\n
This alarm verify and upgrade the objects that were defined in signature.\n
"""\n
from Products.ERP5Type.Log import log\n
portal_templates = context.portal_templates\n
validation_dict = context.ERP5Site_getUpgraderSignature().get(\'object_action_dict\', {})\n
param_not_provided = "PARAM_NOT_PROVIDED"\n
\n
# get list of title of bt5 that are installed.\n
installed_bt5_title_list = [t.getTitle() for t in portal_templates.getInstalledBusinessTemplateList()]\n
\n
# get the list of keys that correspond to a valid business template.\n
upgradable_list = []\n
for k in validation_dict.keys():\n
if k in installed_bt5_title_list:\n
upgradable_list.extend(validation_dict[k])\n
\n
message_list = []\n
for definition in upgradable_list:\n
if len(definition) == 5:\n
path, method_id, expected_state, action, param_list = definition\n
else:\n
path, method_id, expected_state, action = definition\n
param_list = param_not_provided\n
sub_message_list = []\n
try:\n
obj = context.restrictedTraverse(path)\n
except KeyError:\n
obj = None\n
log("Unable to find %s" % path)\n
if obj is not None:\n
method = getattr(obj, method_id, None)\n
if method is not None and method() == expected_state:\n
sub_message_list.append("Upgrade is required for Object List (%s object is in %s state, action %s.)" %\n
(path, expected_state, action))\n
if int(upgrade) == 1:\n
action_method = getattr(obj, action , None)\n
if action_method is not None:\n
if param_list == param_not_provided:\n
action_method()\n
else:\n
action_method(*param_list)\n
sub_message_list.append("[UPDATED]")\n
message_list.append(\' \'.join(sub_message_list))\n
\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeObjectList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
Verify if a Property Sheet is associated with the Portal Type.\n
"""\n
\n
message_list = []\n
\n
portal_type_property_sheet_list = context.ERP5Site_getUpgraderSignature().get(\'portal_type_property_sheet_list\', [])\n
\n
for expected_property_sheet, portal_type_id_list in portal_type_property_sheet_list:\n
\n
portal_type_list = context.portal_types.searchFolder(id=portal_type_id_list)\n
portal_type_to_fix = []\n
\n
for pt in portal_type_list:\n
property_sheet_list = pt.getTypePropertySheetList()\n
if expected_property_sheet not in pt.getTypePropertySheetList():\n
if upgrade:\n
property_sheet_list.append(expected_property_sheet)\n
pt.setTypePropertySheet(property_sheet_list)\n
message_list.append("Associate PropertySheet %s into Portal Type %s." % (expected_property_sheet,pt.getId()))\n
else:\n
message_list.append("%s doesn\'t has %s associated." % (pt.getId(), expected_property_sheet))\n
\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradePortalTypePropertySheet</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
Update SQLCatalog, this script update the catalog when it is needed.\n
Finalize Upgrade never make sense become True, because there is no\n
standard way to detect if the SQLUpgrade is needed. Reindexation should \n
be only a consequence of other script only.\n
"""\n
signature = context.ERP5Site_getUpgraderSignature()\n
if not signature.get("recatalog", True):\n
return []\n
\n
if not upgrade:\n
# Never consider outdated.\n
return []\n
\n
# Could we consider always update this after some business templates\n
# was updated?\n
message_list = []\n
\n
if not upgrade:\n
# Upgrade Required\n
return [\'Upgrade required for SQLCatalog\']\n
\n
catalog = context.portal_catalog.getSQLCatalog()\n
\n
# clear the catalog\n
catalog.manage_catalogClear()\n
message_list.append("Catalog %s was Clear." % (catalog.getId()))\n
\n
tag = "tag_migration_finish"\n
# reindex the while site\n
context.getPortalObject().ERP5Site_reindexAll(final_activity_tag=tag)\n
message_list.append("Launched Reindex of ERP5.")\n
# update translation\n
context.getPortalObject().ERP5Site_updateTranslationTable()\n
message_list.append("Update Translation Table.")\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeSQLCatalog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>message_list = []\n
expect_expression_dict = context.ERP5Site_getUpgraderSignature().get(\'catalog_filter_dict\', None)\n
if expect_expression_dict is None:\n
# If key is not provided, ignore.\n
return []\n
\n
catalog = context.portal_catalog.erp5_mysql_innodb\n
\n
filter_dict = catalog.getFilterDict()\n
catalog_filter_dict = {}\n
for key in filter_dict:\n
catalog_filter_dict[key] = filter_dict[key][\'expression\']\n
\n
# test if keys are the same\n
for key in expect_expression_dict:\n
if expect_expression_dict[key] != catalog_filter_dict[key]:\n
message_list.append("Wrong expression definition found at %s: %s (Expected) != %s (Found)" % (key, expect_expression_dict[key], catalog_filter_dict[key]))\n
\n
if not upgrade:\n
return message_list\n
\n
message_list = []\n
# test if keys are the same\n
for key in expect_expression_dict:\n
if expect_expression_dict[key] != catalog_filter_dict[key]:\n
message_list.append("Upgraded Catalog Filter Expression definition found at %s ." % (key))\n
catalog.setFilterExpression(key, expect_expression_dict[key])\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeSQLCatalogFilter</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
Place for add Security or Roles upgrade.\n
\n
There is tools and new modules added by upgrader\n
and those the roles should be updated. \n
\n
ie.: Make Web site available for old instances or\n
update local roles.\n
\n
"""\n
message_list = []\n
\n
# Currently is never needed to update security, it is always forced.\n
if not upgrade:\n
return message_list\n
\n
portal = context.getPortalObject()\n
portal_workflow = portal.portal_workflow\n
workflow_id_list = portal.ERP5Site_getUpgraderSignature().get(\'update_security_workflow_id_list\', [])\n
for workflow_id in workflow_id_list:\n
workflow = getattr(portal_workflow, workflow_id, None)\n
if workflow is not None:\n
workflow.updateRoleMappings()\n
\n
message_list.append(\n
"Update workflow security for: \\n\\t%s" % \\\n
(\'\\n\\t\'.join(workflow_id_list)))\n
\n
types_tool = portal.portal_types\n
portal_type_list = portal.ERP5Site_getUpgraderSignature().get(\'update_role_portal_type_list\', [])\n
\n
for pt in portal_type_list:\n
# Note: Raises on purpose\n
types_tool[pt].updateRoleMapping()\n
\n
message_list.append(\n
"Update Local Roles for security groups for: \\n\\t%s" % \\\n
(\'\\n\\t\'.join(portal_type_list)))\n
\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeSecurity</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>"""\n
Verify if this instance is a properly configured one.\n
This script could be used in functional tests\n
"""\n
plugin_id_list = [\'default_memcached_plugin\',\'persistent_memcached_plugin\']\n
portal = context.getPortalObject()\n
key_prefix = \'upgrade_verification\'\n
if getattr(portal, "erp5_site_global_id", None) == "test_client_chroot":\n
# This is a test environment so all instance will have the same prefix.\n
# change key_prefix to prevent useless failure.\n
key_prefix = \'upgrade_verification%s\' % str(float(DateTime()))\n
\n
message_list = []\n
\n
def assertEquals(value1, value2, label=""):\n
if not (value1 == value2):\n
message_list.append("Memcached: %s Fail (%s != %s)" % (label, value1, value2))\n
\n
def assertNotEquals(value1, value2, label=""):\n
if not (value1 != value2):\n
message_list.append("Memcached: %s Fail (%s == %s)" % (label, value1, value2))\n
\n
# Verify if memcached and plugins are present into the instance\n
portal_memcached = getattr(portal, "portal_memcached", None)\n
if portal_memcached is not None:\n
plugin_object_id_list = portal_memcached.objectIds()\n
for plugin_id in plugin_id_list:\n
if plugin_id not in plugin_object_id_list:\n
message_list.append("Memcached plugin %s is not present." % plugin_id)\n
else: \n
message_list.append("Portal Memcached is not present.")\n
\n
# Test Plugins\n
def getMemcachedDict(plugin_path):\n
return portal_memcached.getMemcachedDict(key_prefix=key_prefix, \n
plugin_path=plugin_path)\n
\n
# If this is not None the value was get from another instance\n
site_id = getattr(portal, "erp5_site_global_id", None)\n
for plugin_id in plugin_id_list:\n
plugin_object = getMemcachedDict(\'portal_memcached/%s\' % plugin_id)\n
if plugin_object.get("upgrade_verification_key") in ("Foo Bar", None):\n
# Solve some possible legacy.\n
plugin_object["upgrade_verification_key"] = site_id\n
assertEquals(plugin_object.get("upgrade_verification_key", site_id),\n
site_id, "upgrade_verification_key")\n
plugin_object.set("upgrade_verification_key", site_id)\n
assertEquals(plugin_object.get("upgrade_verification_key", None),\n
site_id, "upgrade_verification_key")\n
\n
return message_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_verifyMemcachedIntegrity</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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 encoding="cdata"><![CDATA[
message_list = []\n
\n
catalog = context.portal_catalog.erp5_mysql_innodb\n
filter_dict = catalog.getFilterDict()\n
catalog_filter_dict = {}\n
for key in filter_dict:\n
catalog_filter_dict[key] = filter_dict[key][\'expression\']\n
\n
expect_expression_dict = context.ERP5Site_getUpgraderSignature().get(\'catalog_filter_dict\', {})\n
\n
if len(catalog_filter_dict.keys()) != len(expect_expression_dict.keys()):\n
message_list.append("Catalog filter have diferent key lenght (%s != %s): %s != %s" % \\\n
(len(catalog_filter_dict.keys()), len(expect_expression_dict.keys()),\n
catalog_filter_dict.keys(), expect_expression_dict.keys()))\n
\n
missing_key_list = [ key for key in expect_expression_dict if key not in catalog_filter_dict ]\n
\n
if len(missing_key_list) > 0:\n
message_list.append("Missing keys at Catalog filter: %s" % missing_key_list)\n
\n
for key in expect_expression_dict:\n
if expect_expression_dict[key] != catalog_filter_dict[key]:\n
message_list.append("Wrong expression definition found at %s: %s (Expected) != %s (Found)" % (key, expect_expression_dict[key], catalog_filter_dict[key]))\n
\n
real_data_verified = 0\n
for person in context.getPortalObject().person_module.contentValues():\n
organisation = person.getSubordinationValue()\n
if organisation is not None:\n
real_data_verified = 1\n
if person not in organisation.getSubordinationRelatedValueList(portal_type=\'Person\'):\n
message_list.append("Catalog is broken. Acquired categories are not in category table.")\n
# it is enough to check one object - there is full reindex done\n
break\n
\n
if not real_data_verified:\n
message_list.append("It was not possible to verify catalog integrity using real data.")\n
return message_list\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_verifySQLCatalogFilterIntegrity</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -52,80 +52,74 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# This script is called at the end of reindex and Run \n
# the verification scripts for this migration \n
# \n
# In addition to verification script, this send the log of\n
# migration for each instance. So we can analize the result \n
# later. One event could be created into nexedi erp5 for \n
# each instance updated.\n
# \n
try:\n
result = context.ERP5Site_verifyInstanceIntegrity()\n
except:\n
# Make Sure that the email will be send and indicates which \n
# Instance fails to verify.\n
result = ["Verification Failed."]\n
if erp5_uid is None:\n
erp5_uid = getattr(context.getPortalObject(), "erp5_site_global_id", \'%s (%s)\' % (context.getPortalObject().getTitle(), context.getPortalObject().absolute_url()))\n
import re\n
template_tool = context\n
\n
body="""\n
Result for Upgrader Verification Script for %s Instance: \n
bt5_per_title_dict = {}\n
bt5_list = [i.getTitle() for i in \\\n
context.portal_templates.getRepositoryBusinessTemplateList()]\n
\n
installed_bt5_list = template_tool.getInstalledBusinessTemplateList()\n
for bt5 in installed_bt5_list:\n
bt5_title = bt5.title\n
if bt5_title not in bt5_list:\n
continue\n
bt5_per_title_dict[bt5_title] = bt5\n
\n
""" % (erp5_uid)\n
resolved_list = template_tool.resolveBusinessTemplateListDependency(bt5_per_title_dict.iterkeys())\n
\n
status = "OK"\n
if len(result) > 0:\n
status = "Failed"\n
body += \' \\n\'.join(result)\n
else:\n
body += \'NO MESSAGE\'\n
pattern = re.compile(r"(?P<portal_type>.*)[| ]\\|[| ](?P<workflow_id>.*)")\n
portal_type_dict = {}\n
for _, bt5_id in resolved_list:\n
if bt5_id not in bt5_per_title_dict:\n
continue\n
workflow_chain_list = bt5_per_title_dict[bt5_id].getTemplatePortalTypeWorkflowChainList()\n
if not workflow_chain_list:\n
continue\n
for workflow_chain in workflow_chain_list:\n
group_dict = pattern.match(workflow_chain).groupdict()\n
portal_type = group_dict[\'portal_type\']\n
workflow_id = group_dict[\'workflow_id\']\n
workflow_id_list = portal_type_dict.setdefault("%s" % portal_type, [])\n
if workflow_id.startswith(\'-\'):\n
workflow_id_list.remove(workflow_id.replace(\'-\', \'\'))\n
continue\n
elif workflow_id in workflow_id_list:\n
continue\n
workflow_id_list.append(workflow_id)\n
\n
body += """\n
========= Upgrader Log ============\n
"""\n
error_list = []\n
workflow_chain_by_portal_type_dict = context.ERP5Site_dumpWorkflowChainByPortalType()\n
new_workflow_chain_dict = {\'chain_%s\' % portal_type : \',\'.join(chain) \\\n
for portal_type, chain in workflow_chain_by_portal_type_dict.iteritems()}\n
\n
if active_process is not None:\n
process = context.restrictedTraverse(active_process)\n
if process is not None:\n
for active_result in process.getResultList():\n
body += """\n
%s\n
""" % (active_result.detail)\n
else:\n
body += "Fail to get log from activity result!"\n
for portal_type, workflow_chain in portal_type_dict.iteritems():\n
try:\n
workflow_chain_list = list(workflow_chain_by_portal_type_dict[portal_type])\n
except:\n
return workflow_chain_by_portal_type_dict[portal_type]\n
expected_workflow_chain = sorted(workflow_chain)\n
if sorted(workflow_chain_list) != expected_workflow_chain:\n
error_list.append("%s - Expected: %s <> Found: %s" % (portal_type, \', \'.join(workflow_chain), \', \'.join(workflow_chain_list)))\n
if fixit:\n
new_workflow_chain_dict["chain_%s" % portal_type] = \',\'.join(expected_workflow_chain)\n
\n
subject = "%s: Upgrade Result for %s" % (status, erp5_uid)\n
if fixit and new_workflow_chain_dict:\n
portal_workflow = context.getPortalObject().portal_workflow\n
portal_workflow.manage_changeWorkflows(default_chain="", props=new_workflow_chain_dict)\n
\n
kw = {\'body\': body,\n
\'erp5_uid\': erp5_uid,\n
\'subject\' : subject}\n
\n
# If the instance is well configured this will send a message\n
# to email_to_address or email_from_address. \n
context.portal_notifications.sendMessage(\n
sender=None,\n
recipient=[],\n
subject=subject,\n
message=body,\n
message_text_format=\'text/plain\',\n
notifier_list=(\'Mail Message\',),\n
store_as_event=False,\n
)\n
\n
return ["Notification is sent!"]\n
return error_list\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>erp5_uid=None, active_process=None</string> </value>
<value> <string>fixit=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_notifyUpgradeIntegrity</string> </value>
<value> <string>TemplateTool_checkPostUpgradeWorkflowChainConsistency</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,19 +50,21 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
Dummy script used by Upgrader Script\n
"""\n
return [ (upgrade_object.getRelativeUrl(), upgrade_object.getMetaType()) ]\n
<value> <string>bt5_list, keep_bt5_id_set = context.Base_getUpgradeBusinessTemplateList()\n
\n
template_tool = context.getPortalObject().portal_templates\n
return template_tool.upgradeSite(bt5_list,\n
keep_bt5_id_set=keep_bt5_id_set,\n
dry_run=(not fixit))\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade_object</string> </value>
<value> <string>fixit=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_testUpgradeObjectClass</string> </value>
<value> <string>TemplateTool_checkUpgradeConsistency</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -6,13 +6,25 @@
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testLiveUpgrader</string> </value>
<value> <string>testUpgrader</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testLiveUpgrader</string> </value>
<value> <string>test.erp5.testUpgrader</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -24,6 +36,31 @@
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>R: 33, 0: Too many ancestors (9/7) (too-many-ancestors)</string>
<string>W: 59,64: Unused argument \'sequence\' (unused-argument)</string>
<string>W: 76,42: Unused argument \'sequence\' (unused-argument)</string>
<string>W: 89,48: Unused argument \'sequence\' (unused-argument)</string>
<string>W:104,53: Unused argument \'sequence\' (unused-argument)</string>
<string>W:109,51: Unused argument \'sequence\' (unused-argument)</string>
<string>W:112,52: Unused argument \'sequence\' (unused-argument)</string>
<string>W:115,56: Unused argument \'sequence\' (unused-argument)</string>
<string>W:122,54: Unused argument \'sequence\' (unused-argument)</string>
<string>W:140,54: Unused argument \'sequence\' (unused-argument)</string>
<string>W:147,54: Unused argument \'sequence\' (unused-argument)</string>
<string>R: 33, 0: Too many public methods (136/20) (too-many-public-methods)</string>
</tuple>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
......@@ -31,13 +68,28 @@
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
......@@ -50,7 +102,7 @@
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
</dictionary>
......@@ -59,7 +111,7 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
......@@ -74,7 +126,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>ERP5TypeTestCase</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -92,8 +144,8 @@
</tuple>
<state>
<tuple>
<float>1377844666.57</float>
<string>GMT+9</string>
<float>1384357832.27</float>
<string>GMT+1</string>
</tuple>
</state>
</object>
......
2013-11-18 Gabriel Monnerat
* The alarms were renamed to cover each step of upgrader and give the possibility to call each step manually one-by-one.
* Also, all Scripts that the logic can be done by installing Business Template was removed.
2013-09-03 arnaud.fontaine
* ZODB Components: Workflow History must always be kept, so avoid an extra step for developers.
......@@ -5,7 +9,7 @@
* ZODB Components: Migrate Documents, Extensions and Tests.
2012-10-05 arnaud.fontaine
* Allow to specify bt5 which are not going to be upgraded (meaningful for master data for example).
* Allow to specify bt5 which are not going to be upgraded (meaningful for master data for example).
2011-03-10 Kazuhiko
* by default, all installed business templates will be upgraded, not all existing business templates in the repository.
......
erp5_upgrader can be used to upgrade any site:
* create Business Template which overrides upgrader scripts in its own skin (XXX_erp5_upgrader)
* set extremely high business_template_skin_layer_priority (like 10000.0)
* develop this Business Template
* to upgrade site install first XXX_erp5_upgrader, then erp5_upgrader
* voilà - site upgraded
\ No newline at end of file
* Create Business Template and override TemplateTool_checkUpgradeConsistency script to set the Business Template list related to your project
* Set extremely high business_template_skin_layer_priority (like 10000.0)
* Develop constraints and set Constraint Type following upgrader steps
* To upgrade site install first XXX_erp5_upgrader, then erp5_upgrader
* Solve the alarm portal_alarms/upgrader_launch_full_upgrade
\ No newline at end of file
601
\ No newline at end of file
612
\ No newline at end of file
portal_alarms/bt5_upgrader
portal_alarms/finalize_upgrader
portal_alarms/upgrader_controller
\ No newline at end of file
portal_alarms/promise_check_upgrade
portal_alarms/upgrader_check_post_upgrade
portal_alarms/upgrader_check_pre_upgrade
portal_alarms/upgrader_check_upgrader
\ No newline at end of file
Template Tool | TemplateToolPostUpgradeConstraint
Template Tool | TemplateToolUpgraderConstraint
\ No newline at end of file
TemplateToolUpgraderConstraint
TemplateToolPostUpgradeConstraint
\ No newline at end of file
test.erp5.testLiveUpgrader
\ No newline at end of file
test.erp5.testUpgrader
\ No newline at end of file
erp5_full_text_myisam_catalog
erp5_base
erp5_upgrader_test
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment