Skip to content

Commit c59be99

Browse files
Merge pull request #1329 from allmightyspiff/issues972
Allow for calling BluemixPages and IntegratedOfferingTeam_Region services
2 parents 582dbe9 + 90eafce commit c59be99

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

SoftLayer/API.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ def authenticate_with_password(self, username, password,
162162
:param string username: your SoftLayer username
163163
:param string password: your SoftLayer password
164164
:param int security_question_id: The security question id to answer
165-
:param string security_question_answer: The answer to the security
166-
question
165+
:param string security_question_answer: The answer to the security question
167166
168167
"""
169168
self.auth = None
@@ -202,8 +201,7 @@ def call(self, service, method, *args, **kwargs):
202201
:param dict raw_headers: (optional) HTTP transport headers
203202
:param int limit: (optional) return at most this many results
204203
:param int offset: (optional) offset results by this many
205-
:param boolean iter: (optional) if True, returns a generator with the
206-
results
204+
:param boolean iter: (optional) if True, returns a generator with the results
207205
:param bool verify: verify SSL cert
208206
:param cert: client certificate path
209207
@@ -224,7 +222,8 @@ def call(self, service, method, *args, **kwargs):
224222
raise TypeError(
225223
'Invalid keyword arguments: %s' % ','.join(invalid_kwargs))
226224

227-
if self._prefix and not service.startswith(self._prefix):
225+
prefixes = (self._prefix, 'BluePages_Search', 'IntegratedOfferingTeam_Region')
226+
if self._prefix and not service.startswith(prefixes):
228227
service = self._prefix + service
229228

230229
http_headers = {'Accept': '*/*'}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
findBluePagesProfile = True

tests/api_tests.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ def test_call_compression_override(self):
259259
headers = calls[0].transport_headers
260260
self.assertEqual(headers.get('accept-encoding'), 'gzip')
261261

262+
def test_special_services(self):
263+
# Tests for the special classes that don't need to start with SoftLayer_
264+
self.client.call('BluePages_Search', 'findBluePagesProfile')
265+
self.assert_called_with('BluePages_Search', 'findBluePagesProfile')
266+
262267

263268
class UnauthenticatedAPIClient(testing.TestCase):
264269
def set_up(self):

0 commit comments

Comments
 (0)