0

I could view page http://localhost:8080/zport/dmd/networkMap in my browser, but when I want to see object which is published on that page using app.unrestrictedTraverse, i get following error:

>>> app.unrestrictedTraverse('zport/dmd/networkMap')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/opt/zenoss/lib/python/OFS/Traversable.py", line 299, in unrestrictedTraverse
    raise e
KeyError: 'networkMap'

So, I wander, if there are no such attribute as networkMap on dmd object, how does Zope know what to render on that page? Are there some other ways to map URLs into code that renders pages?

Mathias
  • 6,777
  • 2
  • 20
  • 32
Bunyk
  • 7,635
  • 8
  • 47
  • 79
  • 1
    Traversal done by ZPublisher is slightly different than traversal done by OFS. ZPublisher has some magic for views, that might be the issue. Notice that unrestrictedTraverse() successfully traverses 'zport/dmd' before bailing on the name 'networkMap'. Is it possible that networkMap is a browser view for Zenoss? If so, have you tried traversing to 'zport/dmd/@@networkMap'? https://github.com/zopefoundation/Zope/blob/master/src/ZPublisher/BaseRequest.py#L171 – sdupton Jul 09 '14 at 16:58
  • @sdupton I have tried traversing to `'zport/dmd/@@networkMap'`, this time it gives me `AttributeError: @@networkMap` with the same traceback. As I understand ZPublisher is the module for publishing objects in zope. What then is OFS? – Bunyk Jul 10 '14 at 11:28
  • OFS stands for "object file system" or something of the like; it is the package in Zope where unrestrictedTraverse() method is defined. I can speculate that you will need to know what kind of object you get when you traverse to 'zport/dmd' -- there is likely a traversal method (or adapter) for that object doing some magic indirection. – sdupton Jul 10 '14 at 14:51

0 Answers0