From: Kurt Martin <kurt.f.martin@hp.com>
Date: Thu, 22 Aug 2013 16:28:37 +0000 (-0700)
Subject: 3PAR driver add missing domain check on QOS cmd
X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=27a9ed5ace86e8d6aabc564f4a364d9b45b5124f;p=openstack-build%2Fcinder-build.git

3PAR driver add missing domain check on QOS cmd

The 3PAR drivers need to support CPGs that are not part of a
virtual domain on the 3PAR backend. This patch now checks
if the domain is set before calling the createvvset command.
This instance was overlooked in the following patch that has
already been merged: https://review.openstack.org/#/c/42697/

Also fixes: bug 1212328

Change-Id: I0375dfc89104775582b9258f18f97c683e6148b1
---

diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py
index 9cce016bc..15350a28c 100644
--- a/cinder/volume/drivers/san/hp/hp_3par_common.py
+++ b/cinder/volume/drivers/san/hp/hp_3par_common.py
@@ -632,7 +632,10 @@ exit
         else:
             vvs_name = self._get_3par_vvs_name(volume['id'])
             domain = self.get_domain(cpg)
-            self._cli_run(['createvvset', '-domain', domain, vvs_name])
+            if domain is not None:
+                self._cli_run(['createvvset', '-domain', domain, vvs_name])
+            else:
+                self._cli_run(['createvvset', vvs_name])
             self._set_qos_rule(qos, vvs_name)
             self._cli_run(['createvvset', '-add', vvs_name, volume_name])