panoptician
2012-10-11 23:36:23 UTC
panoptician [http://community.zenoss.org/people/panoptician] created the discussion
"zendmd - problem with getTitleOrId"
To view the discussion, visit: http://community.zenoss.org/message/69043#69043
--------------------------------------------------------------
I'm trying to automate the deletion of devices, some of which have a title and some only have an ID. This can successfully match and delete based off ID:
import re
p = re.compile('^string', re.IGNORECASE)
for d in dmd.Devices.getSubDevices():
   if p.match(d.getDeviceName()):
       d.deleteDevice()
But I'm trying to match based off the title, so I tried using getTitleOrId instead. This just gives me an attribute error, but I can do a "print d.titleOrId()" and get exactly what I expect. What's preventing me from using getTitleOrId in this instance?
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69043#69043]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"zendmd - problem with getTitleOrId"
To view the discussion, visit: http://community.zenoss.org/message/69043#69043
--------------------------------------------------------------
I'm trying to automate the deletion of devices, some of which have a title and some only have an ID. This can successfully match and delete based off ID:
import re
p = re.compile('^string', re.IGNORECASE)
for d in dmd.Devices.getSubDevices():
   if p.match(d.getDeviceName()):
       d.deleteDevice()
But I'm trying to match based off the title, so I tried using getTitleOrId instead. This just gives me an attribute error, but I can do a "print d.titleOrId()" and get exactly what I expect. What's preventing me from using getTitleOrId in this instance?
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69043#69043]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]