Apply changes according to the review

This commit is contained in:
Etienne CARRIERE 2015-11-18 06:09:28 +01:00 committed by Matt Clay
parent 292e0a2275
commit 824d57e852

View file

@ -253,10 +253,10 @@ def set_snat(api,name,snat):
current_state=get_snat_type(api,name)
if snat is None:
return updated
if snat == 'None' and current_state != 'SRC_TRANS_NONE':
elif snat == 'None' and current_state != 'SRC_TRANS_NONE':
api.LocalLB.VirtualServer.set_source_address_translation_none(virtual_servers = [name])
updated = True
if snat == 'Automap' and current_state != 'SRC_TRANS_AUTOMAP':
elif snat == 'Automap' and current_state != 'SRC_TRANS_AUTOMAP':
api.LocalLB.VirtualServer.set_source_address_translation_automap(virtual_servers = [name])
updated = True
return updated
@ -409,8 +409,8 @@ def main():
module.fail_json(msg="both destination and port must be supplied to create a VS")
if not module.check_mode:
# a bit of a hack to handle concurrent runs of this module.
# even though we've checked the pool doesn't exist,
# it may exist by the time we run create_pool().
# even though we've checked the virtual_server doesn't exist,
# it may exist by the time we run virtual_server().
# this catches the exception and does something smart
# about it!
try: