Don't override brick's execute function
There was a custom_execute added into os-brick that takes additional parameters, and now if we just pass in putils.execute it blows up in places we call execute with the new parameters. Short term fix is to just pass in None by default which gives us the custom_execute, under the hood it just uses putils.execute anyway. Change-Id: If5d5fdcf140a557aa2b273e65c0fcdb64aa56f17
This commit is contained in:
@@ -16,7 +16,6 @@ import cinderclient
|
||||
from cinderclient import api_versions
|
||||
from cinderclient import exceptions
|
||||
from os_brick.initiator import connector
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_utils import uuidutils
|
||||
from pbr import version as pbr_version
|
||||
|
||||
@@ -56,7 +55,7 @@ class Client(object):
|
||||
self._use_legacy_attach = False
|
||||
|
||||
def _brick_get_connector(self, protocol, driver=None,
|
||||
execute=processutils.execute,
|
||||
execute=None,
|
||||
use_multipath=False,
|
||||
device_scan_attempts=3,
|
||||
*args, **kwargs):
|
||||
@@ -81,7 +80,7 @@ class Client(object):
|
||||
brick_utils.get_ip(nic),
|
||||
multipath=multipath,
|
||||
enforce_multipath=(enforce_multipath),
|
||||
execute=processutils.execute)
|
||||
execute=None)
|
||||
return conn_prop
|
||||
|
||||
def attach(self, volume_id, hostname, mountpoint=None, mode='rw',
|
||||
|
||||
@@ -53,12 +53,11 @@ class TestBrickClient(base.BaseTestCase):
|
||||
|
||||
return conn_props, mock_connect
|
||||
|
||||
@mock.patch('oslo_concurrency.processutils.execute')
|
||||
@mock.patch('brick_cinderclient_ext.brick_utils.get_my_ip')
|
||||
@mock.patch('brick_cinderclient_ext.brick_utils.get_root_helper')
|
||||
@mock.patch('os_brick.initiator.connector.get_connector_properties')
|
||||
def test_get_connector(self, mock_connector, mock_root_helper,
|
||||
mock_my_ip, mock_execute):
|
||||
mock_my_ip):
|
||||
mock_root_helper.return_value = 'root-helper'
|
||||
mock_my_ip.return_value = '1.0.0.0'
|
||||
|
||||
@@ -66,15 +65,13 @@ class TestBrickClient(base.BaseTestCase):
|
||||
mock_connector.assert_called_with('root-helper', '1.0.0.0',
|
||||
enforce_multipath=False,
|
||||
multipath=False,
|
||||
execute=mock_execute)
|
||||
execute=None)
|
||||
|
||||
@mock.patch('oslo_concurrency.processutils.execute')
|
||||
@mock.patch('brick_cinderclient_ext.brick_utils.get_my_ip')
|
||||
@mock.patch('brick_cinderclient_ext.brick_utils.get_root_helper')
|
||||
@mock.patch('os_brick.initiator.connector.get_connector_properties')
|
||||
def test_get_connector_with_multipath(self, mock_connector,
|
||||
mock_root_helper, mock_my_ip,
|
||||
mock_execute):
|
||||
mock_root_helper, mock_my_ip):
|
||||
mock_root_helper.return_value = 'root-helper'
|
||||
mock_my_ip.return_value = '1.0.0.0'
|
||||
|
||||
@@ -82,7 +79,7 @@ class TestBrickClient(base.BaseTestCase):
|
||||
mock_connector.assert_called_with('root-helper', '1.0.0.0',
|
||||
enforce_multipath=True,
|
||||
multipath=True,
|
||||
execute=mock_execute)
|
||||
execute=None)
|
||||
|
||||
def test_client_use_new_attach_no_volumes_client(self):
|
||||
brick_client = client.Client(None)
|
||||
|
||||
Reference in New Issue
Block a user