summaryrefslogtreecommitdiff
path: root/glance_store/_drivers
diff options
context:
space:
mode:
authorAdam Zhang <adamz@vmware.com>2019-07-31 09:32:37 +0800
committerAdam Zhang <adamz@vmware.com>2019-08-02 15:34:11 +0800
commit72b46d176c6e101d3d1181b98d7d43d312e4dfbf (patch)
treeec84f1bcdf8d43f5828938184061732d1e41dcba /glance_store/_drivers
parent5d86e1a5c25725dde288082ce45e7c2c55ae747f (diff)
downloadglance_store-72b46d176c6e101d3d1181b98d7d43d312e4dfbf.tar.gz
Fix option load for swift/vmware
There is a small problem in _option_get function, it has problem dealing with boolean parameters with False value, such as 0, False. It will rasie exception for missing options. Fix the issue by changing the condition from "not result" to "result is None" which is true indication for missing options. Change-Id: I313aa9f8d583c9cf44b052685b0f26824d2b6ade
Diffstat (limited to 'glance_store/_drivers')
-rw-r--r--glance_store/_drivers/swift/store.py2
-rw-r--r--glance_store/_drivers/vmware_datastore.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/glance_store/_drivers/swift/store.py b/glance_store/_drivers/swift/store.py
index d7a324e..dda5a08 100644
--- a/glance_store/_drivers/swift/store.py
+++ b/glance_store/_drivers/swift/store.py
@@ -886,7 +886,7 @@ class BaseStore(driver.Store):
else:
result = getattr(self.conf.glance_store, param)
- if not result:
+ if result is None:
reason = (_("Could not find %(param)s in configuration options.")
% param)
LOG.error(reason)
diff --git a/glance_store/_drivers/vmware_datastore.py b/glance_store/_drivers/vmware_datastore.py
index 07a3abb..08b3c4a 100644
--- a/glance_store/_drivers/vmware_datastore.py
+++ b/glance_store/_drivers/vmware_datastore.py
@@ -554,7 +554,7 @@ class Store(glance_store.Store):
store_conf = self.conf.glance_store
result = getattr(store_conf, param)
- if not result:
+ if result is None:
reason = (_("Could not find %(param)s in configuration "
"options.") % {'param': param})
raise exceptions.BadStoreConfiguration(