Merge "Delete deprecated old-style client access"
This commit is contained in:
commit
064cc2daa2
|
@ -11,8 +11,6 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import warnings
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import importutils
|
||||
|
@ -79,54 +77,6 @@ class OpenStackClients(object):
|
|||
# auth_token expiry (e.g trust_id or username/password)
|
||||
return self.client('keystone').auth_token
|
||||
|
||||
def keystone(self):
|
||||
warnings.warn('keystone() is deprecated. '
|
||||
'Replace with calls to client("keystone")')
|
||||
return self.client('keystone')
|
||||
|
||||
def url_for(self, **kwargs):
|
||||
return self.client('keystone').url_for(**kwargs)
|
||||
|
||||
def nova(self):
|
||||
warnings.warn('nova() is deprecated. '
|
||||
'Replace with calls to client("nova")')
|
||||
return self.client('nova')
|
||||
|
||||
def swift(self):
|
||||
warnings.warn('swift() is deprecated. '
|
||||
'Replace with calls to client("swift")')
|
||||
return self.client('swift')
|
||||
|
||||
def glance(self):
|
||||
warnings.warn('glance() is deprecated. '
|
||||
'Replace with calls to client("glance")')
|
||||
return self.client('glance')
|
||||
|
||||
def neutron(self):
|
||||
warnings.warn('neutron() is deprecated. '
|
||||
'Replace with calls to client("neutron")')
|
||||
return self.client('neutron')
|
||||
|
||||
def cinder(self):
|
||||
warnings.warn('cinder() is deprecated. '
|
||||
'Replace with calls to client("cinder")')
|
||||
return self.client('cinder')
|
||||
|
||||
def trove(self):
|
||||
warnings.warn('trove() is deprecated. '
|
||||
'Replace with calls to client("trove")')
|
||||
return self.client('trove')
|
||||
|
||||
def ceilometer(self):
|
||||
warnings.warn('ceilometer() is deprecated. '
|
||||
'Replace with calls to client("ceilometer")')
|
||||
return self.client('ceilometer')
|
||||
|
||||
def heat(self):
|
||||
warnings.warn('heat() is deprecated. '
|
||||
'Replace with calls to client("heat")')
|
||||
return self.client('heat')
|
||||
|
||||
|
||||
class ClientBackend(object):
|
||||
'''Delay choosing the backend client module until the client's class needs
|
||||
|
|
|
@ -116,7 +116,7 @@ class RemoteStack(resource.Resource):
|
|||
|
||||
def heat(self):
|
||||
# A convenience method overriding Resource.heat()
|
||||
return self._context().clients.heat()
|
||||
return self._context().clients.client("heat")
|
||||
|
||||
def client_plugin(self):
|
||||
# A convenience method overriding Resource.client_plugin()
|
||||
|
|
|
@ -106,7 +106,7 @@ class FakeClients(object):
|
|||
self.hc = None
|
||||
self.plugin = None
|
||||
|
||||
def heat(self):
|
||||
def client(self, name):
|
||||
if self.region_name in ['RegionOne', 'RegionTwo']:
|
||||
if self.hc is None:
|
||||
self.hc = mock.MagicMock()
|
||||
|
@ -147,7 +147,7 @@ class RemoteStackTest(tests_common.HeatTestCase):
|
|||
def initialize(self):
|
||||
parent, rsrc = self.create_parent_stack(remote_region='RegionTwo')
|
||||
self.parent = parent
|
||||
self.heat = rsrc._context().clients.heat()
|
||||
self.heat = rsrc._context().clients.client("heat")
|
||||
self.client_plugin = rsrc._context().clients.client_plugin('heat')
|
||||
|
||||
def create_parent_stack(self, remote_region=None, custom_template=None):
|
||||
|
@ -270,7 +270,7 @@ class RemoteStackTest(tests_common.HeatTestCase):
|
|||
|
||||
# not setting or using self.heat because this test case is a special
|
||||
# one with the RemoteStack resource initialized but not created.
|
||||
heat = rsrc._context().clients.heat()
|
||||
heat = rsrc._context().clients.client("heat")
|
||||
|
||||
# heatclient.exc.BadRequest is the exception returned by a failed
|
||||
# validation
|
||||
|
|
Loading…
Reference in New Issue