]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Make rpc_client method private for VolumeCommands
authorIvan Kolodyazhny <e0ne@e0ne.info>
Mon, 21 Sep 2015 18:51:35 +0000 (21:51 +0300)
committerIvan Kolodyazhny <e0ne@e0ne.info>
Mon, 21 Sep 2015 20:27:04 +0000 (23:27 +0300)
"rpc_client" is not sub-command and should not be in the help for
'cinder-manage volume' command.

Change-Id: Ie94554b3fade09e32269c96fcb4a7d2b91062119
Closes-Bug: #1498136

cinder/cmd/manage.py
cinder/tests/unit/test_cmd.py

index be918fdc86b4f4c764e841111d5db2282cf6806a..cd5396c240ddfa47f9c168eeb99c32503cd83163 100644 (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')
index 8f0d4460226245ab3ea3f1241a960c121c0f1719..095000c1456283cccddd0cf66080f74261f03c57 100644 (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)