job_scheduler.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:intel-manager-for-lustre 作者: intel-hpdd 项目源码 文件源码
def update_corosync_configuration(self, corosync_configuration_id, mcast_port, network_interface_ids):
        with self._lock:
            with transaction.commit_on_success():
                # For now we only support 1 or 2 network configurations, jobs aren't so helpful at supporting lists
                corosync_configuration = CorosyncConfiguration.objects.get(id=corosync_configuration_id)

                assert len(network_interface_ids) == 1 or len(network_interface_ids) == 2
                network_interface_0 = NetworkInterface.objects.get(id = network_interface_ids[0])
                network_interface_1 = None if len(network_interface_ids) == 1 else NetworkInterface.objects.get(id = network_interface_ids[1])

                command_id = CommandPlan(self._lock_cache, self._job_collection).command_run_jobs_preserve_states(
                    [{"class_name": corosync_configuration.configure_job_name,
                      "args": {"corosync_configuration": corosync_configuration,
                               "mcast_port": mcast_port,
                               "network_interface_0": network_interface_0,
                               "network_interface_1": network_interface_1}}],
                    [corosync_configuration, corosync_configuration.host.pacemaker_configuration],
                    "Update Corosync Configuration on host %s" % corosync_configuration.host.fqdn)

        self.progress.advance()

        return command_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号