def amqp_departed():
    if not units("amqp"):
        remove_metadata()
        remove_contrail_api()
        config["amqp-ready"] = False
    amqp_relation()
def neutron_metadata_departed():
    if not units("neutron-metadata"):
        remove_metadata()
        config["neutron-metadata-ready"] = False
def zookeeper_departed():
    if not units("zookeeper"):
        remove_metadata()
        remove_contrail_api()
        config["zookeeper-ready"] = False
    zookeeper_relation()
def cassandra_departed():
    if not units("cassandra"):
        remove_metadata()
        remove_contrail_api()
        config["cassandra-ready"] = False
    cassandra_relation()
def identity_admin_departed():
    if not units("identity-admin"):
        remove_metadata()
        remove_contrail_api()
        config["identity-admin-ready"] = False
    identity_admin_relation()
def zookeeper_departed():
    if not units("zookeeper"):
        remove_metadata()
        remove_contrail_api()
        config["zookeeper-ready"] = False
    zookeeper_relation()
def neutron_metadata_departed():
    if not units("neutron-metadata"):
        remove_metadata()
        config["neutron-metadata-ready"] = False
def identity_admin_departed():
    if not units("identity-admin"):
        remove_metadata()
        remove_contrail_api()
        config["identity-admin-ready"] = False
    identity_admin_relation()
def cassandra_departed():
    if not units("cassandra"):
        remove_metadata()
        remove_contrail_api()
        config["cassandra-ready"] = False
    cassandra_relation()
def amqp_departed():
    if not units("amqp"):
        remove_metadata()
        remove_contrail_api()
        config["amqp-ready"] = False
    amqp_relation()