Skip to content

Commit f71eb2b

Browse files
author
anasouma
committed
Add tests
1 parent 785b344 commit f71eb2b

2 files changed

Lines changed: 58 additions & 4 deletions

File tree

SoftLayer/managers/load_balancer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ def edit_service_group(self, loadbal_id, group_id, allocation=-1, port=0,
289289
:param int routing_method: The routing method to set on the group
290290
"""
291291
kwargs = NestedDict({})
292-
kwargs['mask'] = 'mask[virtualServers[serviceGroups' \
293-
'[services[groupReferences]]]]'
292+
kwargs['mask'] = ('mask[virtualServers[serviceGroups'
293+
'[services[groupReferences]]]]')
294294

295295
load_balancer = self.lb_svc.getObject(id=loadbal_id, **kwargs)
296296
virtual_servers = load_balancer['virtualServers']
@@ -305,9 +305,10 @@ def edit_service_group(self, loadbal_id, group_id, allocation=-1, port=0,
305305
service_group['routingTypeId'] = routing_type
306306
if routing_method != 0:
307307
service_group['routingMethodId'] = routing_method
308+
break
308309
return self.lb_svc.editObject(load_balancer, id=loadbal_id)
309310

310-
def reset_service_group(self, loadbal_id, group_id=None):
311+
def reset_service_group(self, loadbal_id, group_id):
311312
""" Resets all the connections on the service group
312313
:param int loadbal_id: The id of the loadbal
313314
:param int group_id: The id of the service group to reset

SoftLayer/tests/fixtures/Network_Application_Delivery_Controller_LoadBalancer_VirtualIpAddress.py

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,58 @@
11
getBillingItem = {'id': 21370814 }
2-
getObject = {}
2+
getObject = {
3+
'accountId': 307608,
4+
'connectionLimit': 500,
5+
'connectionLimitUnits': "connections/second",
6+
'dedicatedFlag': False,
7+
'highAvailabilityFlag': False,
8+
'id': 22348,
9+
'ipAddressId': 7303278,
10+
'managedResourceFlag': False,
11+
'sslActiveFlag': False,
12+
'sslEnabledFlag': True,
13+
'virtualServers': [
14+
{
15+
'allocation': 10,
16+
'id': 50718,
17+
'port': 80,
18+
"serviceGroups": [
19+
{
20+
'id': 51758,
21+
'routingMethodId': 10,
22+
'routingTypeId': 3,
23+
'services': [
24+
{
25+
'enabled': 1,
26+
'id': 1234,
27+
'healthChecks': [
28+
{
29+
'id': 112112
30+
}
31+
],
32+
'groupReferences': [
33+
{
34+
'serviceGroupId': 51758,
35+
'serviceId': 84986,
36+
'weight': 2
37+
}
38+
],
39+
'ipAddressId': 14288108,
40+
'port': 8080,
41+
'status': "DOWN"
42+
}
43+
]
44+
}
45+
],
46+
"virtualIpAddress": {
47+
'accountId': 307608,
48+
'connectionLimit': 500,
49+
'connectionLimitUnits': "connections/second",
50+
'id': 22348,
51+
'ipAddressId': 7303278,
52+
},
53+
'virtualIpAddressId': 22348
54+
}
55+
]}
356
getVirtualServers = [
457
{
558
"allocation": 10,

0 commit comments

Comments
 (0)