def set_hostname(hostname, persist=True):
    """
    Set the hostname.
    """
    run_as_root('hostname %s' % hostname)
    if persist:
        run_as_root('echo %s >/etc/hostname' % hostname)
dataset/ETHPy150Open ronnix/fabtools/fabtools/system.py/set_hostname/original