Commit a9f02ede authored by Jérome Perrin's avatar Jérome Perrin

change severity for log message reporting duplicate uids or path too long, it

should not just be a warning


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27523 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7ea0ef7e
...@@ -27,7 +27,7 @@ from BTrees.Length import Length ...@@ -27,7 +27,7 @@ from BTrees.Length import Length
from Shared.DC.ZRDB.TM import TM from Shared.DC.ZRDB.TM import TM
from Acquisition import aq_parent, aq_inner, aq_base from Acquisition import aq_parent, aq_inner, aq_base
from zLOG import LOG, WARNING, INFO, TRACE from zLOG import LOG, WARNING, INFO, TRACE, ERROR
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from Products.PythonScripts.Utility import allow_class from Products.PythonScripts.Utility import allow_class
...@@ -1321,7 +1321,7 @@ class Catalog(Folder, ...@@ -1321,7 +1321,7 @@ class Catalog(Folder,
uid = object.uid uid = object.uid
if uid in assigned_uid_dict: if uid in assigned_uid_dict:
object.uid = self.newUid() object.uid = self.newUid()
LOG('SQLCatalog', WARNING, LOG('SQLCatalog', ERROR,
'uid of %r changed from %r to %r as old one is assigned to %r !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, object.uid, assigned_uid_dict[uid])) 'uid of %r changed from %r to %r as old one is assigned to %r !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, object.uid, assigned_uid_dict[uid]))
uid = object.uid uid = object.uid
...@@ -1336,7 +1336,7 @@ class Catalog(Folder, ...@@ -1336,7 +1336,7 @@ class Catalog(Folder,
raise CatalogError, 'A negative uid %d is used for %s. Your catalog is broken. Recreate your catalog.' % (index, path) raise CatalogError, 'A negative uid %d is used for %s. Your catalog is broken. Recreate your catalog.' % (index, path)
if uid != index or isinstance(uid, int): if uid != index or isinstance(uid, int):
# We want to make sure that uid becomes long if it is an int # We want to make sure that uid becomes long if it is an int
LOG('SQLCatalog', WARNING, 'uid of %r changed from %r (property) to %r (catalog, by path) !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, index)) LOG('SQLCatalog', ERROR, 'uid of %r changed from %r (property) to %r (catalog, by path) !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, index))
uid = index uid = index
object.uid = uid object.uid = uid
else: else:
...@@ -1373,10 +1373,10 @@ class Catalog(Folder, ...@@ -1373,10 +1373,10 @@ class Catalog(Folder,
# An uid conflict happened... Why? # An uid conflict happened... Why?
# can be due to path length # can be due to path length
if len(path) > MAX_PATH_LEN: if len(path) > MAX_PATH_LEN:
LOG('SQLCatalog', WARNING, 'path of object %r is too long for catalog. You should use a shorter path.' %(object,)) LOG('SQLCatalog', ERROR, 'path of object %r is too long for catalog. You should use a shorter path.' %(object,))
object.uid = self.newUid() object.uid = self.newUid()
LOG('SQLCatalog', WARNING, LOG('SQLCatalog', ERROR,
'uid of %r changed from %r to %r as old one is assigned to %s in catalog !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, object.uid, catalog_path)) 'uid of %r changed from %r to %r as old one is assigned to %s in catalog !!! This can be fatal. You should reindex the whole site immediately.' % (object, uid, object.uid, catalog_path))
uid = object.uid uid = object.uid
......
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