Commit 1fa75866 authored by Julien Muchembled's avatar Julien Muchembled

* ERP5Site_checkCatalogTable:

  * Add support for 'fixit' parameter. Calls unindexObject for missing objects, and reindexObject when values differ.
  * Fix detection of missing objects in the ZODB. Exclude 'path' from properties to check because it is redundant and "getProperty('path')" does not always work.
  * Fix comparison of float values. Rounding errors could produce false positive.
  * Reduce length of some lines (80 chars).
  * Clean up dead code.
* Delete useless Alarm_activeCheckCatalogTable and update check_catalog alarm.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@26854 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f9097773
......@@ -11,7 +11,15 @@
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_activeCheckCatalogTable</string> </value>
<value> <string>Alarm_checkCatalogTable</string> </value>
</item>
<item>
<key> <string>alarm_notification_mode</string> </key>
<value>
<tuple>
<string>problem</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -27,6 +35,25 @@
<key> <string>id</string> </key>
<value> <string>check_catalog</string> </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>1230768000.0</float>
<string>GMT</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Alarm</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</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>active_process = context.newActiveProcess()\n
context.Alarm_checkCatalogTable(active_process=\'/\'.join(active_process.getPhysicalPath()), tag=tag)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>fixit=0, tag=\'\'</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>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>fixit</string>
<string>tag</string>
<string>_getattr_</string>
<string>context</string>
<string>active_process</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<int>0</int>
<string></string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_activeCheckCatalogTable</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -53,11 +53,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.ERP5Site_checkCatalogTable(bundle_object_count=bundle_object_count,\n
bundle_offset=bundle_offset,\n
activity_count=1,\n
active_process=active_process,\n
tag=tag)\n
<value> <string>context.ERP5Site_checkCatalogTable(\n
active_process=context.newActiveProcess().getPath(),\n
**kw)\n
</string> </value>
</item>
<item>
......@@ -68,7 +66,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>bundle_object_count=100, bundle_offset=0, active_process=None, tag=\'\'</string> </value>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -88,16 +86,14 @@
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>4</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>bundle_object_count</string>
<string>bundle_offset</string>
<string>active_process</string>
<string>tag</string>
<string>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
......@@ -111,12 +107,7 @@
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<int>100</int>
<int>0</int>
<none/>
<string></string>
</tuple>
<none/>
</value>
</item>
<item>
......
61
\ No newline at end of file
62
\ 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