def METHOD_NAME(name, machinename):
    """Update the machine name.
    Parameters
    ----------
    name : str
        Path of the configuration file.
    machinename : str
        New name of the machine.
    """
    with open(name) as fid:
        for line in fid:
            if "MachineName=" in line:
                old_machine = line.strip()
                new_line = line
    with open(name) as fid:
        new_line = fid.read().replace(old_machine, "MachineName='" + str(machinename) + "'")
    with open(name, "w") as f:
        f.write(new_line)