def update_and_restart_celery():

    require('path')
    require('celeryd')
    require('unit')
    require('deployment_type')
    if env.celeryd:
        celeryd_path = os.path.join(env.root_dir, env.celeryd)
        celeryd_remote_path = (
                '/etc/init.d/celeryd-%(unit)s_%(deployment_type)s' % env)
        upload_template(celeryd_path, celeryd_remote_path, env, use_sudo=True)

        # Wipe the -B option so it only happens once
        env.celeryd_beat_option = ""

        chmod(celeryd_remote_path, 'u+x')
        sudo(celeryd_remote_path + ' restart')
Render a celeryd init.d script template and upload it to the remote
dataset/ETHPy150Open bueda/ops/buedafab/celery.py/update_and_restart_celery