# Path: conjureup/errors.py
# class MessageException(Exception):
# class BootstrapError(Exception):
# class BootstrapInterrupt(BootstrapError):
# class ControllerNotFoundException(Exception):
# class DeploymentFailure(Exception):
# class JujuBinaryNotFound(Exception):
# class AppConfigAttributeError(Exception):
# class MAASConfigError(Exception):
# class SchemaError(MessageException):
# class SchemaCloudError(SchemaError):
# class SchemaCredentialError(SchemaError):
# class LXDError(MessageException):
# class LXDBinaryNotFoundError(LXDError):
# class LXDCompatibilityError(LXDError):
# class LXDParseError(LXDCompatibilityError):
# class LXDNetworkError(LXDError):
# class LXDStorageError(LXDError):
#     def __init__(self, *args, **kwargs):
# 
# Path: conjureup/juju.py
# def _check_bin_candidates(candidates, bin_property):
# def set_bin_path():
# def set_wait_path():
# def read_config(name):
# def get_bootstrap_config(controller_name):
# def get_current_controller():
# def get_controller(id):
# def get_controller_in_cloud(cloud):
# async def model_available():
# async def connect_model():
# async def create_model():
# async def bootstrap(controller, cloud, model='conjure-up', credential=None):
#     def add_config(k, v):
# def has_jaas_auth():
# async def register_controller(name, endpoint, email, password, twofa,
#                               timeout=30, fail_cb=None, timeout_cb=None):
# def autoload_credentials():
# def get_credential(cloud, cred_name=None):
# def get_credentials():
# def get_regions(cloud):
# def get_clouds():
# def get_compatible_clouds(cloud_types=None):
# def _normalize_cloud_types(cloud_types):
# def get_cloud_types_by_name():
# def add_cloud(name, config):
# def get_cloud(name):
# def constraints_to_dict(constraints):
# def constraints_from_dict(cdict):
# def deploy(bundle):
# def get_controller_info(name=None):
# def get_controllers():
# def get_account(controller):
# def get_accounts():
# def get_model(controller, name):
# async def destroy_model(controller, model):
# def get_models(controller):
# def get_current_model():
# def version():
# async def wait_for_deployment(retries=3):
# 
# Path: conjureup/app_config.py
# class AppConfig:
#     def __setattr__(self, name, value):
#     def _internal_state_key(self):
#     def all_steps(self):
#     def has_bundle_modifications(self):
#     async def save(self):
#     async def restore(self):


from conjureup import errors, juju
from conjureup.app_config import app
""" MAAS module for configuring endpoint
"""



def setup_maas():
    maascreds = juju.get_credential(app.provider.cloud,
                                    app.provider.credential)
    if not maascreds:
        raise errors.MAASConfigError(
            "Could not find MAAS credentials for cloud: {}".format(
                app.provider.cloud))
    try:
        endpoint = juju.get_cloud(app.provider.cloud).get('endpoint', None)

# Path: conjureup/errors.py
# class MessageException(Exception):
# class BootstrapError(Exception):
# class BootstrapInterrupt(BootstrapError):
# class ControllerNotFoundException(Exception):
# class DeploymentFailure(Exception):
# class JujuBinaryNotFound(Exception):
# class AppConfigAttributeError(Exception):
# class MAASConfigError(Exception):
# class SchemaError(MessageException):
# class SchemaCloudError(SchemaError):
# class SchemaCredentialError(SchemaError):
# class LXDError(MessageException):
# class LXDBinaryNotFoundError(LXDError):
# class LXDCompatibilityError(LXDError):
# class LXDParseError(LXDCompatibilityError):
# class LXDNetworkError(LXDError):
# class LXDStorageError(LXDError):
#     def __init__(self, *args, **kwargs):
# 
# Path: conjureup/juju.py
# def _check_bin_candidates(candidates, bin_property):
# def set_bin_path():
# def set_wait_path():
# def read_config(name):
# def get_bootstrap_config(controller_name):
# def get_current_controller():
# def get_controller(id):
# def get_controller_in_cloud(cloud):
# async def model_available():
# async def connect_model():
# async def create_model():
# async def bootstrap(controller, cloud, model='conjure-up', credential=None):
#     def add_config(k, v):
# def has_jaas_auth():
# async def register_controller(name, endpoint, email, password, twofa,
#                               timeout=30, fail_cb=None, timeout_cb=None):
# def autoload_credentials():
# def get_credential(cloud, cred_name=None):
# def get_credentials():
# def get_regions(cloud):
# def get_clouds():
# def get_compatible_clouds(cloud_types=None):
# def _normalize_cloud_types(cloud_types):
# def get_cloud_types_by_name():
# def add_cloud(name, config):
# def get_cloud(name):
# def constraints_to_dict(constraints):
# def constraints_from_dict(cdict):
# def deploy(bundle):
# def get_controller_info(name=None):
# def get_controllers():
# def get_account(controller):
# def get_accounts():
# def get_model(controller, name):
# async def destroy_model(controller, model):
# def get_models(controller):
# def get_current_model():
# def version():
# async def wait_for_deployment(retries=3):
# 
# Path: conjureup/app_config.py
# class AppConfig:
#     def __setattr__(self, name, value):
#     def _internal_state_key(self):
#     def all_steps(self):
#     def has_bundle_modifications(self):
#     async def save(self):
#     async def restore(self):


# Path: conjureup/maas.py
from conjureup import errors, juju
from conjureup.app_config import app

""" MAAS module for configuring endpoint
"""



def setup_maas():
    maascreds = juju.get_credential(app.provider.cloud,
                                    app.provider.credential)
    if not maascreds:
        raise errors.MAASConfigError(
            "Could not find MAAS credentials for cloud: {}".format(
                app.provider.cloud))
    try:
        endpoint = juju.get_cloud(app.provider.cloud).get('endpoint', None)

        app.log.debug(