Skip to content

Commit 49e38ef

Browse files
author
anasouma
committed
Additional Fixes
1 parent ee0f287 commit 49e38ef

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

SoftLayer/CLI/modules/loadbal.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def execute(self, args):
251251
if args['--really'] or confirm("This action will cancel a load "
252252
"balancer. Continue?"):
253253
mgr.cancel_lb(loadbal_id)
254-
return 'Load Balancer with id %s is being cancelled!' % loadbal_id
254+
return 'Load Balancer with id %s is being cancelled!' % input_id
255255
else:
256256
raise CLIAbort('Aborted.')
257257

@@ -260,7 +260,7 @@ class LoadBalancerServiceDelete(CLIRunnable):
260260
"""
261261
usage: sl loadbal service-delete <identifier> [options]
262262
263-
Cancels an existing load_balancer service
263+
Deletes an existing load_balancer service
264264
Options:
265265
--really Whether to skip the confirmation prompt
266266
@@ -402,7 +402,7 @@ class LoadBalancerServiceGroupDelete(CLIRunnable):
402402
"""
403403
usage: sl loadbal group-delete <identifier> [options]
404404
405-
Cancels an existing load_balancer service group
405+
Deletes an existing load_balancer service group
406406
Options:
407407
--really Whether to skip the confirmation prompt
408408
@@ -430,8 +430,8 @@ class LoadBalancerServiceGroupEdit(CLIRunnable):
430430
usage: sl loadbal group-edit <identifier> [options]
431431
432432
Edits an existing load_balancer service group
433-
Required:
434-
--allocation=ALLOC Change the allocated number of connections
433+
Options:
434+
--allocation=ALLOC Change the allocated % of connections
435435
--port=PORT Change the port
436436
--routing_type=TYPE Change the port routing type
437437
--routing_method=METHOD Change the routing method
@@ -446,6 +446,12 @@ def execute(self, args):
446446
key_value = input_id.split(':')
447447
loadbal_id = int(key_value[0])
448448
group_id = int(key_value[1])
449+
450+
# check if any input is provided
451+
if not (args['--allocation'] or args['--port']
452+
or args['--routing_type'] or args['--routing_method']):
453+
return 'At least one property is required to be changed!'
454+
449455
routing_type = args.get('--routing_type')
450456
routing_method = args.get('--routing_method')
451457

@@ -500,9 +506,6 @@ def execute(self, args):
500506
input_id = args.get('<identifier>')
501507
key_value = input_id.split(':')
502508

503-
if key_value[0] != 'local':
504-
return 'This CLI is only valid for local load balancers'
505-
506509
loadbal_id = int(key_value[1])
507510

508511
mgr.add_service_group(loadbal_id,
@@ -520,12 +523,10 @@ class LoadBalancerCreate(CLIRunnable):
520523
521524
Adds a load_balancer given the billing id returned from create-options
522525
523-
Required:
526+
Options:
524527
-d, --datacenter=DC Datacenter shortname (sng01, dal05, ...)
525528
Note: Omitting this value defaults to the first
526529
available datacenter
527-
528-
Options:
529530
--really Whether to skip the confirmation prompt
530531
"""
531532
action = 'create'

0 commit comments

Comments
 (0)