Commit b1154000 authored by Rafael Monnerat's avatar Rafael Monnerat

Fix for tidstorage backup

  Broken during some refactoring it was broken with the following traceback:

$ ./bin/tidstorage-repozo
No handlers could be found for logger "TIDStorage"
Traceback (most recent call last):
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/bin/tidstorage_repozo", line 267, in <module>
    import Products.TIDStorage.repozo.repozo_tidstorage
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/eggs/Products.TIDStorage-5.5.0-py2.7.egg/Products/T
IDStorage/__init__.py", line 30, in <module>
    import transaction_transaction
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/eggs/Products.TIDStorage-5.5.0-py2.7.egg/Products/T
IDStorage/transaction_transaction.py", line 74, in <module>
    from Products.CMFActivity.ActivityTool import getServerAddress
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/parts/erp5/product/CMFActivity/ActivityTool.py", li
ne 37, in <module>
    from Products.ERP5Type.Tool.BaseTool import BaseTool
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/parts/erp5/product/ERP5Type/Tool/BaseTool.py", line
 34, in <module>
    from Products.ERP5Type.Core.Folder import Folder
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/parts/erp5/product/ERP5Type/Core/__init__.py", line
 5, in <module>
    import Products.CMFCategory
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/parts/erp5/product/CMFCategory/__init__.py", line 4
0, in <module>
    import Category, CategoryTool
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/parts/erp5/product/CMFCategory/Category.py", line 4
0, in <module>
    from Products.ERP5Type.Core.Folder import Folder
  File "/srv/slapgrid/slappart0/srv/runner/software/a0b0649fbf81fcec27b928dd72928d9f/parts/erp5/product/ERP5Type/Core/Folder.py", line 1
668, in <module>
    from Products.CMFActivity.ActivityTool import getCurrentNode
ImportError: cannot import name getCurrentNode
parent cc154770
...@@ -1665,7 +1665,29 @@ class Folder(OFSFolder2, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn): ...@@ -1665,7 +1665,29 @@ class Folder(OFSFolder2, CMFBTreeFolder, CMFHBTreeFolder, Base, FolderMixIn):
pass pass
return '%s/%s' % (url, icon) return '%s/%s' % (url, icon)
from Products.CMFActivity.ActivityTool import getCurrentNode try:
from Products.CMFActivity.ActivityTool import getCurrentNode
except ImportError:
def getCurrentNode():
""" Return current node identifier """
global currentNode
if currentNode is None:
currentNode = getattr(
getConfiguration(),
'product_config',
{},
).get('cmfactivity', {}).get('node-id')
if currentNode is None:
warnings.warn('Node name auto-generation is deprecated, please add a'
'\n'
'<product-config CMFActivity>\n'
' node-id = ...\n'
'</product-config>\n'
'section in your zope.conf, replacing "..." with a cluster-unique '
'node identifier.', DeprecationWarning)
currentNode = getServerAddress()
return currentNode
# We browse all used class from btree and hbtree and set not implemented # We browse all used class from btree and hbtree and set not implemented
# class if one method defined on a class is not defined on other, thus if # class if one method defined on a class is not defined on other, thus if
......
...@@ -2,4 +2,7 @@ ...@@ -2,4 +2,7 @@
# because Folder needs PropertySheet.CategoryCore # because Folder needs PropertySheet.CategoryCore
# This is important for ZEO server which may need to import conflict-resolution # This is important for ZEO server which may need to import conflict-resolution
# classes from products that depend (at 'import' time) directly on Folder. # classes from products that depend (at 'import' time) directly on Folder.
import Products.CMFCategory try:
import Products.CMFCategory
except ImportError:
pass
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