'Get a list of all the devices with an IP attached in the namespace.
@param name: if it\'s not None, only a device with that matching name
will be returned.'

def get_devices_with_ip(self, name=None, scope=None, to=None, filters=None, ip_version=None):

    options = ([ip_version] if ip_version else [])
    args = ['show']
    if name:
        args += [name]
    if filters:
        args += filters
    if scope:
        args += ['scope', scope]
    if to:
        args += ['to', to]
    retval = []
    for line in self._run(options, tuple(args)).split('\n'):
        line = line.strip()
        match = DEVICE_NAME_PATTERN.search(line)
        if match:
            device_name = remove_interface_suffix(match.group(2))
            continue
        elif (not line.startswith('inet')):
            continue
        parts = line.split('    ')
        if (parts[0] == 'inet6'):
            scope = parts[3]
        elif (parts[2] == 'brd'):
            scope = parts[5]
        else:
            scope = parts[3]
        retval.append(dict(name=device_name, cidr=parts[1], scope=scope, dynamic=('dynamic' == parts[(-1)]), tentative=('tentative' in line), dadfailed=('dadfailed' == parts[(-1)])))
    return retval
