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


Python utils.CompareOpenStackReleases方法代码示例

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


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

示例1: test_102_services

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import CompareOpenStackReleases [as 别名]
def test_102_services(self):
        """Verify that the expected services are running on the
           corresponding service units."""
        services = {
            self.rmq0_sentry: ['rabbitmq-server'],
            self.rmq1_sentry: ['rabbitmq-server'],
            self.rmq2_sentry: ['rabbitmq-server'],
            self.cinder_sentry: ['cinder-scheduler',
                                 'cinder-volume'],
        }

        _release = self._get_openstack_release_string()
        if CompareOpenStackReleases(_release) >= 'ocata':
            services[self.cinder_sentry].append('apache2')
        else:
            services[self.cinder_sentry].append('cinder-api')

        ret = u.validate_services_by_name(services)
        if ret:
            amulet.raise_status(amulet.FAIL, msg=ret)

        u.log.info('OK\n') 
开发者ID:openstack,项目名称:charm-rabbitmq-server,代码行数:24,代码来源:basic_deployment.py

示例2: test_keystone_v3

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import CompareOpenStackReleases [as 别名]
def test_keystone_v3(self):
        """Verify that the service is configured and operates correctly when
           using Keystone v3 auth."""
        os_release = self._get_openstack_release_string()
        if CompareOpenStackReleases(os_release) < 'kilo':
            u.log.info('Skipping test, {} < kilo'.format(os_release))
            return
        u.log.info('Checking that service is configured and operate correctly '
                   'when using Keystine v3 auth...')
        if not self._set_auth_api_version('3'):
            msg = "Unable to set auth_api_version to '3'"
            amulet.raise_status(amulet.FAIL, msg=msg)
            return
        self.test_302_proxy_server_config(auth_api_version='3')
        self.test_400_swift_backed_image_create() 
开发者ID:openstack,项目名称:charm-swift-proxy,代码行数:17,代码来源:basic_deployment.py

示例3: _assert_services

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import CompareOpenStackReleases [as 别名]
def _assert_services(self, should_run):
        services = ["nova-api-os-compute", "nova-cert", "nova-conductor",
                    "nova-scheduler", "apache2", "haproxy"]
        cmp_os_release = CompareOpenStackReleases(
            self._get_openstack_release_string()
        )
        if cmp_os_release >= 'newton':
            services.remove('nova-cert')
        u.get_unit_process_ids(
            {self.nova_cc_sentry: services},
            expect_success=should_run) 
开发者ID:openstack,项目名称:charm-nova-cloud-controller,代码行数:13,代码来源:basic_deployment.py

示例4: test_100_services

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import CompareOpenStackReleases [as 别名]
def test_100_services(self):
        """Verify the expected services are running on the corresponding
           service units."""
        u.log.debug('Checking system services on units...')
        services = {
            self.rabbitmq_sentry: ['rabbitmq-server'],
            self.nova_cc_sentry: ['nova-api-ec2',
                                  'nova-api-os-compute',
                                  'nova-conductor',
                                  'nova-objectstore',
                                  'nova-cert',
                                  'nova-scheduler'],
            self.nova_compute_sentry: ['nova-compute',
                                       'nova-network',
                                       'nova-api'],
            self.keystone_sentry: ['keystone'],
            self.glance_sentry: ['glance-registry', 'glance-api']
        }
        cmp_os_release = CompareOpenStackReleases(
            self._get_openstack_release_string()
        )
        if cmp_os_release >= 'liberty':
            services[self.nova_cc_sentry].remove('nova-api-ec2')
            services[self.nova_cc_sentry].remove('nova-objectstore')

        if cmp_os_release >= 'newton':
            services[self.nova_cc_sentry].remove('nova-cert')

        if self._get_openstack_release() >= self.trusty_liberty:
            services[self.keystone_sentry] = ['apache2']

        if self._get_openstack_release() >= self.xenial_ocata:
            services[self.nova_compute_sentry].remove('nova-network')
            services[self.nova_compute_sentry].remove('nova-api')

        ret = u.validate_services_by_name(services)
        if ret:
            amulet.raise_status(amulet.FAIL, msg=ret) 
