From ca63f2a4e4b85ff04448ddd12568b8831f0d4709 Mon Sep 17 00:00:00 2001 From: Simon de Haan Date: Mon, 13 Jul 2015 21:16:05 +0200 Subject: [PATCH] use the service id to identify services --- consular/main.py | 2 +- consular/tests/test_main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/consular/main.py b/consular/main.py index 3f663d8..79c5569 100644 --- a/consular/main.py +++ b/consular/main.py @@ -135,7 +135,7 @@ def update_task_running(self, request, event): def update_task_killed(self, request, event): d = self.consul_request('PUT', '/v1/agent/service/deregister/%s' % ( - get_appid(event),)) + event['taskId'],)) d.addCallback(lambda _: json.dumps({'status': 'ok'})) return d diff --git a/consular/tests/test_main.py b/consular/tests/test_main.py index 28f988a..62f2d97 100644 --- a/consular/tests/test_main.py +++ b/consular/tests/test_main.py @@ -141,7 +141,7 @@ def test_TASK_RUNNING(self): self.assertEqual(request['path'], '/v1/agent/service/register') self.assertEqual(request['data'], { 'Name': 'my-app', - 'taskId': 'my-app_0-1396592784349', + 'ID': 'my-app_0-1396592784349', 'Address': 'slave-1234.acme.org', 'Port': 31372, })