def list_devices(ns, device_names=None):
    for s in sorted(ns.LMI_IPNetworkConnection.instances(),
                    key=lambda i: i.ElementName):
        if device_names:
            if s.ElementName in device_names:
                yield s
        else:
            yield s
Get a list of network devices.
dataset/ETHPy150Open openlmi/openlmi-scripts/commands/networking/lmi/scripts/networking/__init__.py/list_devices