Python源码示例:oslo.Result()

示例1
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) 
示例2
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') 
示例3
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. 
示例4
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) 
示例5
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. 
示例6
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') 
示例7
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. 
示例8
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') 
示例9
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. 
示例10
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') 
示例11
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) 
示例12
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') 
示例13
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) 
示例14
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. 
示例15
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. 
示例16
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. 
示例17
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. 
示例18
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') 
示例19
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') 
示例20
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') 
示例21
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.