From 45e22e45a5f9619bc53871847512a93cedb22347 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Fri, 31 Jan 2020 14:28:34 -0600 Subject: [PATCH] [Keystone] Fix status code logic This patch set fixes an issue with where the keystone chart's domain-manage job/pod always restart once due to a calculation logic error. Change-Id: I801d04559a526d3a7339cd5102f2e738af9f72e0 Signed-off-by: Tin Lam --- keystone/templates/bin/_domain-manage.py.tpl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keystone/templates/bin/_domain-manage.py.tpl b/keystone/templates/bin/_domain-manage.py.tpl index c77ed20b85..24a982047f 100644 --- a/keystone/templates/bin/_domain-manage.py.tpl +++ b/keystone/templates/bin/_domain-manage.py.tpl @@ -46,7 +46,8 @@ def main(args): print("Response code on action [%s]: %s" % (action, response.status_code)) - if (int(response.status_code) / 100) != 2: + # Put and Patch can return 200 or 201. If it is not a 2XX code, error out. + if (response.status_code // 100) != 2: sys.exit(1) if __name__ == "__main__":