# Path: lab/config_v1.py
# class LabConfigError(Exception):
# class Error(Enum):
# class Loader(object):
# class Union(dict):
#     def __init__(self, name, kwargs):
#     def __call__(self):
#     def __init__(self, data, zone=None):
#     def __missing__(self, key):
# def load(config_path):
# def _parse_role(name, yaml, container, domain=None):
# def _parse_provider(name, yaml, container):
# def _parse_roles(roles, domain=None):
# def _parse_providers(providers):
# def _parse_common(yaml, domain=None):
# def _parse_zones(config):
# def _parse_environments(config):


from builtins import object
from lab import config_v1
    from . import hookspec
import importlib
import weakref
import pytest
#
# Copyright 2017 Sangoma Technologies Inc.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


class RoleNotFound(LookupError):
    pass


class Roles(object):
    def __init__(self, config):
        self.config = config
        self.data = None
        self.loaded = weakref.WeakValueDictionary()

        self.config.hook.pytest_lab_map.call_historic(
            kwargs=dict(config=self.config, roles=self)
        )

    def load(self, config, zone=None):

# Path: lab/config_v1.py
# class LabConfigError(Exception):
# class Error(Enum):
# class Loader(object):
# class Union(dict):
#     def __init__(self, name, kwargs):
#     def __call__(self):
#     def __init__(self, data, zone=None):
#     def __missing__(self, key):
# def load(config_path):
# def _parse_role(name, yaml, container, domain=None):
# def _parse_provider(name, yaml, container):
# def _parse_roles(roles, domain=None):
# def _parse_providers(providers):
# def _parse_common(yaml, domain=None):
# def _parse_zones(config):
# def _parse_environments(config):


# Path: pytest_lab/roles.py
from builtins import object
from lab import config_v1
    from . import hookspec
import importlib
import weakref
import pytest

#
# Copyright 2017 Sangoma Technologies Inc.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.


class RoleNotFound(LookupError):
    pass


class Roles(object):
    def __init__(self, config):
        self.config = config
        self.data = None
        self.loaded = weakref.WeakValueDictionary()

        self.config.hook.pytest_lab_map.call_historic(
            kwargs=dict(config=self.config, roles=self)
        )

    def load(self, config, zone=None):

        self.data = config_v1.Union(config, zone=zone)