Skip to content

Commit b2bb7c9

Browse files
Removing exception when calling SoftLayer_Account without an id
1 parent 0afedfa commit b2bb7c9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

SoftLayer/API.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,7 @@ def refresh_token(self, userId, auth_token):
751751

752752
def call(self, service, method, *args, **kwargs):
753753
"""Handles refreshing Employee tokens in case of a HTTP 401 error"""
754-
if (service == 'SoftLayer_Account' or service == 'Account') and not kwargs.get('id'):
755-
if not self.account_id:
756-
raise exceptions.SoftLayerError("SoftLayer_Account service requires an ID")
754+
if self.account_id:
757755
kwargs['id'] = self.account_id
758756

759757
try:
@@ -763,6 +761,7 @@ def call(self, service, method, *args, **kwargs):
763761
userId = self.settings['softlayer'].get('userid')
764762
access_token = self.settings['softlayer'].get('access_token')
765763
LOGGER.warning("Token has expired, trying to refresh. %s", ex.faultString)
764+
print("Token has expired, trying to refresh. %s", ex.faultString)
766765
self.refresh_token(userId, access_token)
767766
# Try the Call again this time....
768767
return BaseClient.call(self, service, method, *args, **kwargs)

0 commit comments

Comments
 (0)