Make rpc_client method private for VolumeCommands

"rpc_client" is not sub-command and should not be in the help for
'cinder-manage volume' command.

Change-Id: Ie94554b3fade09e32269c96fcb4a7d2b91062119
Closes-Bug: #1498136
This commit is contained in:
Ivan Kolodyazhny 2015-09-21 21:51:35 +03:00
parent 52e5ed7253
commit 039767a1ef
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)