You can use the _getOb method:
Code:
for dev in dmd.Devices.Foo._getOb('Test A').getSubDevices():
for interface in dev.os.interfaces():
Also, in Python in general, you can always use gettattr() to access
attributes if, for whatever reason, dotted name access is impractical.
Code:
for dev in getattr(dmd.Devices.Foo, 'Test A').getSubDevices():
for interface in dev.os.interfaces():
Hope that helps!
Ian
On Sep 9, 2008, at 5:01 AM, gentux31 wrote:
Hi all,
For a script I want to access some devices in a certain device class.
Example:
There are several devices in the device class:
/Devices/Foo/Test A/
If I want to access these devices in the "Test A" device class it
complains about the whitespace I guess.
Code:
for dev in dmd.Devices.Foo.Test A.getSubDevices():
for interface in dev.os.interfaces():
Anyone has an idea how to solve this.
Thanks!
-------------------- m2f --------------------
Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=24828#24828
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users