Merge "[NetApp] Fix iSCSI CHAP auth issue during volume attach"

This commit is contained in:
Zuul 2022-06-28 21:41:17 +00:00 committed by Gerrit Code Review
commit ed6bef65b9
3 changed files with 13 additions and 5 deletions

View File

@ -508,9 +508,10 @@ class SSHUtilTests(test.TestCase):
self.sshutil.execute_command, ssh, 'ls')
wait_on_stdout.assert_not_called()
@ddt.data('Password:',
'Password: ',
'Password: \n\n')
@ddt.data(b'Password:',
b'Password: ',
b'Password: \n\n',
b'Fake response \r\n Password: \n\n')
def test_execute_command_with_prompt(self, response):
ssh = mock.Mock(paramiko.SSHClient)
stdin, stdout, stderr = self._mock_ssh_channel_files(paramiko.Channel)
@ -533,7 +534,7 @@ class SSHUtilTests(test.TestCase):
ssh = mock.Mock(paramiko.SSHClient)
stdin, stdout, stderr = self._mock_ssh_channel_files(paramiko.Channel)
stdout_read = self.mock_object(stdout.channel, 'recv',
return_value='bad response')
return_value=b'bad response')
self.mock_object(ssh, 'exec_command',
return_value=(stdin, stdout, stderr))

View File

@ -596,7 +596,7 @@ class SSHUtil(object):
stdin, stdout, stderr = client.exec_command(command)
self._wait_on_stdout(stdout, timeout)
response = stdout.channel.recv(999)
if response.strip() != expected_prompt_text:
if expected_prompt_text not in response.strip().decode():
msg = _("Unexpected output. Expected [%(expected)s] but "
"received [%(output)s]") % {
'expected': expected_prompt_text,

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixed a CHAP authentication issue while trying to attach an iSCSI volume
using the NetApp ONTAP driver. Please refer to the
`Launchpad bug #1914639 <https://bugs.launchpad.net/cinder/+bug/1914639>`_
for more details.