Merge "Make rpc_client method private for VolumeCommands"

This commit is contained in:
Jenkins 2015-09-23 04:31:59 +00:00 committed by Gerrit Code Review
commit fcb1188207
2 changed files with 3 additions and 3 deletions

View File

@ -268,7 +268,7 @@ class VolumeCommands(object):
def __init__(self):
self._client = None
def rpc_client(self):
def _rpc_client(self):
if self._client is None:
if not rpc.initialized():
rpc.init(CONF)
@ -297,7 +297,7 @@ class VolumeCommands(object):
print(_("Detach volume from instance and then try again."))
return
cctxt = self.rpc_client().prepare(server=host)
cctxt = self._rpc_client().prepare(server=host)
cctxt.cast(ctxt, "delete_volume", volume_id=volume['id'])
@args('--currenthost', required=True, help='Existing volume host name')

View File

@ -428,7 +428,7 @@ class TestCinderManageCmd(test.TestCase):
mock_rpc_client = get_client.return_value
volume_cmds = cinder_manage.VolumeCommands()
rpc_client = volume_cmds.rpc_client()
rpc_client = volume_cmds._rpc_client()
rpc_initialized.assert_called_once_with()
rpc_init.assert_called_once_with(CONF)