instance.py 文件源码

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

项目:elephaas 作者: peak6 项目源码 文件源码
def restart_instances(self, request, queryset):
        """
        Restart all transmitted PostgreSQL instances

        Basicaly we just call for a fast stop followed by a start. Nothing
        complicated here. Unlike stop, we don't skip stopped instances, and
        unline start, we don't skip running ones.
        """

        for inst in queryset:
            try:
                util = PGUtility(inst)
                util.stop()
                util.start()

            except Exception, e:
                self.message_user(request, "%s : %s" % (e, inst), messages.ERROR)
                continue

            self.message_user(request, "%s restarted!" % inst)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号