Ejemplo n.º 1
0
    def test_migration_version(self):
        """Make sure the data migration version info has been updated."""

        release_number = int(version_info.version_string().split('.', 1)[0])

        # by rule, release names must be composed of the 26 letters of the
        # ISO Latin alphabet (ord('A')==65, ord('Z')==90)
        release_letter = six.text_type(CURRENT_RELEASE[:1].upper()).encode(
            'ascii')

        # Convert release letter into an int in [1:26].  The first
        # glance release was 'Bexar'.
        converted_release_letter = (ord(release_letter) -
                                    ord(u'B'.encode('ascii')) + 1)

        # Project the release number into [1:26]
        converted_release_number = release_number % 26

        # Prepare for the worst with a super-informative message
        msg = ('\n\n'
               'EMERGENCY!\n'
               'glance.db.migration.CURRENT_RELEASE is out of sync '
               'with the glance version.\n'
               '  CURRENT_RELEASE: %s\n'
               '  glance version: %s\n'
               'glance.db.migration.CURRENT_RELEASE needs to be '
               'updated IMMEDIATELY.\n'
               'The gate will be wedged until the update is made.\n'
               'EMERGENCY!\n'
               '\n') % (CURRENT_RELEASE,
                        version_info.version_string())

        self.assertEqual(converted_release_letter,
                         converted_release_number,
                         msg)
Ejemplo n.º 2
0
    def test_migration_version(self):
        """Make sure the data migration version info has been updated."""

        release_number = int(version_info.version_string().split('.', 1)[0])

        # by rule, release names must be composed of the 26 letters of the
        # ISO Latin alphabet (ord('A')==65, ord('Z')==90)
        release_letter = six.text_type(
            CURRENT_RELEASE[:1].upper()).encode('ascii')

        # Convert release letter into an int in [1:26].  The first
        # glance release was 'Bexar'.
        converted_release_letter = (ord(release_letter) -
                                    ord(u'B'.encode('ascii')) + 1)

        # Project the release number into [1:26]
        converted_release_number = release_number % 26

        # Prepare for the worst with a super-informative message
        msg = ('\n\n'
               'EMERGENCY!\n'
               'glance.db.migration.CURRENT_RELEASE is out of sync '
               'with the glance version.\n'
               '  CURRENT_RELEASE: %s\n'
               '  glance version: %s\n'
               'glance.db.migration.CURRENT_RELEASE needs to be '
               'updated IMMEDIATELY.\n'
               'The gate will be wedged until the update is made.\n'
               'EMERGENCY!\n'
               '\n') % (CURRENT_RELEASE, version_info.version_string())

        self.assertEqual(converted_release_letter, converted_release_number,
                         msg)
Ejemplo n.º 3
0
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'Image Service API Reference'
copyright = u'2010-present, OpenStack Foundation'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from glance.version import version_info
# The full version, including alpha/beta/rc tags.
release = version_info.release_string()
# The short X.Y version.
version = version_info.version_string()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'

# The reST default role (used for this markup: `text`) to use
# for all documents.
# default_role = None