def ping(self): try: return Ping().search_json() except Exception as e: self.fail_json(msg="Failed to connect to Foreman server: %s " % e)
def ping_server(module): try: return Ping().search_json() except Exception as e: module.fail_json(msg="Failed to connect to Foreman server: %s " % e)
def ping(self): return Ping().search_json()