Skip to content

Commit 3acc5b9

Browse files
committed
1101 handle and raise another exception message when oftLayer_Exception_User_Customer_DelegateIamIdInvitationToPaas occurs
1 parent b00f68b commit 3acc5b9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

SoftLayer/managers/user.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,16 @@ def create_user(self, user_object, password):
243243
:param dictionary user_object: https://softlayer.github.io/reference/datatypes/SoftLayer_User_Customer/
244244
"""
245245
LOGGER.warning("Creating User %s", user_object['username'])
246-
return self.user_service.createObject(user_object, password, None)
246+
247+
try:
248+
return self.user_service.createObject(user_object, password, None)
249+
except exceptions.SoftLayerAPIError as err:
250+
if err.faultCode != "SoftLayer_Exception_User_Customer_DelegateIamIdInvitationToPaas":
251+
raise
252+
else:
253+
raise exceptions.SoftLayerError("Your request for a new user was received, but it needs to be "
254+
"processed by the Platform Services API first. Barring any errors on "
255+
"the Platform Services side, your new user should be created shortly.")
247256

248257
def edit_user(self, user_id, user_object):
249258
"""Blindly sends user_object to SoftLayer_User_Customer::editObject

0 commit comments

Comments
 (0)