Skip to content

Commit

Permalink
Ensure volume exists before deleting.
Browse files Browse the repository at this point in the history
fixes bug 1130744

Change-Id: I39152dd1caa5ab1b2cfbae56eaec8c8fa309669c
  • Loading branch information
hub-cap committed Feb 20, 2013
1 parent d5ac3cb commit 34284b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cinder/volume/drivers/san/hp_lefthand.py
Expand Up @@ -220,8 +220,11 @@ def delete_volume(self, volume):
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")
Expand Down

0 comments on commit 34284b7

Please sign in to comment.