deb-murano/murano/dsl/package_loader.py
Stan Lagun 904cb248e4 Fix used package versions for stable inheritance
When an object from an object model is deserialized
on subsequent deployment it's version is usually
fixed in the object model. However the version of
base classes for that object is not as long as it meets
to the class requirements. Thus slightly different version
might be used on each deployment that does satisfies the
requirements but may have different internal state representation.

To solve this a list of all package versions that are in use by the
object model is written to the hidden section of the object model.
On the subsequent load package loader will prefer versions in the
list over newer versions available in the catalog at that time

Change-Id: I17087c0045210d28b87aba4d50c329f688df3954
Closes-Bug: #1602839
2016-07-26 20:59:36 -07:00

45 lines
1.2 KiB
Python

# Copyright (c) 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# 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
@six.add_metaclass(abc.ABCMeta)
class MuranoPackageLoader(object):
@abc.abstractmethod
def load_package(self, package_name, version_spec):
pass
@abc.abstractmethod
def load_class_package(self, class_name, version_spec):
pass
@abc.abstractmethod
def register_package(self, package):
pass
@abc.abstractmethod
def import_fixation_table(self, fixations):
pass
@abc.abstractmethod
def export_fixation_table(self):
pass
@abc.abstractmethod
def compact_fixation_table(self):
pass