mistral.py 文件源码

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

项目:charm-mistral 作者: openstack 项目源码 文件源码
def db_sync(self):
        """Perform a database sync using the command defined in the
        self.sync_cmd attribute. The services defined in self.services are
        restarted after the database sync.
        """
        if not self.db_sync_done() and hookenv.is_leader():

            subprocess.check_call(['mistral-db-manage', '--config-file', '/etc/mistral/mistral.conf', 'upgrade', 'head'])
            subprocess.check_call(['mistral-db-manage', '--config-file', '/etc/mistral/mistral.conf', 'stamp', 'head'])
            subprocess.check_call(['mistral-db-manage', '--config-file', '/etc/mistral/mistral.conf', 'populate'])

            hookenv.leader_set({'db-sync-done': True})
            # Restart services immediately after db sync as
            # render_domain_config needs a working system
            self.restart_all()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号