# Path: deckhand/context.py
# CONF = cfg.CONF
# class RequestContext(context.RequestContext):
#     def __init__(self, project=None, **kwargs):
#     def to_dict(self):
#     def from_dict(cls, values):
# def get_context():


import yaml
import falcon
from oslo_log import log as logging
from deckhand import context

        try:
            if expect_list:
                data = list(yaml.safe_load_all(raw_data))
            else:
                data = yaml.safe_load(raw_data)
        except yaml.YAMLError as e:
            error_msg = ("The request body must be properly formatted YAML. "
                         "Details: %s." % e)
            LOG.error(error_msg)
            raise falcon.HTTPBadRequest(description=error_msg)

        if expect_list:
            bad_entries = [str(i + 1) for i, x in enumerate(data)
                           if not x or not isinstance(x, dict)]
            if bad_entries:
                error_msg = (
                    "Expected a list of valid objects. Invalid entries "
                    "found at following indexes: %s." % ','.join(bad_entries))
                LOG.error(error_msg)
                raise falcon.HTTPBadRequest(description=error_msg)

        return data


class DeckhandRequest(falcon.Request):
    context_type = context.RequestContext

    @property
    def project_id(self):

# Path: deckhand/context.py
# CONF = cfg.CONF
# class RequestContext(context.RequestContext):
#     def __init__(self, project=None, **kwargs):
#     def to_dict(self):
#     def from_dict(cls, values):
# def get_context():


# Path: deckhand/control/base.py
import yaml
import falcon
from oslo_log import log as logging
from deckhand import context


        try:
            if expect_list:
                data = list(yaml.safe_load_all(raw_data))
            else:
                data = yaml.safe_load(raw_data)
        except yaml.YAMLError as e:
            error_msg = ("The request body must be properly formatted YAML. "
                         "Details: %s." % e)
            LOG.error(error_msg)
            raise falcon.HTTPBadRequest(description=error_msg)

        if expect_list:
            bad_entries = [str(i + 1) for i, x in enumerate(data)
                           if not x or not isinstance(x, dict)]
            if bad_entries:
                error_msg = (
                    "Expected a list of valid objects. Invalid entries "
                    "found at following indexes: %s." % ','.join(bad_entries))
                LOG.error(error_msg)
                raise falcon.HTTPBadRequest(description=error_msg)

        return data


class DeckhandRequest(falcon.Request):
    context_type = context.RequestContext

    @property
    def project_id(self):

        return self.context.tenant