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


Python waiters.wait_for_server_termination函数代码示例

本文整理汇总了Python中tempest.common.waiters.wait_for_server_termination函数的典型用法代码示例。如果您正苦于以下问题:Python wait_for_server_termination函数的具体用法?Python wait_for_server_termination怎么用?Python wait_for_server_termination使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: delete_router_interfaces

def delete_router_interfaces(cmgr, router, and_attached_resources=False):
    if type(router) is not dict:
        router = cmgr.qsvc('router-show', router)
    ports = cmgr.qsvc('router-port-list', router['id'])
    for port in ports:
        if port['device_owner'].find(':router_interface') > 0:
            if 'fixed_ips' in port:
                for fixed_ips in port['fixed_ips']:
                    if 'subnet_id' in fixed_ips:
                        sv_port_list = cmgr.qsvc(
                            "port-list",
                            network_id=port['network_id'],
                            device_owner="compute:None")
                        for sv_port in sv_port_list:
                            try:
                                sv = cmgr.nova("server-show",
                                               sv_port['device_id'])
                                cmgr.nova("server-delete", sv['id'])
                                waiters.wait_for_server_termination(
                                    cmgr.manager.servers_client,
                                    sv['id'])
                            except:
                                pass
                        cmgr.qsvc('router-interface-delete',
                                  router['id'], fixed_ips['subnet_id'])
开发者ID:gravity-tak,项目名称:interactive-tempest,代码行数:25,代码来源:lib_networks.py

示例2: delete_server

 def delete_server(cls, server_id):
     """Deletes an existing server and waits for it to be gone."""
     try:
         cls.servers_client.delete_server(server_id)
         waiters.wait_for_server_termination(cls.servers_client, server_id)
     except Exception:
         LOG.exception("Failed to delete server %s" % server_id)
开发者ID:shoham-stratoscale,项目名称:tempest,代码行数:7,代码来源:base.py

示例3: test_delete_server_while_in_suspended_state

 def test_delete_server_while_in_suspended_state(self):
     # Delete a server while it's VM state is Suspended
     server = self.create_test_server(wait_until='ACTIVE')
     self.client.suspend_server(server['id'])
     waiters.wait_for_server_status(self.client, server['id'], 'SUSPENDED')
     self.client.delete_server(server['id'])
     waiters.wait_for_server_termination(self.client, server['id'])
开发者ID:WoolenWang,项目名称:tempest,代码行数:7,代码来源:test_delete_server.py

示例4: test_delete_server_while_in_shutoff_state

 def test_delete_server_while_in_shutoff_state(self):
     # Delete a server while it's VM state is Shutoff
     server = self.create_test_server(wait_until='ACTIVE')
     self.client.stop_server(server['id'])
     waiters.wait_for_server_status(self.client, server['id'], 'SHUTOFF')
     self.client.delete_server(server['id'])
     waiters.wait_for_server_termination(self.client, server['id'])
开发者ID:WoolenWang,项目名称:tempest,代码行数:7,代码来源:test_delete_server.py

示例5: test_delete_server_while_in_pause_state

 def test_delete_server_while_in_pause_state(self):
     # Delete a server while it's VM state is Pause
     server = self.create_test_server(wait_until='ACTIVE')
     self.client.pause_server(server['id'])
     waiters.wait_for_server_status(self.client, server['id'], 'PAUSED')
     self.client.delete_server(server['id'])
     waiters.wait_for_server_termination(self.client, server['id'])
开发者ID:WoolenWang,项目名称:tempest,代码行数:7,代码来源:test_delete_server.py

示例6: tearDown

    def tearDown(self):
        if self.vip_fip:
            LOG.debug("tearDown lbass vip fip")
            self.disassociate_floatingip(self.vip_fip, and_delete=True)
        if self.loadbalancer:
            LOG.debug("tearDown lbass")
            lb_id = self.loadbalancer['id']
            self.delete_loadbalancer_resources(lb_id)

        # make sure servers terminated before teardown network resources
        LOG.debug("tearDown lbaas servers")
        server_id_list = []
        for servid in ['server1', 'server2']:
            server = getattr(self, servid, None)
            if server:
                if '_floating_ip' in server:
                    fip = server['_floating_ip']
                    self.disassociate_floatingip(fip, and_delete=True)
                self.manager.servers_client.delete_server(server['id'])
                server_id_list.append(server['id'])
        for server_id in server_id_list:
            waiters.wait_for_server_termination(
                self.manager.servers_client, server_id)
        # delete lbaas network before handing back to framework
        LOG.debug("tearDown lbaas network")
        self.delete_wrapper(self.router.delete)
        self.delete_wrapper(self.subnet.delete)
        self.delete_wrapper(self.network.delete)
        super(TestLBaasRoundRobinOps, self).tearDown()
        LOG.debug("tearDown lbaas exiting...")
开发者ID:ddoshiopenstack,项目名称:vmware-nsx,代码行数:30,代码来源:test_lbaas_round_robin_ops.py

示例7: cleanup

    def cleanup(self):
        """Cleanup the underlying instance.

        In order for the back-end to be useful again,
        call :meth:`setup_instance` method for preparing another
        underlying instance.
        """

        LOG.info("Cleaning up...")

        if self._security_groups_rules:
            for rule in self._security_groups_rules:
                (self._manager.security_group_rules_client.
                 delete_security_group_rule(rule))

        if self._security_group:
            self._manager.servers_client.remove_security_group(
                server_id=self.internal_instance_id(),
                name=self._security_group['name'])

        if self._server:
            self._manager.servers_client.delete_server(
                self.internal_instance_id())
            waiters.wait_for_server_termination(
                self._manager.servers_client,
                self.internal_instance_id())

        if self._floating_ip:
            self._manager.floating_ips_client.delete_floating_ip(
                self._floating_ip['id'])

        if self._keypair:
            self._keypair.destroy()

        self._manager.cleanup_credentials()
