def change_omsagent_protocol(configuration_path):
    '''
    Changing the omsagent protocol, since the protocol type is set on the omsagent
    configuration file
    :param configuration_path:
    '''
    try:
        # if opening this file failed the installation of the oms-agent has failed
        fin = open(configuration_path, "rt")
        with open("tmp.txt", "wt") as fout:
            for line in fin:
                if "protocol_type" in line and "udp" in line:
                    fout.write(line.replace("udp", "tcp"))
                    print_notice("Changing protocol type from udp to tcp in "+configuration_path)
                    print("Line changed: " + line)
                else:
                    fout.write(line)
    except IOError:
        print_error("Oms-agent installation has failed please remove oms-agent and try again.")
        return False
    command_tokens = ["sudo", "mv", "tmp.txt", configuration_path]
    write_new_content = subprocess.Popen(command_tokens, stdout=subprocess.PIPE)
    time.sleep(3)
    o, e = write_new_content.communicate()
    if e is not None:
        handle_error(e, error_response_str="Error: could not change omsagent configuration port in ." + configuration_path)
        return False
    # set read permissions to file after recreated with the move command
    set_file_read_permissions(configuration_path)
    print_ok("Omsagent configuration was changed to fit required protocol - " + configuration_path)
    return True

    Changing the omsagent protocol, since the protocol type is set on the omsagent
    configuration file
    :param configuration_path:
    
DataConnectors/CEF/cef_installer.py