Commit 9eb4d237 authored by Rafael Monnerat's avatar Rafael Monnerat

Move the script list ran after upgrade to upgrader signature.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42321 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 319f2e64
...@@ -63,112 +63,24 @@ alarm_dict = context.ERP5Site_getUpgraderSignature("alarm_dict")\n ...@@ -63,112 +63,24 @@ alarm_dict = context.ERP5Site_getUpgraderSignature("alarm_dict")\n
if not alarm_dict.get(context.getId(), True):\n if not alarm_dict.get(context.getId(), True):\n
return False\n return False\n
\n \n
# Verify if is required upgrade Global Site Properties. \n finalize_upgrade_script_list = context.ERP5Site_getUpgraderSignature(\'finalize_upgrade_script_list\')\n
if len(context.ERP5Site_upgradeGlobalPropertyList()) > 0:\n for script_id in finalize_upgrade_script_list:\n
if len(getattr(context, script_id)()) > O:\n
return True\n return True\n
\n \n
if len(context.ERP5Site_upgradeValidationStateList()) > 0: \n
return True\n
\n
if len(context.ERP5Site_upgradeWorkflowChain()) > 0:\n
return True\n
\n
if len(context.ERP5Site_upgradeData()) > 0: \n
return True\n
\n
if len(context.ERP5Site_upgradePortalTypePropertySheet()) > 0: \n
return True\n
\n
if len(context.ERP5Site_upgradeSecurity()) > 0: \n
return True\n
\n
if len(context.ERP5Site_upgradeObjectClass()) > 0: \n
return True\n
\n
if len(context.ERP5Site_upgradeSQLCatalogFilter()) > 0: \n
return True\n
\n
if len(context.ERP5Site_upgradeSQLCatalog()) > 0: \n
return True\n
\n
if len(context.ERP5Site_upgradeAlarmToolConfiguration()) > 0:\n
return True\n
\n
# (rafael) Maybe this is dangerous, enable it when this\n
# is appropriated tested.\n
#if len(context.ERP5Site_upgradeMySQLCharset()) > 0: \n
# return True\n
\n
return False\n return False\n
]]></string> </value> ]]></string> </value>
</item> </item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>**kw</string> </value>
</item> </item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>alarm_dict</string>
<string>True</string>
<string>False</string>
<string>len</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Alarm_senseFinalizeUpgrade</string> </value> <value> <string>Alarm_senseFinalizeUpgrade</string> </value>
</item> </item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -82,27 +82,8 @@ if bt5_upgrader_sense:\n ...@@ -82,27 +82,8 @@ if bt5_upgrader_sense:\n
severity=0,\n severity=0,\n
detail=\'BT5 Upgrader Sense: %s\' % (bt5_upgrader_sense))\n detail=\'BT5 Upgrader Sense: %s\' % (bt5_upgrader_sense))\n
\n \n
# Verify if is required upgrade Global Site Properties. \n for script_id in context.ERP5Site_getUpgraderSignature(\'finalize_upgrade_script_list\'):\n
message_list.extend(context.ERP5Site_upgradeGlobalPropertyList(upgrade=1))\n message_list.extend(getattr(context, script_id)(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeWorkflowChain(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeValidationStateList(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeData(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradePortalTypePropertySheet(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeSecurity(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeMySQLCharset(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeSQLCatalogFilter(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeObjectClass(upgrade=1))\n
\n
message_list.extend(context.ERP5Site_upgradeAlarmToolConfiguration(upgrade=1))\n
\n
\n \n
# Verify if there was any change previously and \n # Verify if there was any change previously and \n
if len(message_list) > 0:\n if len(message_list) > 0:\n
...@@ -128,79 +109,14 @@ return message_list\n ...@@ -128,79 +109,14 @@ return message_list\n
]]></string> </value> ]]></string> </value>
</item> </item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>**kw</string> </value> <value> <string>**kw</string> </value>
</item> </item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>dict</string>
<string>clear_cache_kw</string>
<string>portal_alarms</string>
<string>activate</string>
<string>active_process</string>
<string>None</string>
<string>message_list</string>
<string>bt5_upgrader_sense</string>
<string>len</string>
<string>_write_</string>
<string>_apply_</string>
<string>_getitem_</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Alarm_upgradeFinalize</string> </value> <value> <string>Alarm_upgradeFinalize</string> </value>
</item> </item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
...@@ -156,7 +156,6 @@ REQUIRED_BT5_ID_LIST = ()\n ...@@ -156,7 +156,6 @@ REQUIRED_BT5_ID_LIST = ()\n
# After the bt5 be updated, update catalog will be trigger.\n # After the bt5 be updated, update catalog will be trigger.\n
UPDATE_CATALOG_BT5_ID_LIST = ()\n UPDATE_CATALOG_BT5_ID_LIST = ()\n
\n \n
\n
# Call some scripts inside same transaction before or after BT update\n # Call some scripts inside same transaction before or after BT update\n
BEFORE_TRIGGERED_BT5_SCRIPT_ID_DICT = {}\n BEFORE_TRIGGERED_BT5_SCRIPT_ID_DICT = {}\n
AFTER_TRIGGERED_BT5_SCRIPT_ID_DICT = {\'erp5_mysql_innodb_catalog\': (\'ERP5Site_updateSitePropertyForTestOnly\',)}\n AFTER_TRIGGERED_BT5_SCRIPT_ID_DICT = {\'erp5_mysql_innodb_catalog\': (\'ERP5Site_updateSitePropertyForTestOnly\',)}\n
...@@ -164,8 +163,7 @@ AFTER_TRIGGERED_BT5_SCRIPT_ID_DICT = {\'erp5_mysql_innodb_catalog\': (\'ERP5Site ...@@ -164,8 +163,7 @@ AFTER_TRIGGERED_BT5_SCRIPT_ID_DICT = {\'erp5_mysql_innodb_catalog\': (\'ERP5Site
# A list bt5 which require reinstallation\n # A list bt5 which require reinstallation\n
# ie. the upgrader will call reinstall\n # ie. the upgrader will call reinstall\n
# on each of them and revert all local changes.\n # on each of them and revert all local changes.\n
REINSTALABLE_BT5_ID_LIST = (\'erp5_odt_style\',\n REINSTALABLE_BT5_ID_LIST = ()\n
)\n
\n \n
# A snapshot of workflow chains which are known to be valid\n # A snapshot of workflow chains which are known to be valid\n
# this snapshot will be generated automatically from release\n # this snapshot will be generated automatically from release\n
...@@ -287,6 +285,21 @@ INTEGRITY_VERIFICATION_SCRIPT_ID_LIST = (\'ERP5Site_verifyUpgradeIntegrity\',\n ...@@ -287,6 +285,21 @@ INTEGRITY_VERIFICATION_SCRIPT_ID_LIST = (\'ERP5Site_verifyUpgradeIntegrity\',\n
\'ERP5Site_verifySQLCatalogFilterIntegrity\',\n \'ERP5Site_verifySQLCatalogFilterIntegrity\',\n
\'ERP5Site_verifyActivityIntegrity\')\n \'ERP5Site_verifyActivityIntegrity\')\n
\n \n
#\n
# List of Scripts to be sense and run after business template be upgraded. This can\n
# be consider as After methods.\n
\n
FINALIZE_ALARM_SCRIPT = ( \'ERP5Site_upgradeGlobalPropertyList\',\n
\'ERP5Site_upgradeValidationStateList\',\n
\'ERP5Site_upgradeWorkflowChain\',\n
\'ERP5Site_upgradePortalTypePropertySheet\',\n
\'ERP5Site_upgradeSecurity\',\n
\'ERP5Site_upgradeObjectClass\',\n
\'ERP5Site_upgradeSQLCatalogFilter\',\n
\'ERP5Site_upgradeAlarmToolConfiguration\',\n
#\'ERP5Site_upgradeMySQLCharset\',\n
)\n
\n
# \n # \n
# Define the property and value ({\'property\' : \'value\', ...} to be set or created \n # Define the property and value ({\'property\' : \'value\', ...} to be set or created \n
# into erp5 portal object.\n # into erp5 portal object.\n
......
<?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 upgrade of Data or objects.\n
This can be changed to a alarm in future and it will \n
probably be constantly overwriten everytime that it \n
is needed in another folder.\n
"""\n
\n
# By default it is never need to do data upgrade.\n
return []\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>upgrade=[]</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>upgrade</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<list/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_upgradeData</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
556 557
\ No newline at end of file \ 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