当前位置: 首页>>代码示例>>Python>>正文


Python upgradecheck.Result方法代码示例

本文整理汇总了Python中oslo_upgradecheck.upgradecheck.Result方法的典型用法代码示例。如果您正苦于以下问题:Python upgradecheck.Result方法的具体用法?Python upgradecheck.Result怎么用?Python upgradecheck.Result使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在oslo_upgradecheck.upgradecheck的用法示例。


在下文中一共展示了upgradecheck.Result方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _numactl_check

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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) 
开发者ID:openstack,项目名称:zun,代码行数:12,代码来源:status.py

示例2: _sample_check

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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') 
开发者ID:openstack,项目名称:octavia,代码行数:8,代码来源:status.py

示例3: _check_placeholder

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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. 
开发者ID:openstack,项目名称:freezer-api,代码行数:14,代码来源:status.py

示例4: _duplicate_service_status

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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) 
开发者ID:openstack,项目名称:designate,代码行数:17,代码来源:status.py

示例5: _storage_version

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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) 
开发者ID:openstack,项目名称:cloudkitty,代码行数:10,代码来源:status.py

示例6: _minimum_nova_api_version

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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) 
开发者ID:openstack,项目名称:watcher,代码行数:10,代码来源:status.py

示例7: _check_healthpolicy

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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. 
开发者ID:openstack,项目名称:senlin,代码行数:39,代码来源:status.py

示例8: _check_placeholder

# 需要导入模块: from oslo_upgradecheck import upgradecheck [as 别名]
# 或者: from oslo_upgradecheck.upgradecheck import Result [as 别名]
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. 
开发者ID:openstack,项目名称:cyborg,代码行数:14,代码来源:status.py


注:本文中的oslo_upgradecheck.upgradecheck.Result方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。