Skip to content

Instantly share code, notes, and snippets.

@cluther
Created April 6, 2010 16:46
Show Gist options
  • Save cluther/357803 to your computer and use it in GitHub Desktop.
Save cluther/357803 to your computer and use it in GitHub Desktop.
def getComponentQuickly(device_name, component_type, component_name):
cs = dmd.Devices.componentSearch
for brain in cs(getParentDeviceName=device_name, meta_type=component_type):
component = brain.getObject()
if component.name() == component_name:
return component
grail = getComponentQuickly('mydevice', 'IpInterface', 'eth0')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment