Merge "Make rpc_client method private for VolumeCommands"
This commit is contained in:
commit
fcb1188207
@ -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')
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user