From dafe048f2f36d221242036c159271d7544ad39e3 Mon Sep 17 00:00:00 2001 From: "zhangchunlong1@huawei.com" Date: Tue, 23 Sep 2014 16:18:50 +0800 Subject: [PATCH] check the configuration eqlx_cli_max_retries we need to to check the value of the configuration item eqlx_cli_max_retries in the code in order to ensure the "eqlx_cli_max_retries" is equal to or greater than 0 DocImpact: The 'retries' is not a configured number of attempts Change-Id: If9fadda83a855b4bbda6129d3b3a64d296eb2b54 Closes-Bug: #1372454 --- cinder/volume/drivers/eqlx.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cinder/volume/drivers/eqlx.py b/cinder/volume/drivers/eqlx.py index f7fbf1625..635ce3dff 100644 --- a/cinder/volume/drivers/eqlx.py +++ b/cinder/volume/drivers/eqlx.py @@ -217,9 +217,16 @@ class DellEQLSanISCSIDriver(SanISCSIDriver): with excutils.save_and_reraise_exception(): LOG.error(_("Error running SSH command: %s") % command) + def check_for_setup_error(self): + super(DellEQLSanISCSIDriver, self).check_for_setup_error() + if self.configuration.eqlx_cli_max_retries < 0: + raise exception.InvalidInput( + reason=_("eqlx_cli_max_retries must be greater than or " + "equal to 0")) + def _eql_execute(self, *args, **kwargs): return self._run_ssh( - args, attempts=self.configuration.eqlx_cli_max_retries) + args, attempts=self.configuration.eqlx_cli_max_retries + 1) def _get_volume_data(self, lines): prefix = 'iSCSI target name is ' -- 2.45.2