From ce8b5a3e6e687148cebfa3b160c779269ab73b8c Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 7 Oct 2014 10:29:26 -0500 Subject: [PATCH] Fix eqlx CLI output parsing on bad input The eqlx driver would identify CLI command completion by looking for the system name prompt at the end of the output ("ARRAY_NAME>"). In some cases where there is bad input the array will print an error, then prepopulate the command again so it can be edited, resulting in the output: "ARRAY_NAME> [bad command]" The array name prompt only gets printed on command completion, so the fix is to look for the prompt anywhere in the CLI output. Change-Id: I063a203c9746689ca8a42a97725b059f782e3812 Closes-Bug: 1378394 --- cinder/volume/drivers/eqlx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/volume/drivers/eqlx.py b/cinder/volume/drivers/eqlx.py index 81dfff021..cf3efc918 100644 --- a/cinder/volume/drivers/eqlx.py +++ b/cinder/volume/drivers/eqlx.py @@ -135,7 +135,7 @@ class DellEQLSanISCSIDriver(SanISCSIDriver): def _get_output(self, chan): out = '' ending = '%s> ' % self.configuration.eqlx_group_name - while not out.endswith(ending): + while out.find(ending) == -1: out += chan.recv(102400) LOG.debug("CLI output\n%s", out) -- 2.45.2