def do_state_change(client, module, service_proxy): if module.params['disabled']: log('Disabling service') result = service.disable(client, service_proxy.actual) else: log('Enabling service') result = service.enable(client, service_proxy.actual) return result
def change_state(self, client, lbv_name, svc_name) : try : if lbvserver_stats.get(client, lbv_name).state == "ENABLED": lbvserver.disable(client, lbv_name) else: lbvserver.enable(client, lbv_name) print("service result::state="+service.get(client, svc_name).svrstate) if service.get(client, svc_name).svrstate == "UP": service.disable(client, svc_name) else: service.enable(client, svc_name) print("change_state - Done") except nitro_exception as e : print("Exception::change_state::errorcode="+str(e.errorcode)+",message="+ e.message) except Exception as e: print("Exception::change_state::message="+str(e.args))