From 3533b790cb43cd3ea3a6b3a013f80325a8e75b62 Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Wed, 20 May 2015 12:03:12 +0200 Subject: [PATCH] Update list of success return codes for PUT and DELETE --- helpers/etcd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/etcd.py b/helpers/etcd.py index 29552a2b..4ea9ba12 100644 --- a/helpers/etcd.py +++ b/helpers/etcd.py @@ -47,7 +47,7 @@ class Etcd: def put_client_path(self, path, **data): try: response = requests.put(self.client_url(path), data=data) - return response.status_code in [200, 201] + return response.status_code in [200, 201, 202, 204] except: logger.exception('PUT %s data=%s', path, data) return False @@ -55,7 +55,7 @@ class Etcd: def delete_client_path(self, path): try: response = requests.delete(self.client_url(path)) - return response.status_code == 204 + return response.status_code in [200, 202, 204] except: logger.exception('DELETE %s', path) return False