diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-10-04 11:21:51 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-10-04 11:21:51 +0000 |
commit | 3830d934e938f0b4c8676995b4e0cc20249f12f6 (patch) | |
tree | f844ceaafc3eb33af894050ffb37433f9e3065ba | |
parent | 68adf0cecf9b38bdb4972030e9dd72839aab95e2 (diff) | |
parent | 776187d9f4b01a237e517efe8db78214fac59401 (diff) | |
download | python-barbicanclient-3830d934e938f0b4c8676995b4e0cc20249f12f6.tar.gz |
Merge "Fix error where barbican order create returns invalid error"
-rw-r--r-- | barbicanclient/orders.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/barbicanclient/orders.py b/barbicanclient/orders.py index 360cbc1..8267005 100644 --- a/barbicanclient/orders.py +++ b/barbicanclient/orders.py @@ -416,12 +416,14 @@ class OrderManager(base.BaseEntityManager): raise TypeError('Unknown Order type "{0}"'.format(order_type)) def create(self, type=None, **kwargs): + if not type: + raise TypeError('No Order type provided') order_type = self._order_type_to_class_map.get(type.lower()) - if order_type is not None: - return order_type(self._api, **kwargs) - else: + if not order_type: raise TypeError('Unknown Order type "{0}"'.format(type)) + return order_type(self._api, **kwargs) + def create_key(self, name=None, algorithm=None, bit_length=None, mode=None, payload_content_type=None, expiration=None): """ |