开发者ID:openstack,项目名称:charm-nova-cloud-controller,代码行数:40,代码来源:basic_deployment.py

示例5: test_100_services

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import CompareOpenStackReleases [as 别名]
def test_100_services(self):
        """Verify the expected services are running on the corresponding
           service units."""
        u.log.debug('Checking system services on units...')

        services = {
            self.rabbitmq_sentry: ['rabbitmq-server'],
            self.nova_compute_sentry: ['nova-compute',
                                       'nova-network',
                                       'nova-api'],
            self.nova_cc_sentry: ['nova-conductor'],
            self.keystone_sentry: ['keystone'],
            self.glance_sentry: ['glance-registry',
                                 'glance-api']
        }

        if self._get_openstack_release() >= self.trusty_liberty:
            services[self.keystone_sentry] = ['apache2']

        _os_release = self._get_openstack_release_string()
        if CompareOpenStackReleases(_os_release) >= 'ocata':
            services[self.nova_compute_sentry].remove('nova-network')
            services[self.nova_compute_sentry].remove('nova-api')

        ret = u.validate_services_by_name(services)
        if ret:
            amulet.raise_status(amulet.FAIL, msg=ret) 
开发者ID:openstack,项目名称:charm-nova-compute,代码行数:29,代码来源:basic_deployment.py

示例6: test_compare_openstack_comparator

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import CompareOpenStackReleases [as 别名]
def test_compare_openstack_comparator(self):
        self.assertTrue(utils.CompareOpenStackReleases('mitaka') < 'newton')
        self.assertTrue(utils.CompareOpenStackReleases('pike') > 'essex') 
开发者ID:juju,项目名称:charm-helpers,代码行数:5,代码来源:test_os_utils.py

示例7: test_900_restart_on_config_change

# 需要导入模块: from charmhelpers.contrib.openstack import utils [as 别名]
# 或者: from charmhelpers.contrib.openstack.utils import CompareOpenStackReleases [as 别名]
def test_900_restart_on_config_change(self):
        """Verify that the specified services are restarted when the config
           is changed."""
        u.log.info('Checking that conf files and system services respond '
                   'to a charm config change...')

        sentry = self.nova_cc_sentry
        juju_service = 'nova-cloud-controller'

        # Process names, corresponding conf files
        conf_file = '/etc/nova/nova.conf'
        services = {
            'nova-api-ec2': conf_file,
            'nova-api-os-compute': conf_file,
            'nova-objectstore': conf_file,
            'nova-cert': conf_file,
            'nova-scheduler': conf_file,
            'nova-conductor': conf_file
        }

        cmp_os_release = CompareOpenStackReleases(
            self._get_openstack_release_string()
        )
        if cmp_os_release >= 'liberty':
            del services['nova-api-ec2']
            del services['nova-objectstore']

        if cmp_os_release >= 'newton':
            del services['nova-cert']

        if self._get_openstack_release() >= self.xenial_ocata:
            # nova-placement-api is run under apache2 with mod_wsgi
            services['apache2'] = conf_file

        # Expected default and alternate values
        flags_default = 'quota_cores=20,quota_instances=40,quota_ram=102400'
        flags_alt = 'quota_cores=10,quota_instances=20,quota_ram=51200'
        set_default = {'config-flags': flags_default}
        set_alternate = {'config-flags': flags_alt}

        # Make config change, check for service restarts
        u.log.debug('Making config change on {}...'.format(juju_service))
        mtime = u.get_sentry_time(sentry)
        self.d.configure(juju_service, set_alternate)

        sleep_time = 60
        for s, conf_file in services.iteritems():
            u.log.debug("Checking that service restarted: {}".format(s))
            if not u.validate_service_config_changed(sentry, mtime, s,
                                                     conf_file,
                                                     sleep_time=sleep_time):
                self.d.configure(juju_service, set_default)
                msg = "service {} didn't restart after config change".format(s)
                amulet.raise_status(amulet.FAIL, msg=msg)
            sleep_time = 0

        self.d.configure(juju_service, set_default) 
开发者ID:openstack,项目名称:charm-nova-cloud-controller,代码行数:59,代码来源:basic_deployment.py


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