def get_interface(node):
    """Get first interface, from parent if necessary"""
    if node.interfaces:
        return node.interfaces[0].type
    else:
        return list(node.type_definition.interfaces.keys())[0]