Commit 37298336 authored by Julien Muchembled's avatar Julien Muchembled

cleanup: stop passing obsolete 'passive_commit' parameters to CMFActivity

parent 627f9416
...@@ -69,7 +69,7 @@ for inventory in portal.portal_catalog(portal_type=portal.getPortalInventoryType ...@@ -69,7 +69,7 @@ for inventory in portal.portal_catalog(portal_type=portal.getPortalInventoryType
sql_catalog_id=sql_catalog_id):\n sql_catalog_id=sql_catalog_id):\n
inventory = inventory.getObject()\n inventory = inventory.getObject()\n
tag = \'inventory_%i\' % inventory.getUid()\n tag = \'inventory_%i\' % inventory.getUid()\n
activate_kw = dict(tag=tag, passive_commit=passive_commit)\n activate_kw = {\'tag\': tag}\n
if previous_tag is not None:\n if previous_tag is not None:\n
activate_kw[\'after_tag\'] = previous_tag\n activate_kw[\'after_tag\'] = previous_tag\n
previous_tag = tag\n previous_tag = tag\n
...@@ -82,7 +82,7 @@ if final_activity_tag is not None and previous_tag is not None:\n ...@@ -82,7 +82,7 @@ if final_activity_tag is not None and previous_tag is not None:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>sql_catalog_id=None, passive_commit=1, final_activity_tag=None, **kw</string> </value> <value> <string>sql_catalog_id=None, final_activity_tag=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
584 585
\ No newline at end of file \ No newline at end of file
...@@ -105,7 +105,7 @@ for line in iter(import_file.readline, ""):\n ...@@ -105,7 +105,7 @@ for line in iter(import_file.readline, ""):\n
attribute_value_dict = dict([(csv_property_list[x], csv_data_list[x]) \\\n attribute_value_dict = dict([(csv_property_list[x], csv_data_list[x]) \\\n
for x in xrange(len(csv_property_list))])\n for x in xrange(len(csv_property_list))])\n
\n \n
method(priority=4, activity="SQLQueue", passive_commit=1).Base_importCsvLine(attribute_value_dict)\n method(priority=4, activity="SQLQueue").Base_importCsvLine(attribute_value_dict)\n
redirect_url = \'%s?%s\' % ( context.absolute_url()+\'/\'+\'view\', \'portal_status_message=Importing+CSV+file.\')\n redirect_url = \'%s?%s\' % ( context.absolute_url()+\'/\'+\'view\', \'portal_status_message=Importing+CSV+file.\')\n
request[ \'RESPONSE\' ].redirect( redirect_url )\n request[ \'RESPONSE\' ].redirect( redirect_url )\n
</string> </value> </string> </value>
......
16 17
\ No newline at end of file \ No newline at end of file
...@@ -62,7 +62,7 @@ class ActiveObject(ExtensionClass.Base): ...@@ -62,7 +62,7 @@ class ActiveObject(ExtensionClass.Base):
security = ClassSecurityInfo() security = ClassSecurityInfo()
def activate(self, activity=DEFAULT_ACTIVITY, active_process=None, def activate(self, activity=DEFAULT_ACTIVITY, active_process=None,
passive_commit=0, activate_kw=None, **kw): activate_kw=None, **kw):
"""Returns an active wrapper for this object. """Returns an active wrapper for this object.
Reserved Optional parameters: Reserved Optional parameters:
......
...@@ -67,7 +67,6 @@ context.portal_preferences.activate(\n ...@@ -67,7 +67,6 @@ context.portal_preferences.activate(\n
object_tag=tag,\n object_tag=tag,\n
object_priority=additional_priority,\n object_priority=additional_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -85,7 +84,6 @@ if person_module is not None :\n ...@@ -85,7 +84,6 @@ if person_module is not None :\n
object_tag=tag,\n object_tag=tag,\n
object_priority=higher_priority,\n object_priority=higher_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -110,7 +108,6 @@ context.portal_categories.activate(\n ...@@ -110,7 +108,6 @@ context.portal_categories.activate(\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=higher_priority,\n object_priority=higher_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -132,7 +129,6 @@ for folder in [context.portal_alarms, context.portal_activities]:\n ...@@ -132,7 +129,6 @@ for folder in [context.portal_alarms, context.portal_activities]:\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -154,7 +150,6 @@ context.portal_simulation.activate(\n ...@@ -154,7 +150,6 @@ context.portal_simulation.activate(\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=higher_priority,\n object_priority=higher_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -209,7 +204,6 @@ for folder in tool_list:\n ...@@ -209,7 +204,6 @@ for folder in tool_list:\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -227,7 +221,6 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n ...@@ -227,7 +221,6 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -247,7 +240,6 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n ...@@ -247,7 +240,6 @@ for folder in portal.objectValues(("ERP5 Folder",)):\n
object_after_tag=object_after_tag,\n object_after_tag=object_after_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
start_tree=start_tree,\n start_tree=start_tree,\n
stop_tree=stop_tree,)\n stop_tree=stop_tree,)\n
\n \n
...@@ -257,7 +249,6 @@ context.portal_simulation.activate(\n ...@@ -257,7 +249,6 @@ context.portal_simulation.activate(\n
priority=3 + additional_priority\n priority=3 + additional_priority\n
).InventoryModule_reindexMovementList(\n ).InventoryModule_reindexMovementList(\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
final_activity_tag=\'last_inventory_activity\')\n final_activity_tag=\'last_inventory_activity\')\n
\n \n
if final_activity_tag is not None:\n if final_activity_tag is not None:\n
...@@ -278,7 +269,7 @@ return printed\n ...@@ -278,7 +269,7 @@ return printed\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>sql_catalog_id=None, additional_priority=0, passive_commit=1, clear_catalog=0, final_activity_tag=None, start_tree=None, stop_tree=None</string> </value> <value> <string>sql_catalog_id=None, additional_priority=0, clear_catalog=0, final_activity_tag=None, start_tree=None, stop_tree=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -57,7 +57,6 @@ folder = context\n ...@@ -57,7 +57,6 @@ folder = context\n
activate_kw = {\n activate_kw = {\n
\'tag\': object_tag,\n \'tag\': object_tag,\n
\'after_tag\': folder_after_tag,\n \'after_tag\': folder_after_tag,\n
\'passive_commit\': passive_commit\n
}\n }\n
for key, value in activate_kw.items():\n for key, value in activate_kw.items():\n
if value is None:\n if value is None:\n
...@@ -90,7 +89,6 @@ def Folder_reindexObjectList(id_list_list):\n ...@@ -90,7 +89,6 @@ def Folder_reindexObjectList(id_list_list):\n
folder_tag=bundle_tag,\n folder_tag=bundle_tag,\n
folder_after_tag=bundle_object_tag,\n folder_after_tag=bundle_object_tag,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
)\n )\n
archive_test_script = getattr(context.getPortalObject(), "Archive_test", None)\n archive_test_script = getattr(context.getPortalObject(), "Archive_test", None)\n
try:\n try:\n
...@@ -155,7 +153,6 @@ else:\n ...@@ -155,7 +153,6 @@ else:\n
folder_after_tag=bundle_object_tag,\n folder_after_tag=bundle_object_tag,\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
object_tag=bundle_object_tag,\n object_tag=bundle_object_tag,\n
tree_after_tag=tree_after_tag,\n tree_after_tag=tree_after_tag,\n
tree_tag=tree_tag,\n tree_tag=tree_tag,\n
...@@ -175,7 +172,7 @@ else:\n ...@@ -175,7 +172,7 @@ else:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, passive_commit=1, start_tree=None, stop_tree=None</string> </value> <value> <string>folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, start_tree=None, stop_tree=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -65,7 +65,6 @@ if id_list_list is not None:\n ...@@ -65,7 +65,6 @@ if id_list_list is not None:\n
activate_kw = {\n activate_kw = {\n
\'tag\': object_tag,\n \'tag\': object_tag,\n
\'after_tag\': object_after_tag,\n \'after_tag\': object_after_tag,\n
\'passive_commit\': passive_commit,\n
\'priority\': object_priority\n \'priority\': object_priority\n
}\n }\n
for key, value in activate_kw.items():\n for key, value in activate_kw.items():\n
...@@ -102,7 +101,6 @@ if id_list_list is not None:\n ...@@ -102,7 +101,6 @@ if id_list_list is not None:\n
object_priority=object_priority,\n object_priority=object_priority,\n
object_tag=object_tag,\n object_tag=object_tag,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
folder_tag=folder_tag,\n folder_tag=folder_tag,\n
folder_after_tag=folder_after_tag,\n folder_after_tag=folder_after_tag,\n
count=count,\n count=count,\n
...@@ -113,7 +111,7 @@ if id_list_list is not None:\n ...@@ -113,7 +111,7 @@ if id_list_list is not None:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>id_list, id_list_list=None, folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, passive_commit=1, count=None</string> </value> <value> <string>id_list, id_list_list=None, folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, count=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -63,14 +63,6 @@ if tree_id_list is not None:\n ...@@ -63,14 +63,6 @@ if tree_id_list is not None:\n
raise ValueError, "both tree and tree_id_list should not be defined"\n raise ValueError, "both tree and tree_id_list should not be defined"\n
tree_id = tree_id_list.pop()\n tree_id = tree_id_list.pop()\n
\n \n
activate_kw = {\n
\'passive_commit\': passive_commit\n
}\n
for key, value in activate_kw.items():\n
if value is None:\n
activate_kw.pop(key)\n
\n
\n
# Spawn activities for bundles of content objects.\n # Spawn activities for bundles of content objects.\n
# Bundle size, in object count\n # Bundle size, in object count\n
BUNDLE_ITEM_COUNT = 1000\n BUNDLE_ITEM_COUNT = 1000\n
...@@ -82,13 +74,12 @@ def Folder_reindexObjectList(id_list_list):\n ...@@ -82,13 +74,12 @@ def Folder_reindexObjectList(id_list_list):\n
"""\n """\n
folder.activate(activity=\'SQLQueue\', priority=object_priority, \n folder.activate(activity=\'SQLQueue\', priority=object_priority, \n
after_tag=object_tag,\n after_tag=object_tag,\n
tag=folder_tag, **activate_kw).Folder_reindexObjectList(\n tag=folder_tag).Folder_reindexObjectList(\n
None,\n None,\n
id_list_list=id_list_list,\n id_list_list=id_list_list,\n
object_priority=object_priority,\n object_priority=object_priority,\n
object_tag=object_tag,\n object_tag=object_tag,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
passive_commit=passive_commit,\n
folder_tag=folder_tag,\n folder_tag=folder_tag,\n
folder_after_tag=folder_after_tag,\n folder_after_tag=folder_after_tag,\n
)\n )\n
...@@ -124,7 +115,6 @@ if tree_id_list is not None:\n ...@@ -124,7 +115,6 @@ if tree_id_list is not None:\n
object_priority=object_priority,\n object_priority=object_priority,\n
sql_catalog_id=sql_catalog_id,\n sql_catalog_id=sql_catalog_id,\n
object_tag=object_tag,\n object_tag=object_tag,\n
passive_commit=passive_commit,\n
tree_after_tag=tree_after_tag,\n tree_after_tag=tree_after_tag,\n
tree_tag=tree_tag,\n tree_tag=tree_tag,\n
)\n )\n
...@@ -134,7 +124,7 @@ if tree_id_list is not None:\n ...@@ -134,7 +124,7 @@ if tree_id_list is not None:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>tree_id=None, tree_id_list=None, folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, passive_commit=1, tree_tag=None, tree_after_tag=None</string> </value> <value> <string>tree_id=None, tree_id_list=None, folder_tag=None, folder_after_tag=None, object_tag=None, object_after_tag=None, object_priority=1, sql_catalog_id=None, tree_tag=None, tree_after_tag=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -70,7 +70,7 @@ for inventory in portal.portal_catalog(portal_type=portal.getPortalInventoryType ...@@ -70,7 +70,7 @@ for inventory in portal.portal_catalog(portal_type=portal.getPortalInventoryType
sql_catalog_id=sql_catalog_id):\n sql_catalog_id=sql_catalog_id):\n
inventory = inventory.getObject()\n inventory = inventory.getObject()\n
tag = \'inventory_%i\' % inventory.getUid()\n tag = \'inventory_%i\' % inventory.getUid()\n
activate_kw = dict(tag=tag, passive_commit=passive_commit)\n activate_kw = {\'tag\': tag}\n
if previous_tag is not None:\n if previous_tag is not None:\n
activate_kw[\'after_tag\'] = previous_tag\n activate_kw[\'after_tag\'] = previous_tag\n
previous_tag = tag\n previous_tag = tag\n
...@@ -83,7 +83,7 @@ if final_activity_tag is not None and previous_tag is not None:\n ...@@ -83,7 +83,7 @@ if final_activity_tag is not None and previous_tag is not None:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>sql_catalog_id=None, passive_commit=1, final_activity_tag=None, **kw</string> </value> <value> <string>sql_catalog_id=None, final_activity_tag=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -213,8 +213,7 @@ class ArchiveTool(BaseTool): ...@@ -213,8 +213,7 @@ class ArchiveTool(BaseTool):
# Create inventory just before finish of hot reindexing # Create inventory just before finish of hot reindexing
inventory_date = archive.getStopDateRangeMax() inventory_date = archive.getStopDateRangeMax()
self.activate(passive_commit=1, self.activate(after_method_id=('playBackRecordedObjectList'),
after_method_id=('playBackRecordedObjectList'),
priority=5).runInventoryMethod(archive.id, priority=5).runInventoryMethod(archive.id,
source_connection_id, source_connection_id,
destination_sql_catalog_id, destination_sql_catalog_id,
...@@ -222,8 +221,7 @@ class ArchiveTool(BaseTool): ...@@ -222,8 +221,7 @@ class ArchiveTool(BaseTool):
) )
self.activate(passive_commit=1, self.activate(after_method_id=('runInventoryMethod'),
after_method_id=('runInventoryMethod'),
after_tag="runInventoryMethod", after_tag="runInventoryMethod",
priority=5).InventoryModule_reindexMovementList(sql_catalog_id=destination_sql_catalog_id, priority=5).InventoryModule_reindexMovementList(sql_catalog_id=destination_sql_catalog_id,
final_activity_tag="InventoryModule_reindexMovementList" final_activity_tag="InventoryModule_reindexMovementList"
......
...@@ -364,14 +364,14 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -364,14 +364,14 @@ class ZCatalog(Folder, Persistent, Implicit):
# Re-schedule the same action in case there are remaining rows in the # Re-schedule the same action in case there are remaining rows in the
# table. This can happen if the database connector limits the number # table. This can happen if the database connector limits the number
# of rows in the result. # of rows in the result.
self.activate(passive_commit=1, priority=5).\ self.activate(priority=5).\
playBackRecordedObjectList(sql_catalog_id=sql_catalog_id, playBackRecordedObjectList(sql_catalog_id=sql_catalog_id,
catalog=catalog) catalog=catalog)
else: else:
# If there iss nothing to do, go to next step. # If there iss nothing to do, go to next step.
if catalog == 0: if catalog == 0:
# If we were replaying unindex actions, time to replay index actions. # If we were replaying unindex actions, time to replay index actions.
self.activate(passive_commit=1, priority=5).\ self.activate(priority=5).\
playBackRecordedObjectList(sql_catalog_id=sql_catalog_id, playBackRecordedObjectList(sql_catalog_id=sql_catalog_id,
catalog=1) catalog=1)
# If we were replaying index actions, there is nothing else to do. # If we were replaying index actions, there is nothing else to do.
...@@ -516,25 +516,21 @@ class ZCatalog(Folder, Persistent, Implicit): ...@@ -516,25 +516,21 @@ class ZCatalog(Folder, Persistent, Implicit):
self.ERP5Site_reindexAll(sql_catalog_id=destination_sql_catalog_id, self.ERP5Site_reindexAll(sql_catalog_id=destination_sql_catalog_id,
final_activity_tag=final_activity_tag, final_activity_tag=final_activity_tag,
clear_catalog=1, clear_catalog=1,
additional_priority=1, additional_priority=1)
passive_commit=1)
# Once reindexing is finished, change the hot reindexing state so that # Once reindexing is finished, change the hot reindexing state so that
# new catalog changes are applied in both catalogs. # new catalog changes are applied in both catalogs.
self.activate(passive_commit=1, self.activate(after_tag=final_activity_tag,
after_tag=final_activity_tag,
priority=5).setHotReindexingState(HOT_REINDEXING_DOUBLE_INDEXING_STATE, priority=5).setHotReindexingState(HOT_REINDEXING_DOUBLE_INDEXING_STATE,
source_sql_catalog_id=source_sql_catalog_id, source_sql_catalog_id=source_sql_catalog_id,
destination_sql_catalog_id=destination_sql_catalog_id, destination_sql_catalog_id=destination_sql_catalog_id,
archive_path=archive_path) archive_path=archive_path)
# Once in double-indexing mode, planned reindex can be replayed. # Once in double-indexing mode, planned reindex can be replayed.
self.activate(passive_commit=1, self.activate(after_method_id='setHotReindexingState',
after_method_id='setHotReindexingState',
priority=5).playBackRecordedObjectList( priority=5).playBackRecordedObjectList(
sql_catalog_id=destination_sql_catalog_id) sql_catalog_id=destination_sql_catalog_id)
# Once there is nothing to replay, databases are sync'ed, so the new # Once there is nothing to replay, databases are sync'ed, so the new
# catalog can become current. # catalog can become current.
self.activate(passive_commit=1, self.activate(after_method_id=('playBackRecordedObjectList',
after_method_id=('playBackRecordedObjectList',
'InventoryModule_reindexMovementList'), 'InventoryModule_reindexMovementList'),
after_tag='InventoryModule_reindexMovementList', after_tag='InventoryModule_reindexMovementList',
priority=5).finishHotReindexing( priority=5).finishHotReindexing(
......
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