Exemple #1
0
def deregister_services(container_id):
    services_dict = consul_query('agent/services')
    for service_id, service_dict in services_dict.items():
        if service_id.startswith(container_id):
            consul_get('agent/service/deregister/{service_id}'.format(**locals()))
            try:
                kv.kv_remove("start_timestamp/" + container_id)
            except Exception as e:
                get_logger().exception(e)
Exemple #2
0
def deregister_services(container_id):
    services_dict = consul_query('agent/services')
    for service_id, service_dict in services_dict.items():
        if service_id.startswith(container_id):
            consul_get('agent/service/deregister/{service_id}'.format(**locals()))
            try:
                kv.kv_remove("start_timestamp/" + container_id)
            except Exception as e:
                traceback.print_exc()
Exemple #3
0
def deregister_services(container_id):
    services_dict = consul_query('agent/services')
    for service_id, service_dict in services_dict.items():
        if service_id.startswith(container_id):
            consul_get('agent/service/deregister/{service_id}'.format(**locals()))
            try:
                kv.kv_remove("start_timestamp/" + container_id)
            except Exception as e:
                get_logger().exception(e)
            try:
                kv.kv_remove("single_active_instance/" + service_id)
            except Exception as e:
                get_logger().exception(e)