Commit 450fa30b authored by Yusei Tahara's avatar Yusei Tahara

erp5_scalability_test: Setup activity tool before test.

parent d9ad0ce2
...@@ -11,6 +11,8 @@ portal_catalog = portal.portal_catalog ...@@ -11,6 +11,8 @@ portal_catalog = portal.portal_catalog
status_code = 0 status_code = 0
error_message = "No error." error_message = "No error."
context.ERP5Site_setUpActivityTool()
user_quantity = request.get('user_quantity') user_quantity = request.get('user_quantity')
if user_quantity is None: return json.dumps({"status_code" : 1, "error_message": "Parameter 'user_quantity' is required.", "password" : None }) if user_quantity is None: return json.dumps({"status_code" : 1, "error_message": "Parameter 'user_quantity' is required.", "password" : None })
password = ''.join(random.choice(string.digits + string.letters) for i in xrange(10)) password = ''.join(random.choice(string.digits + string.letters) for i in xrange(10))
......
if not context.portal_activities.isSubscribed():
context.portal_activities.subscribe()
context.portal_activities.manage_removeFromProcessingList(context.portal_activities.getProcessingNodeList())
distribution_node = None
distribution_node_list = []
activity_node_list = []
for node_id in context.portal_activities.getIdleNodeList():
if node_id.startswith('activities'):
activity_node_list.append(node_id)
elif node_id.startswith('distribution'):
distribution_node_list.append(node_id)
activity_node_list.sort()
distribution_node_list.sort()
if distribution_node_list:
distribution_node = distribution_node_list[0]
if distribution_node is None:
distribution_node = activity_node_list[0]
context.portal_activities.manage_addToProcessingList(activity_node_list)
context.portal_activities.manage_setDistributingNode(distribution_node)
<?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>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_setUpActivityTool</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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