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
This commit is contained in:
Fernando Diaz 2015-09-24 21:48:43 -05:00
parent 97cc46ac28
commit 776187d9f4
1 changed files with 5 additions and 3 deletions

View File

@ -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):
"""