Clean _get_cctxt method signatures

rpc.RPCAPI._get_cctxt method had unnecessary host argument.
volume.rpcapi.VolumeAPI._get_cctxt allowed to pass version
only by named attribute.

Change-Id: I105120661bb9043a351888463f35f7c8a6e08621
This commit is contained in:
Szymon Wroblewski 2016-10-31 05:20:12 -05:00 committed by Szymon Borkowski
parent aa2b615b05
commit 808038053f
2 changed files with 3 additions and 3 deletions

View File

@ -199,7 +199,7 @@ class RPCAPI(object):
return version
return versions[-1]
def _get_cctxt(self, host=None, version=None, **kwargs):
def _get_cctxt(self, version=None, **kwargs):
"""Prepare client context
Version parameter accepts single version string or tuple of strings.

View File

@ -117,10 +117,10 @@ class VolumeAPI(rpc.RPCAPI):
TOPIC = constants.VOLUME_TOPIC
BINARY = 'cinder-volume'
def _get_cctxt(self, host=None, **kwargs):
def _get_cctxt(self, host=None, version=None, **kwargs):
if host is not None:
kwargs['server'] = utils.get_volume_rpc_host(host)
return super(VolumeAPI, self)._get_cctxt(**kwargs)
return super(VolumeAPI, self)._get_cctxt(version, **kwargs)
def create_consistencygroup(self, ctxt, group, host):
cctxt = self._get_cctxt(host)