Python oslo_upgradecheck.upgradecheck.Result() Examples

The following are 21 code examples of oslo_upgradecheck.upgradecheck.Result(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module oslo_upgradecheck.upgradecheck , or try the search function .
Example #1
Source File: status.py    From cloudkitty with Apache License 2.0 5 votes vote down vote up
def _storage_version(self):
        if CONF.storage.version < 2:
            return upgradecheck.Result(
                upgradecheck.Code.WARNING,
                'Storage version is inferior to 2. Support for v1 storage '
                'will be dropped in a future release.',
            )
        return upgradecheck.Result(upgradecheck.Code.SUCCESS) 
Example #2
Source File: status.py    From kuryr with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # This is just a placeholder for upgrade checks, it should be
        # removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #3
Source File: status.py    From karbor with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail') 
Example #4
Source File: status.py    From qinling with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail') 
Example #5
Source File: status.py    From aodh with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail') 
Example #6
Source File: status.py    From cyborg with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # TODO(whoami-rajat):This is just a placeholder for upgrade checks,
        # it should be removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #7
Source File: status.py    From senlin with Apache License 2.0 5 votes vote down vote up
def _check_healthpolicy(self):
        """Check if version 1.0 health policies exists

        Stein introduces health policy version 1.1 which is incompatible with
        health policy version 1.0.  Users are required to delete version 1.0
        health policies before upgrade and recreate them in version 1.1 format
        after upgrading.
        """

        engine = api.get_engine()
        metadata = MetaData(bind=engine)
        policy = Table('policy', metadata, autoload=True)

        healthpolicy_select = (
            select([column('name')])
            .select_from(policy)
            .where(column('type') == 'senlin.policy.health-1.0')
        )
        healthpolicy_rows = engine.execute(healthpolicy_select).fetchall()

        if not healthpolicy_rows:
            return upgradecheck.Result(upgradecheck.Code.SUCCESS)

        healthpolicy_names = [row[0] for row in healthpolicy_rows]
        error_msg = _('The following version 1.0 health policies must be '
                      'deleted before upgrade: \'{}\'. After upgrading, the '
                      'health policies can be recreated in version 1.1 '
                      'format.').format(', '.join(healthpolicy_names))
        return upgradecheck.Result(upgradecheck.Code.FAILURE, error_msg)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #8
Source File: status.py    From monasca-api with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # This is just a placeholder for upgrade checks, it should be
        # removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #9
Source File: status.py    From barbican with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # This is just a placeholder for upgrade checks, it should be
        # removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #10
Source File: status.py    From watcher with Apache License 2.0 5 votes vote down vote up
def _minimum_nova_api_version(self):
        """Checks the minimum required version of nova_client.api_version"""
        try:
            clients.check_min_nova_api_version(CONF.nova_client.api_version)
        except ValueError as e:
            return upgradecheck.Result(
                upgradecheck.Code.FAILURE, str(e))
        return upgradecheck.Result(upgradecheck.Code.SUCCESS) 
Example #11
Source File: status.py    From tacker with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail') 
Example #12
Source File: status.py    From zun with Apache License 2.0 5 votes vote down vote up
def _numactl_check(self):
        """This is a check for existence of numactl binary

        It needs to be removed after adding any real upgrade check
        """
        if self._cmd_exists('numactl'):
            return upgradecheck.Result(upgradecheck.Code.SUCCESS)
        else:
            msg = _("The program 'numactl' is currently not installed.")
            return upgradecheck.Result(upgradecheck.Code.FAILURE, msg) 
Example #13
Source File: status.py    From vitrage with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail') 
Example #14
Source File: status.py    From dragonflow with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # This is just a placeholder for upgrade checks, it should be
        # removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #15
Source File: status.py    From masakari with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail') 
Example #16
Source File: status.py    From manila with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # This is just a placeholder for upgrade checks, it should be
        # removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #17
Source File: status.py    From magnum with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail') 
Example #18
Source File: status.py    From searchlight with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # This is just a placeholder for upgrade checks, it should be
        # removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #19
Source File: status.py    From designate with Apache License 2.0 5 votes vote down vote up
def _duplicate_service_status(self):
        engine = session.get_engine('storage:sqlalchemy')
        metadata = MetaData(bind=engine)
        status = Table('service_statuses', metadata, autoload=True)
        service_select = (select([func.count()])
                          .select_from(status)
                          .group_by('service_name', 'hostname')
                          )
        service_counts = engine.execute(service_select).fetchall()
        duplicated_services = [i for i in service_counts if i[0] > 1]
        if duplicated_services:
            return upgradecheck.Result(upgradecheck.Code.FAILURE,
                                       _('Duplicated services found in '
                                         'service_statuses table.'))
        return upgradecheck.Result(upgradecheck.Code.SUCCESS) 
Example #20
Source File: status.py    From freezer-api with Apache License 2.0 5 votes vote down vote up
def _check_placeholder(self):
        # This is just a placeholder for upgrade checks, it should be
        # removed when the actual checks are added
        return upgradecheck.Result(upgradecheck.Code.SUCCESS)

    # The format of the check functions is to return an
    # oslo_upgradecheck.upgradecheck.Result
    # object with the appropriate
    # oslo_upgradecheck.upgradecheck.Code and details set.
    # If the check hits warnings or failures then those should be stored
    # in the returned Result's "details" attribute. The
    # summary will be rolled up at the end of the check() method. 
Example #21
Source File: status.py    From octavia with Apache License 2.0 5 votes vote down vote up
def _sample_check(self):
        """This is sample check added to test the upgrade check framework

        It needs to be removed after adding any real upgrade check
        """
        return upgradecheck.Result(upgradecheck.Code.SUCCESS, 'Sample detail')