8
from charmhelpers.core.hookenv import (
13
JENKINS_DAEMON = "/etc/init.d/jenkins"
15
logging.basicConfig(level=logging.INFO)
18
def log(msg, level=None):
19
# wrap log calls and distribute to correct logger
20
# depending if this code is being run by a hook
21
# or an external script.
22
if os.getenv('JUJU_AGENT_SOCKET'):
23
_log(msg, level=level)
28
# start jenkins application
31
subprocess.check_call([JENKINS_DAEMON, "start"])
36
# stop jenkins application
39
subprocess.check_call([JENKINS_DAEMON, "stop"])