Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/softlayer/softlayer-python
Browse files Browse the repository at this point in the history
…into issues258
  • Loading branch information
allmightyspiff committed Apr 15, 2015
2 parents 489bba6 + 43b0b4e commit 5cd4b10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion SoftLayer/managers/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,13 @@ def get(self, name, param=None):
raise exceptions.SoftLayerError(
'Parameter required to get this attribute.')

params = tuple()
if param is not None:
params = (param,)
try:
return self.client.call('Resource_Metadata',
self.attribs[name]['call'],
param)
*params)
except exceptions.SoftLayerAPIError as ex:
if ex.faultCode == 404:
return None
Expand Down
3 changes: 2 additions & 1 deletion SoftLayer/tests/managers/metadata_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def test_no_param(self):

self.assertEqual('dal01', resp)
self.assert_called_with('SoftLayer_Resource_Metadata', 'Datacenter',
identifier=None)
identifier=None,
args=tuple())

def test_w_param(self):
resp = self.metadata.get('vlans', '1:2:3:4:5')
Expand Down

0 comments on commit 5cd4b10

Please sign in to comment.