Skip to content

Commit 97e0d92

Browse files
NeetujKevin McDonald
authored andcommitted
change argument name
1 parent 79e2c8d commit 97e0d92

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

SoftLayer/CLI/loadbal/service_add.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
@click.option('--healthcheck-type',
2525
required=True,
2626
help="The health check type")
27-
@click.option('--ip-address',
27+
@click.option('--ip',
2828
required=True,
2929
help="The IP of the service")
3030
@environment.pass_env
31-
def cli(env, identifier, enabled, port, weight, healthcheck_type, ip_address):
31+
def cli(env, identifier, enabled, port, weight, healthcheck_type, ip):
3232
"""Adds a new load balancer service."""
3333

3434
mgr = SoftLayer.LoadBalancerManager(env.client)
@@ -37,10 +37,11 @@ def cli(env, identifier, enabled, port, weight, healthcheck_type, ip_address):
3737

3838
# check if the IP is valid
3939
ip_address_id = None
40-
if ip_address:
40+
if ip:
4141
ip_service = env.client['Network_Subnet_IpAddress']
42-
ip_record = ip_service.getByIpAddress(ip_address)
43-
ip_address_id = ip_record['id']
42+
ip_record = ip_service.getByIpAddress(ip)
43+
if len(ip_record)>0:
44+
ip_address_id = ip_record['id']
4445

4546
mgr.add_service(loadbal_id,
4647
group_id,

0 commit comments

Comments
 (0)