Commit 60b82f8f authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

give proper default values for ERP5Site_getUpgraderSignature.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43065 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 516a758e
...@@ -59,11 +59,11 @@ ...@@ -59,11 +59,11 @@
# Setup skins\n # Setup skins\n
context.ERP5Site_setupUpgraderSkinSelection()\n context.ERP5Site_setupUpgraderSkinSelection()\n
\n \n
alarm_dict = context.ERP5Site_getUpgraderSignature("alarm_dict")\n alarm_dict = context.ERP5Site_getUpgraderSignature.get(\'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
for script_id in context.ERP5Site_getUpgraderSignature(\'finalize_upgrade_script_list\'):\n for script_id in context.ERP5Site_getUpgraderSignature.get(\'finalize_upgrade_script_list\', []):\n
if len(getattr(context, script_id)()) > 0:\n if len(getattr(context, script_id)()) > 0:\n
return True\n return True\n
\n \n
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
"""\n """\n
Here we make sure the installed products are the right ones\n Here we make sure the installed products are the right ones\n
"""\n """\n
alarm_dict = context.ERP5Site_getUpgraderSignature("alarm_dict")\n alarm_dict = context.ERP5Site_getUpgraderSignature.get(\'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
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
Here we make sure the all required system libraries are installed in\n Here we make sure the all required system libraries are installed in\n
appropriate version.\n appropriate version.\n
"""\n """\n
alarm_dict = context.ERP5Site_getUpgraderSignature("alarm_dict")\n alarm_dict = context.ERP5Site_getUpgraderSignature.get(\'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
......
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
# Setup skins\n # Setup skins\n
context.ERP5Site_setupUpgraderSkinSelection()\n context.ERP5Site_setupUpgraderSkinSelection()\n
\n \n
alarm_dict = context.ERP5Site_getUpgraderSignature("alarm_dict")\n alarm_dict = context.ERP5Site_getUpgraderSignature.get(\'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
......
...@@ -82,7 +82,7 @@ if bt5_upgrader_sense:\n ...@@ -82,7 +82,7 @@ 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
for script_id in context.ERP5Site_getUpgraderSignature(\'finalize_upgrade_script_list\'):\n for script_id in context.ERP5Site_getUpgraderSignature.get(\'finalize_upgrade_script_list\', []):\n
message_list.extend(getattr(context, script_id)(upgrade=1))\n message_list.extend(getattr(context, script_id)(upgrade=1))\n
\n \n
# Verify if there was any change previously and \n # Verify if there was any change previously and \n
......
...@@ -158,7 +158,7 @@ AFTER_TRIGGERED_BT5_SCRIPT_ID_DICT = {\'erp5_mysql_innodb_catalog\': (\'ERP5Site ...@@ -158,7 +158,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 = ()\n REINSTALLABLE_BT5_ID_LIST = ()\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
...@@ -351,7 +351,7 @@ signature_dict = {\n ...@@ -351,7 +351,7 @@ signature_dict = {\n
, \'before_triggered_bt5_id_dict\': BEFORE_TRIGGERED_BT5_SCRIPT_ID_DICT\n , \'before_triggered_bt5_id_dict\': BEFORE_TRIGGERED_BT5_SCRIPT_ID_DICT\n
, \'after_triggered_bt5_id_dict\': AFTER_TRIGGERED_BT5_SCRIPT_ID_DICT\n , \'after_triggered_bt5_id_dict\': AFTER_TRIGGERED_BT5_SCRIPT_ID_DICT\n
# Provide a list of bt5 which require reinstallation\n # Provide a list of bt5 which require reinstallation\n
, \'reinstalable_bt5_id_list\': REINSTALABLE_BT5_ID_LIST\n , \'reinstallable_bt5_id_list\': REINSTALLABLE_BT5_ID_LIST\n
# Provides a list of bt5 path and items which must not be upgraded or deleted\n # Provides a list of bt5 path and items which must not be upgraded or deleted\n
, \'keep_original_dict\': KEEP_ORIGINAL_DICT\n , \'keep_original_dict\': KEEP_ORIGINAL_DICT\n
# Provides a list of bt5 path which require some action after upgrade\n # Provides a list of bt5 path which require some action after upgrade\n
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"""\n """\n
message_list = []\n message_list = []\n
portal_alarms = context.portal_alarms\n portal_alarms = context.portal_alarms\n
alarm_tool_configuration_list = context.ERP5Site_getUpgraderSignature("alarm_tool_configuration_list")\n alarm_tool_configuration_list = context.ERP5Site_getUpgraderSignature.get(\'alarm_tool_configuration_list\', [])\n
if alarm_tool_configuration_list is None:\n if alarm_tool_configuration_list is None:\n
return message_list\n return message_list\n
\n \n
......
...@@ -86,15 +86,15 @@ if not upgrade:\n ...@@ -86,15 +86,15 @@ if not upgrade:\n
# update all public bt5s\n # update all public bt5s\n
previous_bt5_id = None\n previous_bt5_id = None\n
bt5_counter = 0\n bt5_counter = 0\n
required_bt5_id_list = signature[\'required_bt5_id_list\']\n required_bt5_id_list = signature.get(\'required_bt5_id_list\', [])\n
upgradable_bt5_id_list = signature[\'upgradable_bt5_id_list\']\n upgradable_bt5_id_list = signature.get(\'upgradable_bt5_id_list\', [])\n
reinstalable_bt5_id_list = signature[\'reinstalable_bt5_id_list\']\n reinstallable_bt5_id_list = signature.get(\'reinstallable_bt5_id_list\', signature.get(\'reinstalable_bt5_id_list\', []))\n
before_triggered_bt5_id_dict = signature[\'before_triggered_bt5_id_dict\']\n before_triggered_bt5_id_dict = signature.get(\'before_triggered_bt5_id_dict\', [])\n
after_triggered_bt5_id_dict = signature[\'after_triggered_bt5_id_dict\']\n after_triggered_bt5_id_dict = signature.get(\'after_triggered_bt5_id_dict\', [])\n
update_catalog_bt5_id_list = signature[\'update_catalog_bt5_id_list\']\n update_catalog_bt5_id_list = signature.get(\'update_catalog_bt5_id_list\', [])\n
\n \n
\n \n
base_url_list = signature[\'bt5_base_url_list\']\n base_url_list = signature.get(\'bt5_base_url_list\', [])\n
installed_bt5_title_list = [o.getTitle() for o in portal_templates.getInstalledBusinessTemplateList()]\n installed_bt5_title_list = [o.getTitle() for o in portal_templates.getInstalledBusinessTemplateList()]\n
\n \n
bt5_counter = portal_templates.countFolder()[0][0]\n bt5_counter = portal_templates.countFolder()[0][0]\n
...@@ -119,7 +119,7 @@ def installBT5(bt5_title, previous_bt5, bt5_counter):\n ...@@ -119,7 +119,7 @@ def installBT5(bt5_title, previous_bt5, bt5_counter):\n
update_catalog = bt5_title in update_catalog_bt5_id_list \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 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 after_triggered_bt5_id_list = after_triggered_bt5_id_dict.get(bt5_title, ())\n
keep_original_list = signature[\'keep_original_dict\'].get(bt5_title, ())\n keep_original_list = signature.get(\'keep_original_dict\', {}).get(bt5_title, ())\n
portal_templates.activate(**kw).updateBusinessTemplateFromUrl(\n portal_templates.activate(**kw).updateBusinessTemplateFromUrl(\n
bt5_url, id = bt5_id, \n bt5_url, id = bt5_id, \n
keep_original_list=keep_original_list,\n keep_original_list=keep_original_list,\n
...@@ -162,7 +162,7 @@ for bt in required_bt5_id_list:\n ...@@ -162,7 +162,7 @@ for bt in required_bt5_id_list:\n
bt_id = installBT5(bt, previous_bt5, bt5_counter)\n bt_id = installBT5(bt, previous_bt5, bt5_counter)\n
previous_bt5 = bt_id\n previous_bt5 = bt_id\n
\n \n
for bt in reinstalable_bt5_id_list:\n for bt in reinstallable_bt5_id_list:\n
bt5_counter += 1\n bt5_counter += 1\n
bt_id = reinstallBT5(bt, previous_bt5, bt5_counter)\n bt_id = reinstallBT5(bt, previous_bt5, bt5_counter)\n
previous_bt5 = bt_id\n previous_bt5 = bt_id\n
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
message_list = []\n message_list = []\n
is_upgrade_required = 0\n is_upgrade_required = 0\n
site_property_dict = portal.ERP5Site_getUpgraderSignature(\'erp5_site_property_dict\')\n site_property_dict = portal.ERP5Site_getUpgraderSignature.get(\'erp5_site_property_dict\', {})\n
\n \n
for prop in site_property_dict:\n for prop in site_property_dict:\n
if site_property_dict[prop] != getattr(portal,prop , None):\n if site_property_dict[prop] != getattr(portal,prop , None):\n
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<value> <string>"""\n <value> <string>"""\n
Migrate Object Classes based on upgrade signature\n Migrate Object Classes based on upgrade signature\n
"""\n """\n
class_signature_list = context.ERP5Site_getUpgraderSignature(\'upgrade_object_class_list\')\n class_signature_list = context.ERP5Site_getUpgraderSignature.get(\'upgrade_object_class_list\', [])\n
\n \n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
message_list = []\n message_list = []\n
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
"""\n """\n
from Products.ERP5Type.Log import log\n from Products.ERP5Type.Log import log\n
portal_templates = context.portal_templates\n portal_templates = context.portal_templates\n
validation_dict = context.ERP5Site_getUpgraderSignature(\'object_action_dict\')\n validation_dict = context.ERP5Site_getUpgraderSignature.get(\'object_action_dict\', {})\n
param_not_provided = "PARAM_NOT_PROVIDED"\n param_not_provided = "PARAM_NOT_PROVIDED"\n
\n \n
# get list of title of bt5 that are installed.\n # get list of title of bt5 that are installed.\n
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
\n \n
message_list = []\n message_list = []\n
\n \n
portal_type_property_sheet_list = context.ERP5Site_getUpgraderSignature("portal_type_property_sheet_list")\n portal_type_property_sheet_list = context.ERP5Site_getUpgraderSignature.get(\'portal_type_property_sheet_list\', [])\n
\n \n
for expected_property_sheet, portal_type_id_list in portal_type_property_sheet_list:\n for expected_property_sheet, portal_type_id_list in portal_type_property_sheet_list:\n
\n \n
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<value> <string>"""\n <value> <string>"""\n
verify if the workflow was updated, if is not updated update it.\n verify if the workflow was updated, if is not updated update it.\n
"""\n """\n
workflow_chain_dict = context.ERP5Site_getUpgraderSignature(\'workflow_chain_dict\')\n workflow_chain_dict = context.ERP5Site_getUpgraderSignature.get(\'workflow_chain_dict\', {})\n
if workflow_chain_dict is None:\n if workflow_chain_dict is None:\n
# If no signature, ignore.\n # If no signature, ignore.\n
return []\n return []\n
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
"""\n """\n
message_list = []\n message_list = []\n
\n \n
for script_id in context.ERP5Site_getUpgraderSignature(\'integrity_verification_script_id_list\'):\n for script_id in context.ERP5Site_getUpgraderSignature.get(\'integrity_verification_script_id_list\', []):\n
result = context.ERP5Site_runVerificationScript(script_id)\n result = context.ERP5Site_runVerificationScript(script_id)\n
if result is not None:\n if result is not None:\n
message_list.append(result)\n message_list.append(result)\n
......
...@@ -60,7 +60,7 @@ catalog_filter_dict = {}\n ...@@ -60,7 +60,7 @@ catalog_filter_dict = {}\n
for key in filter_dict:\n for key in filter_dict:\n
catalog_filter_dict[key] = filter_dict[key][\'expression\']\n catalog_filter_dict[key] = filter_dict[key][\'expression\']\n
\n \n
expect_expression_dict = context.ERP5Site_getUpgraderSignature(\'catalog_filter_dict\')\n expect_expression_dict = context.ERP5Site_getUpgraderSignature.get(\'catalog_filter_dict\', {})\n
\n \n
if len(catalog_filter_dict.keys()) != len(expect_expression_dict.keys()):\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 message_list.append("Catalog filter have diferent key lenght (%s != %s): %s != %s" % \\\n
......
564 565
\ 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