def _unmanage_status(module, kwargs): result = None try: with connection_object(module, kwargs) as con: result = unmanage(con, None, None, kwargs.get('jobid')) except Exception as err: module.fail_json(msg="Error getting info abt jobid" + str(err)) return result
def _unmanage_endpoint(module, kwargs): global __changed__ result = None try: with connection_object(module, kwargs) as con: result = unmanage(con, 'device', kwargs.get('endpoint_ip'), kwargs.get('force'), None) __changed__ = True except Exception as err: module.fail_json(msg=" Fail to unmanage the endpoint" + str(err)) return result