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


Python NailgunClient.deploy_nodes方法代碼示例

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


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

示例1: FuelWebClient

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

#.........這裏部分代碼省略.........
                    "objects_ceph",
                    "osd_pool_size",
                    "volumes_lvm",
                ):
                    section = "storage"
                if section:
                    attributes["editable"][section][option]["value"] = settings[option]

            attributes["editable"]["common"]["debug"]["value"] = help_data.DEBUG_MODE

            hpv_data = attributes["editable"]["common"]["libvirt_type"]

            if KVM_USE:
                logger.debug("KVM is used to clusters")
                hpv_data["value"] = "kvm"

            self.client.update_cluster_attributes(cluster_id, attributes)
            self.update_network_configuration(cluster_id)

        if not cluster_id:
            raise Exception("Could not get cluster '%s'" % name)

        self.client.add_syslog_server(cluster_id, self.environment.get_host_node_ip(), port)

        return cluster_id

    def deploy_cluster_wait(self, cluster_id, is_feature=False, timeout=50 * 60, interval=30):
        if not is_feature:
            task = self.deploy_cluster(cluster_id)
            self.assert_task_success(task, interval=interval)
        else:
            task = self.client.provision_nodes(cluster_id)
            self.assert_task_success(task, timeout=timeout, interval=interval)
            task = self.client.deploy_nodes(cluster_id)
            self.assert_task_success(task, timeout=timeout, interval=interval)

    @logwrap
    def deploy_cluster(self, cluster_id):
        """Return hash with task description."""
        return self.client.deploy_cluster_changes(cluster_id)

    @logwrap
    def get_cluster_floating_list(self, node_name):
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call("/usr/bin/nova-manage floating list")
        ret_str = "".join(ret["stdout"])
        return re.findall("(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})", ret_str)

    @logwrap
    def get_cluster_block_devices(self, node_name):
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call("/bin/lsblk")
        return "".join(ret["stdout"])

    @logwrap
    def get_pacemaker_status(self, controller_node_name):
        remote = self.get_ssh_for_node(controller_node_name)
        return "".join(remote.check_call("crm_mon -1")["stdout"])

    @logwrap
    def get_pacemaker_config(self, controller_node_name):
        remote = self.get_ssh_for_node(controller_node_name)
        return "".join(remote.check_call("crm configure show")["stdout"])

    @logwrap
    def get_last_created_cluster(self):
開發者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 deploy_nodes [as 別名]

#.........這裏部分代碼省略.........
                if option in ('savanna', 'murano', 'ceilometer'):
                    section = 'additional_components'
                if option in ('volumes_ceph', 'images_ceph'):
                    section = 'storage'
                if section:
                    attributes['editable'][section][option]['value'] =\
                        settings[option]

            attributes['editable']['common']['debug']['value'] = True
            hpv_data = attributes['editable']['common']['libvirt_type']

            if KVM_USE:
                logger.debug('KVM is used to clusters')
                hpv_data['value'] = "kvm"

            self.client.update_cluster_attributes(cluster_id, attributes)
            self.update_network_configuration(cluster_id)

        if not cluster_id:
            raise Exception("Could not get cluster '%s'" % name)

        self.client.add_syslog_server(
            cluster_id, self.environment.get_host_node_ip(), port)

        return cluster_id

    def deploy_cluster_wait(self, cluster_id, is_feature=False):
        if not is_feature:
            task = self.deploy_cluster(cluster_id)
            self.assert_task_success(task, interval=30)
        else:
            task = self.client.provision_nodes(cluster_id)
            self.assert_task_success(task, timeout=50 * 60, interval=30)
            task = self.client.deploy_nodes(cluster_id)
            self.assert_task_success(task, timeout=50 * 60, interval=30)

    @logwrap
    def deploy_cluster(self, cluster_id):
        """Return hash with task description."""
        return self.client.deploy_cluster_changes(cluster_id)

    @logwrap
    def get_cluster_floating_list(self, node_name):
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call('/usr/bin/nova-manage floating list')
        ret_str = ''.join(ret['stdout'])
        return re.findall('(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', ret_str)

    @logwrap
    def get_cluster_block_devices(self, node_name):
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call('/bin/lsblk')
        return ''.join(ret['stdout'])

    @logwrap
    def get_pacemaker_status(self, controller_node_name):
        remote = self.get_ssh_for_node(controller_node_name)
        return ''.join(remote.check_call('crm_mon -1')['stdout'])

    @logwrap
    def get_pacemaker_config(self, controller_node_name):
        remote = self.get_ssh_for_node(controller_node_name)
        return ''.join(remote.check_call('crm configure show')['stdout'])

    @logwrap
    def get_last_created_cluster(self):
開發者ID:cwd79457245,項目名稱: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 deploy_nodes [as 別名]

