Example #1
0
    def get_member_repo(self, image, context):
        image_member_repo = glance.db.ImageMemberRepo(context, self.db_api,
                                                      image)
        store_image_repo = glance.location.ImageMemberRepoProxy(
            image_member_repo, image, context, self.store_api)
        policy_member_repo = policy.ImageMemberRepoProxy(
            store_image_repo, image, context, self.policy)
        notifier_member_repo = glance.notifier.ImageMemberRepoProxy(
            policy_member_repo, image, context, self.notifier)
        authorized_member_repo = authorization.ImageMemberRepoProxy(
            notifier_member_repo, image, context)

        return authorized_member_repo
Example #2
0
    def get_member_repo(self, image, context, authorization_layer=True):
        repo = glance.db.ImageMemberRepo(context, self.db_api, image)
        repo = glance.location.ImageMemberRepoProxy(repo, image, context,
                                                    self.store_api)
        if authorization_layer:
            repo = policy.ImageMemberRepoProxy(repo, image, context,
                                               self.policy)
        repo = glance.notifier.ImageMemberRepoProxy(repo, image, context,
                                                    self.notifier)
        if authorization_layer:
            repo = authorization.ImageMemberRepoProxy(repo, image, context)

        return repo