# Path: revolver/contextmanager.py
# def sudo(username=None, login=False):
# def unpatched_state():
# 
# Path: revolver/core.py
# VERSION = '0.0.5'
# def put(*args, **kwargs):
# def run(*args, **kwargs):
# def sudo(*args, **kwargs):
# 
# Path: revolver/file.py
# def temp(mode=None, owner=None, group=None):
# def remove(location, recursive=False, force=True):
# def touch(location, mode=None, owner=None, group=None):
# def copy(source, destination, force=True, mode=None, owner=None, group=None):


from revolver import contextmanager as ctx
from revolver import core, file
# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, with_statement



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():

# Path: revolver/contextmanager.py
# def sudo(username=None, login=False):
# def unpatched_state():
# 
# Path: revolver/core.py
# VERSION = '0.0.5'
# def put(*args, **kwargs):
# def run(*args, **kwargs):
# def sudo(*args, **kwargs):
# 
# Path: revolver/file.py
# def temp(mode=None, owner=None, group=None):
# def remove(location, recursive=False, force=True):
# def touch(location, mode=None, owner=None, group=None):
# def copy(source, destination, force=True, mode=None, owner=None, group=None):


# Path: revolver/service.py
from revolver import contextmanager as ctx
from revolver import core, file

# -*- coding: utf-8 -*-

from __future__ import absolute_import, division, with_statement



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)