# Path: conjureup/utils.py
# def run(cmd, **kwargs):
#     """ Compatibility function to support python 3.4
#     """
#     try:
#         from subprocess import run as _run
#         return _run(cmd, **kwargs)
#     except ImportError:
#         if 'check' in kwargs:
#             del kwargs['check']
#             return check_call(cmd, **kwargs)
#         else:
#             return check_output(cmd, **kwargs)
# 
# Path: conjureup/hooklib/writer.py
# CACHEDIR = os.getenv('CONJURE_UP_CACHEDIR',
#                      os.path.expanduser('~/.cache/conjure-up'))
# SPELL_NAME = os.getenv('CONJURE_UP_SPELL', '_unspecified_spell')
# LOGFILE = os.path.join(CACHEDIR, '{spell}.log'.format(spell=SPELL_NAME))
# def success(msg):
# def fail(msg):
# def error(msg):
# def info(msg):


import os
import time
import yaml
from subprocess import PIPE, CalledProcessError
from conjureup.utils import run
from .writer import fail, log, success




JUJU_CONTROLLER = os.environ['JUJU_CONTROLLER']
JUJU_MODEL = os.environ['JUJU_MODEL']
JUJU_CM_STR = "{}:{}".format(JUJU_CONTROLLER, JUJU_MODEL)


def status():
    """ Get juju status
    """
    try:

# Path: conjureup/utils.py
# def run(cmd, **kwargs):
#     """ Compatibility function to support python 3.4
#     """
#     try:
#         from subprocess import run as _run
#         return _run(cmd, **kwargs)
#     except ImportError:
#         if 'check' in kwargs:
#             del kwargs['check']
#             return check_call(cmd, **kwargs)
#         else:
#             return check_output(cmd, **kwargs)
# 
# Path: conjureup/hooklib/writer.py
# CACHEDIR = os.getenv('CONJURE_UP_CACHEDIR',
#                      os.path.expanduser('~/.cache/conjure-up'))
# SPELL_NAME = os.getenv('CONJURE_UP_SPELL', '_unspecified_spell')
# LOGFILE = os.path.join(CACHEDIR, '{spell}.log'.format(spell=SPELL_NAME))
# def success(msg):
# def fail(msg):
# def error(msg):
# def info(msg):


# Path: conjureup/hooklib/juju.py
import os
import time
import yaml
from subprocess import PIPE, CalledProcessError
from conjureup.utils import run
from .writer import fail, log, success





JUJU_CONTROLLER = os.environ['JUJU_CONTROLLER']
JUJU_MODEL = os.environ['JUJU_MODEL']
JUJU_CM_STR = "{}:{}".format(JUJU_CONTROLLER, JUJU_MODEL)


def status():
    """ Get juju status
    """
    try:

        sh = run(