From: Michael Basnight Date: Wed, 20 Feb 2013 16:12:03 +0000 (-0600) Subject: Ensure volume exists before deleting. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=34284b7eb98095d67f6c861d09c101ecd32cff96;p=openstack-build%2Fcinder-build.git Ensure volume exists before deleting. fixes bug 1130744 Change-Id: I39152dd1caa5ab1b2cfbae56eaec8c8fa309669c --- diff --git a/cinder/volume/drivers/san/hp_lefthand.py b/cinder/volume/drivers/san/hp_lefthand.py index 05a7c7de7..1ae1b030f 100644 --- a/cinder/volume/drivers/san/hp_lefthand.py +++ b/cinder/volume/drivers/san/hp_lefthand.py @@ -220,8 +220,11 @@ class HpSanISCSIDriver(SanISCSIDriver): cliq_args = {} cliq_args['volumeName'] = volume['name'] cliq_args['prompt'] = 'false' # Don't confirm - - self._cliq_run_xml("deleteVolume", cliq_args) + try: + volume_info = self._cliq_get_volume_info(volume['name']) + self._cliq_run_xml("deleteVolume", cliq_args) + except Exception: + LOG.exception("Volume did not exist. It will not be deleted") def local_path(self, volume): msg = _("local_path not supported")