mock.call.getVolume(self.VOLUME_3PAR_NAME),
mock.call.getCPG(HP3PAR_CPG),
mock.call.getHost(self.FAKE_HOST),
- mock.ANY,
+ mock.call.queryHost(wwns=['123456789012345',
+ '123456789054321']),
mock.call.getHost(self.FAKE_HOST),
mock.call.getPorts(),
mock.call.createVLUN(
mock.call.getVolume('osv-0DM4qZEVSKON-DXN-NwVpw'),
mock.call.getCPG(HP3PAR_CPG),
mock.call.getHost(self.FAKE_HOST),
- mock.call.queryHost(['123456789012345', '123456789054321']),
+ mock.call.queryHost(wwns=['123456789012345',
+ '123456789054321']),
mock.call.createHost(
self.FAKE_HOST,
FCWwns=['123456789012345', '123456789054321'],
mock.call.getVolume('osv-0DM4qZEVSKON-DXN-NwVpw'),
mock.call.getCPG(HP3PAR_CPG),
mock.call.getHost('fakehost'),
- mock.call.queryHost(['123456789012345', '123456789054321']),
+ mock.call.queryHost(wwns=['123456789012345',
+ '123456789054321']),
mock.call.getHost('fakehost.foo')]
mock_client.assert_has_calls(expected)
mock_client.getHost.side_effect = [
hpexceptions.HTTPNotFound('fake'),
{'name': self.FAKE_HOST}]
- mock_client.findHost.return_value = self.FAKE_HOST
+ mock_client.queryHost.return_value = {
+ 'members': [{
+ 'name': self.FAKE_HOST
+ }]
+ }
mock_client.getHostVLUNs.return_value = [
{'active': True,
'volumeName': self.VOLUME_3PAR_NAME,
mock.call.getVolume(self.VOLUME_3PAR_NAME),
mock.call.getCPG(HP3PAR_CPG),
mock.call.getHost(self.FAKE_HOST),
- mock.call.findHost(iqn='iqn.1993-08.org.debian:01:222'),
+ mock.call.queryHost(iqns=['iqn.1993-08.org.debian:01:222']),
mock.call.getHost(self.FAKE_HOST),
mock.call.createVLUN(
self.VOLUME_3PAR_NAME,
mock_client.getHost.side_effect = [
hpexceptions.HTTPNotFound('fake'),
{'name': self.FAKE_HOST}]
- mock_client.findHost.return_value = None
+ mock_client.queryHost.return_value = None
mock_client.getVLUN.return_value = {'lun': self.TARGET_LUN}
with mock.patch.object(hpcommon.HP3PARCommon, '_create_client')\
mock.call.getVolume('osv-0DM4qZEVSKON-DXN-NwVpw'),
mock.call.getCPG(HP3PAR_CPG),
mock.call.getHost(self.FAKE_HOST),
- mock.call.findHost(iqn='iqn.1993-08.org.debian:01:222'),
+ mock.call.queryHost(iqns=['iqn.1993-08.org.debian:01:222']),
mock.call.createHost(
self.FAKE_HOST,
optional={'domain': None, 'persona': 2},
mock_client.getHost.side_effect = [
hpexceptions.HTTPNotFound('fake'),
{'name': self.FAKE_HOST}]
- mock_client.findHost.return_value = None
+ mock_client.queryHost.return_value = None
mock_client.getVLUN.return_value = {'lun': self.TARGET_LUN}
expected_mod_request = {
mock.call.getVolumeMetaData(
'osv-0DM4qZEVSKON-DXN-NwVpw', CHAP_PASS_KEY),
mock.call.getHost(self.FAKE_HOST),
- mock.call.findHost(iqn='iqn.1993-08.org.debian:01:222'),
+ mock.call.queryHost(iqns=['iqn.1993-08.org.debian:01:222']),
mock.call.createHost(
self.FAKE_HOST,
optional={'domain': None, 'persona': 2},
mock_client.getHost.side_effect = [
hpexceptions.HTTPNotFound('Host not found.'),
{'name': 'fakehost.foo'}]
- mock_client.findHost.return_value = 'fakehost.foo'
+ mock_client.queryHost.return_value = {
+ 'members': [{
+ 'name': 'fakehost.foo'
+ }]
+ }
with mock.patch.object(hpcommon.HP3PARCommon, '_create_client')\
as mock_create_client:
mock.call.getVolume('osv-0DM4qZEVSKON-DXN-NwVpw'),
mock.call.getCPG(HP3PAR_CPG),
mock.call.getHost(self.FAKE_HOST),
- mock.call.findHost(iqn='iqn.1993-08.org.debian:01:222'),
+ mock.call.queryHost(iqns=['iqn.1993-08.org.debian:01:222']),
mock.call.getHost('fakehost.foo')]
mock_client.assert_has_calls(expected)
mock_client.getHost.side_effect = [
hpexceptions.HTTPNotFound('Host not found.'),
{'name': 'fakehost.foo'}]
- mock_client.findHost.return_value = 'fakehost.foo'
+ mock_client.queryHost.return_value = {
+ 'members': [{
+ 'name': 'fakehost.foo'
+ }]
+ }
def get_side_effect(*args):
data = {'value': None}
mock.call.getVolumeMetaData(
'osv-0DM4qZEVSKON-DXN-NwVpw', CHAP_PASS_KEY),
mock.call.getHost(self.FAKE_HOST),
- mock.call.findHost(iqn='iqn.1993-08.org.debian:01:222'),
+ mock.call.queryHost(iqns=['iqn.1993-08.org.debian:01:222']),
mock.call.modifyHost(
'fakehost.foo',
expected_mod_request),