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