开发者ID:micumatei,项目名称:cloudbase-init-ci,代码行数:35,代码来源:tempest_backend.py

示例8: test_delete_server_while_in_shelved_state

    def test_delete_server_while_in_shelved_state(self):
        # Delete a server while it's VM state is Shelved
        server = self.create_test_server(wait_until='ACTIVE')
        compute.shelve_server(self.client, server['id'])

        self.client.delete_server(server['id'])
        waiters.wait_for_server_termination(self.client, server['id'])
开发者ID:WoolenWang,项目名称:tempest,代码行数:7,代码来源:test_delete_server.py

示例9: test_preserve_preexisting_port

    def test_preserve_preexisting_port(self):
        """Tests that a pre-existing port provided on server boot is not
        deleted if the server is deleted.

        Nova should unbind the port from the instance on delete if the port was
        not created by Nova as part of the boot request.
        """
        # Setup the network, create a port and boot the server from that port.
        self._setup_network_and_servers(boot_with_port=True)
        _, server = self.floating_ip_tuple
        self.assertEqual(1, len(self.ports),
                         'There should only be one port created for '
                         'server %s.' % server['id'])
        port_id = self.ports[0]['port']
        self.assertIsNotNone(port_id,
                             'Server should have been created from a '
                             'pre-existing port.')
        # Assert the port is bound to the server.
        port_list = self._list_ports(device_id=server['id'],
                                     network_id=self.network['id'])
        self.assertEqual(1, len(port_list),
                         'There should only be one port created for '
                         'server %s.' % server['id'])
        self.assertEqual(port_id, port_list[0]['id'])
        # Delete the server.
        self.servers_client.delete_server(server['id'])
        waiters.wait_for_server_termination(self.servers_client, server['id'])
        # Assert the port still exists on the network but is unbound from
        # the deleted server.
        port = self.ports_client.show_port(port_id)['port']
        self.assertEqual(self.network['id'], port['network_id'])
        self.assertEqual('', port['device_id'])
        self.assertEqual('', port['device_owner'])
开发者ID:koshi-m,项目名称:tempest,代码行数:33,代码来源:test_network_basic_ops.py

示例10: resource_cleanup

    def resource_cleanup(cls):
        # Delete the test instance
        cls.servers_client.delete_server(cls.server['id'])
        waiters.wait_for_server_termination(cls.servers_client,
                                            cls.server['id'])

        super(VolumesV2ActionsTest, cls).resource_cleanup()
开发者ID:Hybrid-Cloud,项目名称:hybrid-tempest,代码行数:7,代码来源:test_volumes_actions.py

示例11: test_reboot_deleted_server

    def test_reboot_deleted_server(self):
        # Reboot a deleted server
        server = self.create_test_server()
        self.client.delete_server(server['id'])
        waiters.wait_for_server_termination(self.client, server['id'])

        self.assertRaises(lib_exc.NotFound, self.client.reboot_server,
                          server['id'], type='SOFT')
开发者ID:NeCTAR-RC,项目名称:tempest,代码行数:8,代码来源:test_servers_negative.py

示例12: test_delete_server_while_in_verify_resize_state

 def test_delete_server_while_in_verify_resize_state(self):
     # Delete a server while it's VM state is VERIFY_RESIZE
     server = self.create_test_server(wait_until='ACTIVE')
     self.client.resize_server(server['id'], self.flavor_ref_alt)
     waiters.wait_for_server_status(self.client, server['id'],
                                    'VERIFY_RESIZE')
     self.client.delete_server(server['id'])
     waiters.wait_for_server_termination(self.client, server['id'])
开发者ID:WoolenWang,项目名称:tempest,代码行数:8,代码来源:test_delete_server.py

示例13: test_rebuild_deleted_server

    def test_rebuild_deleted_server(self):
        # Rebuild a deleted server
        server = self.create_test_server()
        self.client.delete_server(server['id'])
        waiters.wait_for_server_termination(self.client, server['id'])

        self.assertRaises(lib_exc.NotFound,
                          self.client.rebuild_server,
                          server['id'], self.image_ref_alt)
开发者ID:NeCTAR-RC,项目名称:tempest,代码行数:9,代码来源:test_servers_negative.py

示例14: resource_setup

    def resource_setup(cls):
        super(ServersNegativeTestJSON, cls).resource_setup()
        server = cls.create_test_server(wait_until='ACTIVE')
        cls.server_id = server['id']

        server = cls.create_test_server()
        cls.client.delete_server(server['id'])
        waiters.wait_for_server_termination(cls.client, server['id'])
        cls.deleted_server_id = server['id']
开发者ID:openstack,项目名称:tempest,代码行数:9,代码来源:test_servers_negative.py

示例15: test_get_list_deleted_instance_actions

    def test_get_list_deleted_instance_actions(self):

        # List actions of the deleted server
        server = self.create_test_server(wait_until='ACTIVE')
        self.client.delete_server(server['id'])
        waiters.wait_for_server_termination(self.client, server['id'])
        body = (self.client.list_instance_actions(server['id'])
                ['instanceActions'])
        self.assertEqual(len(body), 2, str(body))
        self.assertEqual(sorted([i['action'] for i in body]),
                         ['create', 'delete'])
开发者ID:sebrandon1,项目名称:tempest,代码行数:11,代码来源:test_instance_actions.py


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