def get_parent_by_name(yaml, ifname):
    """Returns the sub-interface's parent, or None,None if the sub-int doesn't exist."""
    if not ifname:
        return None, None

    try:
        parent_ifname, subid = ifname.split(".")
        subid = int(subid)
        iface = yaml["interfaces"][parent_ifname]
        return parent_ifname, iface
    except KeyError:
        pass
    except ValueError:
        pass
    return None, None