Skip to content

Commit 160e7a2

Browse files
Fixed filtering test
1 parent 0e1d28f commit 160e7a2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

SoftLayer/managers/hardware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def list_hardware(self, tags=None, cpus=None, memory=None, hostname=None,
169169
% (','.join(hw_items), ','.join(server_items)))
170170

171171
_filter = utils.NestedDict(kwargs.get('filter') or {})
172-
_filter['id'] = utils.query_filter_orderby()
172+
_filter['hardware']['id'] = utils.query_filter_orderby()
173173
if tags:
174174
_filter['hardware']['tagReferences']['tag']['name'] = {
175175
'operation': 'in',

tests/managers/hardware_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def test_list_hardware_with_filters(self):
5757
self.assertEqual(results, fixtures.SoftLayer_Account.getHardware)
5858
_filter = {
5959
'hardware': {
60+
'id': {'operation': 'orderBy', 'options': [{'name': 'sort', 'value': ['ASC']}]},
6061
'datacenter': {'name': {'operation': '_= dal05'}},
6162
'domain': {'operation': '_= example.com'},
6263
'tagReferences': {
@@ -73,8 +74,7 @@ def test_list_hardware_with_filters(self):
7374
'networkComponents': {'maxSpeed': {'operation': 100}},
7475
'primaryBackendIpAddress': {'operation': '_= 4.3.2.1'}}
7576
}
76-
self.assert_called_with('SoftLayer_Account', 'getHardware',
77-
filter=_filter)
77+
self.assert_called_with('SoftLayer_Account', 'getHardware', filter=_filter)
7878

7979
def test_resolve_ids_ip(self):
8080
_id = self.hardware._get_ids_from_ip('172.16.1.100')

0 commit comments

Comments
 (0)