nova_compute_proxy.py 文件源码

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

项目:charm-nova-compute-proxy 作者: openstack 项目源码 文件源码
def restart_on_change(restart_map, func):
    """Restart services using provided function based
       on configuration files changing"""
    def wrap(f):
        def wrapped_f(*args):
            checksums = {}
            for path in restart_map:
                checksums[path] = file_hash(path)
            f(*args)
            restarts = []
            for path in restart_map:
                if checksums[path] != file_hash(path):
                    restarts += restart_map[path]
            services_list = list(OrderedDict.fromkeys(restarts))
            for s_name in services_list:
                func(s_name)
        return wrapped_f
    return wrap
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号