def add_upstart(name, content):
    if name.endswith(".conf"):
        name = name[:-5]

    upstart_file = "/etc/init/%s.conf" % name

    with ctx.sudo():
        with ctx.unpatched_state():
            file.write(upstart_file, content)
dataset/ETHPy150Open michaelcontento/revolver/revolver/service.py/add_upstart/original