diff --git a/SoftLayer/CLI/hardware/create_options.py b/SoftLayer/CLI/hardware/create_options.py index 7d104d877..646d37c09 100644 --- a/SoftLayer/CLI/hardware/create_options.py +++ b/SoftLayer/CLI/hardware/create_options.py @@ -21,7 +21,7 @@ def cli(env, prices, location=None): hardware_manager = hardware.HardwareManager(env.client) account_manager = account.AccountManager(env.client) options = hardware_manager.get_create_options(location) - routers = account_manager.get_routers(location) + routers = account_manager.get_routers(location=location) tables = [] # Datacenters diff --git a/SoftLayer/managers/account.py b/SoftLayer/managers/account.py index d9814b1ce..e6337e716 100644 --- a/SoftLayer/managers/account.py +++ b/SoftLayer/managers/account.py @@ -277,7 +277,7 @@ def get_account_all_billing_orders(self, limit=100, mask=None): return self.client.call('Billing_Order', 'getAllObjects', limit=limit, mask=mask) - def get_routers(self, mask=None, location=None): + def get_routers(self, location=None, mask=None): """Gets all the routers currently active on the account :param string mask: Object Mask diff --git a/tests/managers/account_tests.py b/tests/managers/account_tests.py index 26b5dadff..6d515de38 100644 --- a/tests/managers/account_tests.py +++ b/tests/managers/account_tests.py @@ -161,3 +161,8 @@ def test_get_active_account_licenses(self): def test_get_active_virtual_licenses(self): self.manager.get_active_virtual_licenses() self.assert_called_with("SoftLayer_Account", "getActiveVirtualLicenses") + + def test_get_routers_with_datacenter(self): + self.manager.get_routers(location='dal13') + object_filter = {'routers': {'topLevelLocation': {'name': {'operation': 'dal13'}}}} + self.assert_called_with("SoftLayer_Account", "getRouters", filter=object_filter)