Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
dmapi / usr / lib / python2.7 / dist-packages / dmapi / objects / service.py
Size: Mime:
# Copyright 2018 TrilioData Inc.
# All Rights Reserved.

from oslo_log import log as logging
from oslo_utils import versionutils

from dmapi import exception
from dmapi.i18n import _LW
#from dmapi import objects



LOG = logging.getLogger(__name__)


# NOTE(danms): This is the global service version counter
SERVICE_VERSION = 15

SERVICE_VERSION_HISTORY = (

    {'compute_rpc': '4.13'},
)


# TODO(berrange): Remove ContegoObjectDictCompat
#@base.ContegoObjectRegistry.register
class Service():

    # Version 1.20: Added get_minimum_version_multi()
    VERSION = '1.20'


    _MIN_VERSION_CACHE = {}
    _SERVICE_VERSION_CACHING = False
    SERVICE_VERSION = 2

    def __init__(self, *args, **kwargs):
        # NOTE(danms): We're going against the rules here and overriding
        # init. The reason is that we want to *ensure* that we're always
        # setting the current service version on our objects, overriding
        # whatever else might be set in the database, or otherwise (which
        # is the normal reason not to override init).
        #
        # We also need to do this here so that it's set on the client side
        # all the time, such that create() and save() operations will
        # include the current service version.
        if 'version' in kwargs:
            raise exception.ObjectActionError(
                action='init',
                reason='Version field is immutable')

        #super(Service, self).__init__(*args, **kwargs)
        self.version = SERVICE_VERSION