Discussion:
Custom Property Bad Request
Mouhammed Soueidane
2013-09-17 13:55:59 UTC
Permalink
Mouhammed Soueidane [http://community.zenoss.org/people/raziology] created the discussion

"Custom Property Bad Request"

To view the discussion, visit: http://community.zenoss.org/message/74685#74685

--------------------------------------------------------------
Hello everyone,
I'm having a problem with some of the devices that I have. I have create a custom property for all of my devices which is of type "string". Now for the majority of the devices that I have, I can safely set the value of the custom property and then click on "save" with no problems. For some of my devices however, I get the following stacktrace:

*Type: <class 'zExceptions.BadRequest'>*
*Value: The property cHOSPPOSVersion does not exist*
Traceback (most recent call last): File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 126, in publish request, bind=1) File "/opt/zenoss/lib/python/ZPublisher/mapply.py", line 77, in mapply if debug is not None: return debug(object,args,context) File "/opt/zenoss/lib/python/ZPublisher/Publish.py", line 46, in call_object result=apply(object,args) # Type s<cr> to step into published object. File "/opt/zenoss/Products/ZenModel/ZenModelBase.py", line 602, in saveCustProperties redirect = self.saveZenProperties(iscustprop, REQUEST) File "/opt/zenoss/Products/ZenRelations/ZenPropertyManager.py", line 450, in saveZenProperties self.setZenProperty(name, value) File "/opt/zenoss/Products/ZenRelations/ZenPropertyManager.py", line 426, in setZenProperty self._updateProperty(propname, propvalue) File "/opt/zenoss/Products/ZenRelations/ZenPropertyManager.py", line 316, in _updateProperty super(ZenPropertyManager, self)._updateProperty(id, value) File "/opt/zenoss/lib/python/OFS/PropertyManager.py", line 205, in _updateProperty raise BadRequest, 'The property %s does not exist' % escape(id) BadRequest: The property cHOSPPOSVersion does not exist


Now I think that my ZOPE DB contains some problems. I tried to do the following using zendmd:
reindex()
commit()


But this did not fix the problem. Can anyone please tell me how to solve it?


Thanks a lot in advance.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74685#74685]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Mouhammed Soueidane
2013-09-18 08:47:39 UTC
Permalink
Mouhammed Soueidane [http://community.zenoss.org/people/raziology] created the discussion

"Re: Custom Property Bad Request"

To view the discussion, visit: http://community.zenoss.org/message/74693#74693

--------------------------------------------------------------
After further investigating the problem, I had to edit the following script:
$zenosshome/lib/python/OFS/PropertyManager.py

What I did was commenting the following lines:
(Line 205) if not self.hasProperty(id):
  (Line206)      raise BadRequest, 'The property %s does not exist' % escape(id)


For a reason that I don't yet understand, the hasProperty method is raising an exception that the property I'm setting does not exist, yet setAttr is successfully setting the property's value!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74693#74693]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...