From e91f6dffc5628c76d942426789e0eccd4f0b582b Mon Sep 17 00:00:00 2001 From: terryyao Date: Mon, 26 May 2014 16:52:55 +0800 Subject: [PATCH] Fix the multiple regions issue in common client We need to supply the region_name while creating the various openstack clients in the common client code, then the client will work well with the multiple regions. Closes-Bug: #1323172 Change-Id: Idb30739b84d3813dd970f735b5789c564eb0759d --- common-powervc/powervc/common/client/service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common-powervc/powervc/common/client/service.py b/common-powervc/powervc/common/client/service.py index 7b7e732..69571ff 100644 --- a/common-powervc/powervc/common/client/service.py +++ b/common-powervc/powervc/common/client/service.py @@ -68,11 +68,13 @@ class AbstractService(object): return version def _init_std_client(self): + region_name = self.base_args.get('region_name', None) return self._patch(self.clazz(self.base_args['username'], self.base_args['password'], self.base_args['tenant_name'], self.base_args['auth_url'], self.base_args['insecure'], + region_name=region_name, cacert=self.base_args['cacert'])) def new_client(self, client_extension=None, *extension_args): @@ -158,6 +160,7 @@ class NeutronService(AbstractService): super(NeutronService, self).__init__(*kargs) def new_client(self, client_extension=None, *extension_args): + region_name = self.base_args.get('region_name', None) return self._extend(self._patch(self.clazz( username=self.base_args['username'], tenant_name=self.base_args['tenant_name'], @@ -165,6 +168,7 @@ class NeutronService(AbstractService): auth_url=self.base_args['auth_url'], endpoint_url=self.management_url, insecure=self.base_args['insecure'], + region_name=region_name, token=self.keystone.auth_token, ca_cert=self.base_args['cacert'])), client_extension, *extension_args)