Exemple #1
0
def get_support_info():
    support_info_filename = os.path.join(OUTPUT_FOLDER, SUPPORT_INFO_LOG_FILE)
    try:
        config = Config().values
        if config:
            api = WABizAPI(**config.get("webapp"))
            support_info_content = api.get_support_info()
        else:
            return
    except Exception:
        return

    docker_utils.write_to_file(support_info_filename,
                               json.dumps(support_info_content, indent=2))
    return support_info_filename
Exemple #2
0
def send_logs_to_fb(
    zipped_logs_file_handle, success_callback=None, failure_callback=None
):
    phone_number = None
    try:
        config = Config().values
        if config:
            api = WABizAPI(**config.get("webapp"))
            phone_number = api.get_phone_number()
    except Exception:
        pass

    try:
        run_id = Analytics.send_logs_to_fb(zipped_logs_file_handle, phone_number)

        if success_callback:
            return success_callback(run_id)
    except Exception as e:
        if failure_callback:
            return failure_callback(e)
Exemple #3
0
def send_results_to_fb(result, success_callback=None, failure_callback=None):
    phone_number = None
    try:
        config = Config().values
        if config:
            api = WABizAPI(**config.get("webapp"))
            phone_number = api.get_phone_number()
    except Exception:
        pass

    try:
        event = Events.RUN_ACTIONS_AND_SEND_RESULTS
        data = json.dumps(result)

        run_id = Analytics.send_event(event, data, phone_number)
        result["run_id"] = run_id

        if success_callback:
            success_callback(result)
    except Exception as e:
        if failure_callback:
            failure_callback(e)