job_scheduler.py 文件源码

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

项目:intel-manager-for-lustre 作者: intel-hpdd 项目源码 文件源码
def set_host_profile(self, host_id, server_profile_id):
        '''
        Set the profile for the given host to the given profile.

        :param host_id:
        :param server_profile_id:
        :return: Command for the host job or None if no commands were created.
        '''

        with self._lock:
            with transaction.commit_on_success():
                server_profile = ServerProfile.objects.get(pk=server_profile_id)
                host = ObjectCache.get_one(ManagedHost, lambda mh: mh.id == host_id)

                commands_required = host.set_profile(server_profile_id)

                if commands_required:
                    command = self.CommandPlan.command_run_jobs(commands_required,
                                                                help_text['change_host_profile'] % (host.fqdn, server_profile.ui_name))
                else:
                    command = None

        if command:
            self.progress.advance()

        return command
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号