From: Sean McGinnis Date: Tue, 7 Oct 2014 15:29:26 +0000 (-0500) Subject: Fix eqlx CLI output parsing on bad input X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ce8b5a3e6e687148cebfa3b160c779269ab73b8c;p=openstack-build%2Fcinder-build.git 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 --- 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)