當前位置: 首頁>>代碼示例>>Python>>正文


Python NailgunClient.get_tasks方法代碼示例

本文整理匯總了Python中fuelweb_test.models.nailgun_client.NailgunClient.get_tasks方法的典型用法代碼示例。如果您正苦於以下問題:Python NailgunClient.get_tasks方法的具體用法?Python NailgunClient.get_tasks怎麽用?Python NailgunClient.get_tasks使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在fuelweb_test.models.nailgun_client.NailgunClient的用法示例。


在下文中一共展示了NailgunClient.get_tasks方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_tasks [as 別名]

#.........這裏部分代碼省略.........
        for disk in disks:
            dname = disk["name"]
            if dname not in disks_dict:
                continue
            for volume in disk["volumes"]:
                vname = volume["name"]
                if vname in disks_dict[dname]:
                    volume["size"] = disks_dict[dname][vname]

        self.client.put_node_disks(node_id, disks)

    @logwrap
    def update_redhat_credentials(
        self,
        license_type=help_data.REDHAT_LICENSE_TYPE,
        username=help_data.REDHAT_USERNAME,
        password=help_data.REDHAT_PASSWORD,
        satellite_host=help_data.REDHAT_SATELLITE_HOST,
        activation_key=help_data.REDHAT_ACTIVATION_KEY,
    ):

        # release name is in environment variable OPENSTACK_RELEASE
        release_id = self.client.get_release_id("RHOS")
        self.client.update_redhat_setup(
            {
                "release_id": release_id,
                "username": username,
                "license_type": license_type,
                "satellite": satellite_host,
                "password": password,
                "activation_key": activation_key,
            }
        )
        tasks = self.client.get_tasks()
        # wait for 'redhat_setup' task only. Front-end works same way
        for task in tasks:
            if task["name"] == "redhat_setup" and task["result"]["release_info"]["release_id"] == release_id:
                return self.task_wait(task, 60 * 120)

    @logwrap
    def update_vlan_network_fixed(self, cluster_id, amount=1, network_size=256):
        network_list = self.client.get_networks(cluster_id)["networks"]
        for network in network_list:
            if network["name"] == "fixed":
                network["amount"] = amount
                network["network_size"] = network_size

        self.client.update_network(cluster_id, networks=network_list, net_manager=help_data.NETWORK_MANAGERS["vlan"])

    @logwrap
    def verify_network(self, cluster_id):
        task = self.run_network_verify(cluster_id)
        self.assert_task_success(task, 60 * 2, interval=10)

    @logwrap
    def update_nodes_interfaces(self, cluster_id):
        cluster = self.client.get_cluster(cluster_id)
        net_provider = self.client.get_cluster(cluster_id)["net_provider"]
        if NEUTRON == net_provider:
            assigned_networks = {"eth1": ["public"], "eth2": ["management"], "eth4": ["storage"]}

            if cluster["net_segment_type"] == NEUTRON_SEGMENT["vlan"]:
                assigned_networks.update({"eth3": ["private"]})
        else:
            assigned_networks = {
                "eth1": ["floating", "public"],
開發者ID:piousbox,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py

示例2: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_tasks [as 別名]

#.........這裏部分代碼省略.........
        self.client.put_node_interfaces(
            [{'id': node_id, 'interfaces': interfaces}])

    @logwrap
    def update_node_disk(self, node_id, disks_dict):
        disks = self.client.get_node_disks(node_id)
        for disk in disks:
            dname = disk['name']
            if dname not in disks_dict:
                continue
            for volume in disk['volumes']:
                vname = volume['name']
                if vname in disks_dict[dname]:
                    volume['size'] = disks_dict[dname][vname]

        self.client.put_node_disks(node_id, disks)

    @logwrap
    def update_redhat_credentials(
            self, license_type=help_data.REDHAT_LICENSE_TYPE,
            username=help_data.REDHAT_USERNAME, password=help_data.REDHAT_PASSWORD,
            satellite_host=help_data.REDHAT_SATELLITE_HOST,
            activation_key=help_data.REDHAT_ACTIVATION_KEY):

        # release name is in environment variable OPENSTACK_RELEASE
        release_id = self.client.get_release_id('RHOS')
        self.client.update_redhat_setup({
            "release_id": release_id,
            "username": username,
            "license_type": license_type,
            "satellite": satellite_host,
            "password": password,
            "activation_key": activation_key})
        tasks = self.client.get_tasks()
        # wait for 'redhat_setup' task only. Front-end works same way
        for task in tasks:
            if task['name'] == 'redhat_setup' \
                    and task['result']['release_info']['release_id'] \
                            == release_id:
                return self.task_wait(task, 60 * 120)

    @logwrap
    def update_vlan_network_fixed(
            self, cluster_id, amount=1, network_size=256):
        network_list = self.client.get_networks(cluster_id)['networks']
        for network in network_list:
            if network["name"] == 'fixed':
                network['amount'] = amount
                network['network_size'] = network_size

        self.client.update_network(
            cluster_id,
            networks=network_list,
            net_manager=help_data.NETWORK_MANAGERS['vlan'])

    @logwrap
    def verify_murano_service(self, node_name):
        ip = self.get_nailgun_node_by_devops_node(
            self.environment.get_virtual_environment().
            node_by_name(node_name))['ip']
        verify_murano_service(self.environment.get_ssh_to_remote(ip))

    @logwrap
    def verify_network(self, cluster_id):
        task = self.run_network_verify(cluster_id)
        self.assert_task_success(task, 60 * 2, interval=10)
開發者ID:korshenin,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py

示例3: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_tasks [as 別名]

#.........這裏部分代碼省略.........
                vname = volume['name']
                if vname in disks_dict[dname]:
                    volume['size'] = disks_dict[dname][vname]

        self.client.put_node_disks(node_id, disks)

    @logwrap
    def get_node_disk_size(self, node_id, disk_name):
        disks = self.client.get_node_disks(node_id)
        size = 0
        for disk in disks:
            if disk['name'] == disk_name:
                for volume in disk['volumes']:
                    size += volume['size']
        return size

    @logwrap
    def update_redhat_credentials(
            self, license_type=help_data.REDHAT_LICENSE_TYPE,
            username=help_data.REDHAT_USERNAME,
            password=help_data.REDHAT_PASSWORD,
            satellite_host=help_data.REDHAT_SATELLITE_HOST,
            activation_key=help_data.REDHAT_ACTIVATION_KEY):

        # release name is in environment variable OPENSTACK_RELEASE
        release_id = self.client.get_release_id('RHOS')
        self.client.update_redhat_setup({
            "release_id": release_id,
            "username": username,
            "license_type": license_type,
            "satellite": satellite_host,
            "password": password,
            "activation_key": activation_key})
        tasks = self.client.get_tasks()
        # wait for 'redhat_setup' task only. Front-end works same way
        for task in tasks:
            if task['name'] == 'redhat_setup' \
                    and task['result']['release_info']['release_id'] \
                            == release_id:
                return self.task_wait(task, 60 * 120)

    @logwrap
    def update_vlan_network_fixed(
            self, cluster_id, amount=1, network_size=256):
        self.client.update_network(
            cluster_id,
            networking_parameters={
                "net_manager": help_data.NETWORK_MANAGERS['vlan'],
                "fixed_network_size": network_size,
                "fixed_networks_amount": amount
            }
        )

    @logwrap
    def verify_network(self, cluster_id):
        task = self.run_network_verify(cluster_id)
        self.assert_task_success(task, 60 * 2, interval=10)

    @logwrap
    def update_nodes_interfaces(self, cluster_id):
        net_provider = self.client.get_cluster(cluster_id)['net_provider']
        if NEUTRON == net_provider:
            assigned_networks = {
                'eth1': ['public'],
                'eth2': ['management'],
                'eth4': ['storage'],
開發者ID:igajsin,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py

示例4: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_tasks [as 別名]

#.........這裏部分代碼省略.........
            [{'id': node_id, 'interfaces': interfaces}])

    @logwrap
    def update_node_disk(self, node_id, disks_dict):
        disks = self.client.get_node_disks(node_id)
        for disk in disks:
            dname = disk['name']
            if dname not in disks_dict:
                continue
            for volume in disk['volumes']:
                vname = volume['name']
                if vname in disks_dict[dname]:
                    volume['size'] = disks_dict[dname][vname]

        self.client.put_node_disks(node_id, disks)

    @logwrap
    def update_redhat_credentials(
            self, license_type=help_data.REDHAT_LICENSE_TYPE,
            username=help_data.REDHAT_USERNAME,
            password=help_data.REDHAT_PASSWORD,
            satellite_host=help_data.REDHAT_SATELLITE_HOST,
            activation_key=help_data.REDHAT_ACTIVATION_KEY):

        # release name is in environment variable OPENSTACK_RELEASE
        release_id = self.client.get_release_id('RHOS')
        self.client.update_redhat_setup({
            "release_id": release_id,
            "username": username,
            "license_type": license_type,
            "satellite": satellite_host,
            "password": password,
            "activation_key": activation_key})
        tasks = self.client.get_tasks()
        # wait for 'redhat_setup' task only. Front-end works same way
        for task in tasks:
            if task['name'] == 'redhat_setup' \
                    and task['result']['release_info']['release_id'] \
                            == release_id:
                return self.task_wait(task, 60 * 120)

    @logwrap
    def update_vlan_network_fixed(
            self, cluster_id, amount=1, network_size=256):
        network_list = self.client.get_networks(cluster_id)['networks']
        for network in network_list:
            if network["name"] == 'fixed':
                network['amount'] = amount
                network['network_size'] = network_size

        self.client.update_network(
            cluster_id,
            networks=network_list,
            net_manager=help_data.NETWORK_MANAGERS['vlan'])

    @logwrap
    def verify_network(self, cluster_id):
        task = self.run_network_verify(cluster_id)
        self.assert_task_success(task, 60 * 2, interval=10)

    @logwrap
    def update_nodes_interfaces(self, cluster_id):
        cluster = self.client.get_cluster(cluster_id)
        net_provider = self.client.get_cluster(cluster_id)['net_provider']
        if NEUTRON == net_provider:
            assigned_networks = {
開發者ID:shaikapsar,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py

示例5: FuelWebClient

# 需要導入模塊: from fuelweb_test.models.nailgun_client import NailgunClient [as 別名]
# 或者: from fuelweb_test.models.nailgun_client.NailgunClient import get_tasks [as 別名]

#.........這裏部分代碼省略.........
        interfaces = self.client.get_node_interfaces(node_id)
        for interface in interfaces:
            interface_name = interface["name"]
            interface["assigned_networks"] = []
            for allowed_network in interface["allowed_networks"]:
                key_exists = interface_name in interfaces_dict
                if key_exists and allowed_network["name"] in interfaces_dict[interface_name]:
                    interface["assigned_networks"].append(allowed_network)

        self.client.put_node_interfaces([{"id": node_id, "interfaces": interfaces}])

    @logwrap
    def update_redhat_credentials(
        self,
        license_type=help_data.REDHAT_LICENSE_TYPE,
        username=help_data.REDHAT_USERNAME,
        password=help_data.REDHAT_PASSWORD,
        satellite_host=help_data.REDHAT_SATELLITE_HOST,
        activation_key=help_data.REDHAT_ACTIVATION_KEY,
    ):

        # release name is in environment variable OPENSTACK_RELEASE
        release_id = self.client.get_release_id("RHOS")
        self.client.update_redhat_setup(
            {
                "release_id": release_id,
                "username": username,
                "license_type": license_type,
                "satellite": satellite_host,
                "password": password,
                "activation_key": activation_key,
            }
        )
        tasks = self.client.get_tasks()
        # wait for 'redhat_setup' task only. Front-end works same way
        for task in tasks:
            if task["name"] == "redhat_setup" and task["result"]["release_info"]["release_id"] == release_id:
                return self.task_wait(task, 60 * 120)

    @logwrap
    def update_vlan_network_fixed(self, cluster_id, amount=1, network_size=256):
        network_list = self.client.get_networks(cluster_id)["networks"]
        for network in network_list:
            if network["name"] == "fixed":
                network["amount"] = amount
                network["network_size"] = network_size

        self.client.update_network(cluster_id, networks=network_list, net_manager=help_data.NETWORK_MANAGERS["vlan"])

    @logwrap
    def verify_murano_service(self, node_name):
        ip = self.get_nailgun_node_by_devops_node(self.environment.get_virtual_environment().node_by_name(node_name))[
            "ip"
        ]
        verify_murano_service(self.environment.get_ssh_to_remote(ip))

    @logwrap
    def verify_network(self, cluster_id):
        task = self.run_network_verify(cluster_id)
        self.assert_task_success(task, 60 * 2, interval=10)

    @logwrap
    def verify_savanna_service(self, node_name):
        ip = self.get_nailgun_node_by_devops_node(self.environment.get_virtual_environment().node_by_name(node_name))[
            "ip"
        ]
開發者ID:justasabc,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py


注:本文中的fuelweb_test.models.nailgun_client.NailgunClient.get_tasks方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。