summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Diaz <diazjf@us.ibm.com>2015-09-24 21:48:43 -0500
committerFernando Diaz <diazjf@us.ibm.com>2015-09-28 11:22:40 -0500
commit776187d9f4b01a237e517efe8db78214fac59401 (patch)
treec1eca3fa51450c2e21ac15e575a1b68435646702
parent97cc46ac2804e7679237e41a88b1183d98dac619 (diff)
downloadpython-barbicanclient-776187d9f4b01a237e517efe8db78214fac59401.tar.gz
Fix error where barbican order create returns invalid error
When performing barbican order create we obtain the error that: 'NoneType' object has no attribute 'lower'. This patch fixes that. Closes-Bug: #1481996 Change-Id: If09c72eae731e40b6055ba8ef062b0cd4536e48a
-rw-r--r--barbicanclient/orders.py8
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):
"""