context.py 文件源码

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

项目:charm-swift-proxy 作者: openstack 项目源码 文件源码
def context_complete(self, ctxt):
        """Check for missing data for the required context data.
        Set self.missing_data if it exists and return False.
        Set self.complete if no missing data and return True.
        """
        # Fresh start
        self.complete = False
        self.missing_data = []
        for k, v in six.iteritems(ctxt):
            if v is None or v == '':
                if k not in self.missing_data:
                    self.missing_data.append(k)

        if self.missing_data:
            self.complete = False
            log('Missing required data: %s' % ' '.join(self.missing_data),
                level=INFO)
        else:
            self.complete = True
        return self.complete
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号