Correct base class of no_conf driver

1. Fix wrong base class of no_conf store driver.
2. Enhance create_stores() to handle NotImplementedError case.

Change-Id: I0f38d101a994b3a3d0c7a10bdd2e936e026b407b
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
This commit is contained in:
Zhi Yan Liu 2014-09-12 12:41:16 +08:00
parent c7e2433d4b
commit 084f8e8d45
2 changed files with 7 additions and 3 deletions

View File

@ -185,8 +185,11 @@ def create_stores(conf=CONF):
store_count = 0
for (store_entry, store_instance) in _load_stores(conf):
schemes = store_instance.get_schemes()
store_instance.configure()
try:
schemes = store_instance.get_schemes()
store_instance.configure()
except NotImplementedError:
continue
if not schemes:
raise exceptions.BackendException('Unable to register store %s. '
'No schemes associated with it.'

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from glance_store import driver
from glance_store import exceptions
class UnconfigurableStore(base.Store):
class UnconfigurableStore(driver.Store):
def configure(self):
raise exceptions.BadStoreConfiguration()