From 38bc513414f2f60f3ea5b3091865e10bd6ef6ccf Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Sun, 30 Aug 2015 19:34:56 +0200 Subject: [PATCH] Allow to pass the gnocchi enpoint via cli --- gnocchiclient/shell.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnocchiclient/shell.py b/gnocchiclient/shell.py index 11cdca1..16ba2d6 100644 --- a/gnocchiclient/shell.py +++ b/gnocchiclient/shell.py @@ -106,6 +106,14 @@ class GnocchiShell(app.App): ' Valid interface types: [admin, public, internal].' ' (Env: OS_INTERFACE)') + parser.add_argument( + '--endpoint', + metavar='', + dest='endpoint', + default=os.environ.get('GNOCCHI_ENDPOINT'), + help='The Gnocchi REST endpoint' + ' (Env: GNOCCHI_ENDPOINT)') + parser.add_argument('--timeout', default=600, type=_positive_non_zero_int, @@ -124,6 +132,7 @@ class GnocchiShell(app.App): # gnocchi use noauth self.client = client.Client(self.api_version, auth=self.auth_plugin, + endpoint=self.options.endpoint, region_name=self.options.region_name, interface=self.options.interface, verify=self.options.verify,