Skip to content

Commit

Permalink
Merge "Fix bug with 3PAR host entry in wrong domain"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Mar 27, 2013
2 parents 04f880d + 3a20db0 commit ebe6c93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cinder/exception.py
Expand Up @@ -474,6 +474,10 @@ class Duplicate3PARHost(CinderException):
message = _("3PAR Host already exists: %(err)s. %(info)s")


class Invalid3PARDomain(CinderException):
message = _("Invalid 3PAR Domain: %(err)s")


class VolumeTypeCreateFailed(CinderException):
message = _("Cannot create volume_type with "
"name %(name)s and specs %(extra_specs)s")
Expand Down
7 changes: 6 additions & 1 deletion cinder/volume/drivers/san/hp/hp_3par_common.py
Expand Up @@ -272,7 +272,12 @@ def _delete_3par_host(self, hostname):
self._cli_run('removehost %s' % hostname, None)

def _create_3par_vlun(self, volume, hostname):
self._cli_run('createvlun %s auto %s' % (volume, hostname), None)
out = self._cli_run('createvlun %s auto %s' % (volume, hostname), None)
if out and len(out) > 1:
if "must be in the same domain" in out[0]:
err = out[0].strip()
err = err + " " + out[1].strip()
raise exception.Invalid3PARDomain(err=err)

def _safe_hostname(self, hostname):
"""
Expand Down

0 comments on commit ebe6c93

Please sign in to comment.