#.........這裏部分代碼省略.........
                        settings[option]

            logger.info('Set DEBUG MODE to %s', help_data.DEBUG_MODE)
            attributes['editable']['common']['debug']['value'] = \
                help_data.DEBUG_MODE

            if KVM_USE:
                logger.info('Set Hypervisor type to KVM')
                hpv_data = attributes['editable']['common']['libvirt_type']
                hpv_data['value'] = "kvm"

            self.client.update_cluster_attributes(cluster_id, attributes)
            self.update_network_configuration(cluster_id)

        if not cluster_id:
            raise Exception("Could not get cluster '%s'" % name)

        self.client.add_syslog_server(
            cluster_id, self.environment.get_host_node_ip(), port)

        return cluster_id

    def deploy_cluster_wait(self, cluster_id, is_feature=False,
                            timeout=50 * 60, interval=30):
        if not is_feature:
            logger.info('Deploy cluster %s', cluster_id)
            task = self.deploy_cluster(cluster_id)
            self.assert_task_success(task, interval=interval)
        else:
            logger.info('Provision nodes of a cluster %s', cluster_id)
            task = self.client.provision_nodes(cluster_id)
            self.assert_task_success(task, timeout=timeout, interval=interval)
            logger.info('Deploy nodes of a cluster %s', cluster_id)
            task = self.client.deploy_nodes(cluster_id)
            self.assert_task_success(task, timeout=timeout, interval=interval)

    def deploy_cluster_wait_progress(self, cluster_id, progress):
        task = self.deploy_cluster(cluster_id)
        self.assert_task_success(task, interval=30, progress=progress)

    @logwrap
    def deploy_cluster(self, cluster_id):
        """Return hash with task description."""
        logger.info('Launch deployment of a cluster #%s', cluster_id)
        return self.client.deploy_cluster_changes(cluster_id)

    @logwrap
    def get_cluster_floating_list(self, node_name):
        logger.info('Get floating IPs list at %s devops node', node_name)
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call('/usr/bin/nova-manage floating list')
        ret_str = ''.join(ret['stdout'])
        return re.findall('(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', ret_str)

    @logwrap
    def get_cluster_block_devices(self, node_name):
        logger.info('Get %s node block devices (lsblk)', node_name)
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call('/bin/lsblk')
        return ''.join(ret['stdout'])

    @logwrap
    def get_pacemaker_status(self, controller_node_name):
        logger.info('Get pacemaker status at %s node', controller_node_name)
        remote = self.get_ssh_for_node(controller_node_name)
        return ''.join(remote.check_call('crm_mon -1')['stdout'])
開發者ID:shaikapsar,項目名稱: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 deploy_nodes [as 別名]

#.........這裏部分代碼省略.........
                help_data.DEBUG_MODE

            if KVM_USE:
                logger.info('Set Hypervisor type to KVM')
                hpv_data = attributes['editable']['common']['libvirt_type']
                hpv_data['value'] = "kvm"

            logger.debug("Try to update cluster "
                         "with next attributes {0}".format(attributes))
            self.client.update_cluster_attributes(cluster_id, attributes)
            logger.debug("Attributes of cluster were updated,"
                         " going to update networks ...")
            self.update_network_configuration(cluster_id)

        if not cluster_id:
            raise Exception("Could not get cluster '%s'" % name)
        #TODO: rw105719
        #self.client.add_syslog_server(
        #    cluster_id, self.environment.get_host_node_ip(), port)

        return cluster_id

    def deploy_cluster_wait(self, cluster_id, is_feature=False,
                            timeout=50 * 60, interval=30):
        if not is_feature:
            logger.info('Deploy cluster %s', cluster_id)
            task = self.deploy_cluster(cluster_id)
            self.assert_task_success(task, interval=interval)
        else:
            logger.info('Provision nodes of a cluster %s', cluster_id)
            task = self.client.provision_nodes(cluster_id)
            self.assert_task_success(task, timeout=timeout, interval=interval)
            logger.info('Deploy nodes of a cluster %s', cluster_id)
            task = self.client.deploy_nodes(cluster_id)
            self.assert_task_success(task, timeout=timeout, interval=interval)

    def deploy_cluster_wait_progress(self, cluster_id, progress):
        task = self.deploy_cluster(cluster_id)
        self.assert_task_success(task, interval=30, progress=progress)

    @logwrap
    def deploy_cluster(self, cluster_id):
        """Return hash with task description."""
        logger.info('Launch deployment of a cluster #%s', cluster_id)
        return self.client.deploy_cluster_changes(cluster_id)

    @logwrap
    def get_cluster_floating_list(self, node_name):
        logger.info('Get floating IPs list at %s devops node', node_name)
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call('/usr/bin/nova-manage floating list')
        ret_str = ''.join(ret['stdout'])
        return re.findall('(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})', ret_str)

    @logwrap
    def get_cluster_block_devices(self, node_name):
        logger.info('Get %s node block devices (lsblk)', node_name)
        remote = self.get_ssh_for_node(node_name)
        ret = remote.check_call('/bin/lsblk')
        return ''.join(ret['stdout'])

    @logwrap
    def get_pacemaker_status(self, controller_node_name):
        logger.info('Get pacemaker status at %s node', controller_node_name)
        remote = self.get_ssh_for_node(controller_node_name)
        return ''.join(remote.check_call('crm_mon -1')['stdout'])
開發者ID:igajsin,項目名稱:fuel-main,代碼行數:70,代碼來源:fuel_web_client.py


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