]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Create SolidFire Template account on init
authorJohn Griffith <john.griffith@solidfire.com>
Mon, 26 Jan 2015 22:21:30 +0000 (15:21 -0700)
committerJohn Griffith <john.griffith@solidfire.com>
Mon, 26 Jan 2015 23:00:43 +0000 (16:00 -0700)
The standard flow in the SolidFire volume is to create
accounts dynamically as needed based on project id.
Unfortunately the clone_image method "forgot" about this
detail and calls the private clone_volume method without
a valid account resulting in an AccountNotFound
Exception.

The clone_image method is enabled using a specific account
provided via the configuration file.  Rather than worry
about dynamic account creation on clone_image call, this
patch just makes it part of the init phase.  We check to
see if template caching is enabled and if it is, just
go ahead and check/create the account on startup.

Closes-Bug: #1414760

Change-Id: I62f3f7aff958c097ae662d21b2c0f55a8d08f784

cinder/volume/drivers/solidfire.py

index c824f3be73d331103a9f9c2223059418b594223a..bbe248dbaa5d1e7c2269a37d97d6c339b10eb874 100644 (file)
@@ -147,6 +147,9 @@ class SolidFireDriver(SanISCSIDriver):
             self._update_cluster_status()
         except exception.SolidFireAPIException:
             pass
+        if self.configuration.sf_allow_template_caching:
+            account = self.configuration.sf_template_account_name
+            self._create_sfaccount(account)
 
     def _build_endpoint_info(self, **kwargs):
         endpoint = {}