From e43ba189c67d48c9414770c54d63acb5759d822d Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Thu, 21 Jul 2016 12:29:37 +0200 Subject: [PATCH] RootController: Use an index method instead of get The index method authorizes HEAD request, which are handy for load balancers. Change-Id: Iab12c89641ffd725c3fb8a6e097020a696f84a97 --- cloudkitty/api/root.py | 2 +- cloudkitty/tests/gabbi/gabbits/root.yaml | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 cloudkitty/tests/gabbi/gabbits/root.yaml diff --git a/cloudkitty/api/root.py b/cloudkitty/api/root.py index df23ac38..90be9fa6 100644 --- a/cloudkitty/api/root.py +++ b/cloudkitty/api/root.py @@ -117,7 +117,7 @@ class RootController(rest.RestController): v1 = v1_api.V1Controller() @wsme_pecan.wsexpose([APIVersion]) - def get(self): + def index(self): """Return the version list """ diff --git a/cloudkitty/tests/gabbi/gabbits/root.yaml b/cloudkitty/tests/gabbi/gabbits/root.yaml new file mode 100644 index 00000000..960e88ee --- /dev/null +++ b/cloudkitty/tests/gabbi/gabbits/root.yaml @@ -0,0 +1,12 @@ +fixtures: + - ConfigFixture + +tests: + - name: test if / is publicly available + url: / + status: 200 + + - name: test if HEAD / is available + url: / + status: 200 + method: HEAD