Beispiel #1
0
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import abc

import six

from oslo_cache import core
from oslo_config import cfg

from heat.common import cache

MEMOIZE_EXTENSIONS = core.get_memoization_decorator(
    conf=cfg.CONF,
    region=cache.get_cache_region(),
    group="service_extension_cache")

MEMOIZE_FINDER = core.get_memoization_decorator(
    conf=cfg.CONF,
    region=cache.get_cache_region(),
    group="resource_finder_cache")


@six.add_metaclass(abc.ABCMeta)
class ExtensionMixin(object):
    def __init__(self, *args, **kwargs):
        super(ExtensionMixin, self).__init__(*args, **kwargs)
        self._extensions = None

    @abc.abstractmethod
Beispiel #2
0
from oslo_cache import core
from oslo_config import cfg
from oslo_log import log
from oslo_utils import reflection
from oslo_utils import strutils
import six

from heat.common import cache
from heat.common import exception
from heat.common.i18n import _
from heat.engine import resources

# decorator that allows to cache the value
# of the function based on input arguments
MEMOIZE = core.get_memoization_decorator(conf=cfg.CONF,
                                         region=cache.get_cache_region(),
                                         group="constraint_validation_cache")

LOG = log.getLogger(__name__)


class Schema(collections.Mapping):
    """Schema base class for validating properties or parameters.

    Schema objects are serializable to dictionaries following a superset of
    the HOT input Parameter schema using dict().

    Serialises to JSON in the form::

        {
            'type': 'list',