I'm trying to reset template bindings for all my devices through zendmd. I can
successfully perform this through zendmd if the device has additional templates
bound, beyond the default bindings.
If I attempt to do it on a server that has only the default bindings, I get
this error:
Code:
[EMAIL PROTECTED]:~/zendmd_scripts> zendmd < reset_bindings
Welcome to zenoss dmd command shell!
use zhelp() to list commands
>>> ... ... ... Traceback (most recent call last):
File "<stdin>", line 3, in ?
File "/usr/local/zenoss/Products/ZenModel/Device.py", line 1789, in
removeZDeviceTemplates
return self.deleteZenProperty('zDeviceTemplates', REQUEST)
File "/usr/local/zenoss/Products/ZenRelations/ZenPropertyManager.py", line
242, in deleteZenProperty
self._delProperty(propname)
File "usr/local/zenoss/lib/python/OFS/PropertyManager.py", line 215, in
_delProperty
ValueError: The property zDeviceTemplates does not exist
>>> >>>
Here's the small script I've written to try this on one device.
Code:
for dev in dmd.Devices.Server.Linux.getSubDevices():
if dev.id == 'myserver':
dev.removeZDeviceTemplates()
commit()
Is there a test I can do to see whether or not the device has more than the
default templates bound? I'd like to skip over any server that has just the
defaults bound, so the script doesn't error out.
Thanks!
-------------------- m2f --------------------
Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=23682#23682
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users