• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python base.clear_info_cache函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中swift.proxy.controllers.base.clear_info_cache函数的典型用法代码示例。如果您正苦于以下问题:Python clear_info_cache函数的具体用法?Python clear_info_cache怎么用?Python clear_info_cache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了clear_info_cache函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: PUT

 def PUT(self, req):
     """HTTP PUT request handler."""
     error_response = self.clean_acls(req) or check_metadata(req, "container")
     if error_response:
         return error_response
     if len(self.container_name) > MAX_CONTAINER_NAME_LENGTH:
         resp = HTTPBadRequest(request=req)
         resp.body = "Container name length of %d longer than %d" % (
             len(self.container_name),
             MAX_CONTAINER_NAME_LENGTH,
         )
         return resp
     account_partition, accounts, container_count = self.account_info(self.account_name, req)
     if not accounts and self.app.account_autocreate:
         self.autocreate_account(req.environ, self.account_name)
         account_partition, accounts, container_count = self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     if (
         self.app.max_containers_per_account > 0
         and container_count >= self.app.max_containers_per_account
         and self.account_name not in self.app.max_containers_whitelist
     ):
         resp = HTTPForbidden(request=req)
         resp.body = "Reached container limit of %s" % self.app.max_containers_per_account
         return resp
     container_partition, containers = self.app.container_ring.get_nodes(self.account_name, self.container_name)
     headers = self._backend_requests(req, len(containers), account_partition, accounts)
     clear_info_cache(self.app, req.environ, self.account_name, self.container_name)
     resp = self.make_requests(req, self.app.container_ring, container_partition, "PUT", req.path_info, headers)
     return resp
开发者ID:zaitcev,项目名称:swift-lfs,代码行数:31,代码来源:container.py


示例2: POST

    def POST(self, req):
        """HTTP POST request handler."""
        # container元数据参数检查
        error_response = \
            self.clean_acls(req) or check_metadata(req, 'container')
        if error_response:
            return error_response
        if not req.environ.get('swift_owner'):
            for key in self.app.swift_owner_headers:
                req.headers.pop(key, None)

        # 获取account的元数据信息,分区、节点、以及container数量
        account_partition, accounts, container_count = \
            self.account_info(self.account_name, req)
        # 如果account不存在,则报错
        if not accounts:
            return HTTPNotFound(request=req)

        # 通过ring环计算分区、container所在节点
        container_partition, containers = self.app.container_ring.get_nodes(
            self.account_name, self.container_name)
        # 生成创建container请求的header
        headers = self.generate_request_headers(req, transfer=True)
        # 清除本地缓存account和container的元数据信息
        clear_info_cache(self.app, req.environ,
                         self.account_name, self.container_name)
        # 发送请求到所有container节点,更新container元数据请求
        resp = self.make_requests(
            req, self.app.container_ring, container_partition, 'POST',
            req.swift_entity_path, [headers] * len(containers))
        return resp
开发者ID:sunzz679,项目名称:swift-2.4.0--source-read,代码行数:31,代码来源:container.py


示例3: POST

 def POST(self, req):
     """HTTP POST request handler."""
     error_response = \
         self.clean_acls(req) or check_metadata(req, 'container')
     if error_response:
         return error_response
     if not req.environ.get('swift_owner'):
         for key in self.app.swift_owner_headers:
             req.headers.pop(key, None)
     if req.environ.get('reseller_request', False) and \
             'X-Container-Sharding' in req.headers:
         req.headers[get_sys_meta_prefix('container') + 'Sharding'] = \
             str(config_true_value(req.headers['X-Container-Sharding']))
     account_partition, accounts, container_count = \
         self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     container_partition, containers = self.app.container_ring.get_nodes(
         self.account_name, self.container_name)
     headers = self.generate_request_headers(req, transfer=True)
     clear_info_cache(self.app, req.environ,
                      self.account_name, self.container_name)
     resp = self.make_requests(
         req, self.app.container_ring, container_partition, 'POST',
         req.swift_entity_path, [headers] * len(containers))
     return resp
开发者ID:openstack,项目名称:swift,代码行数:26,代码来源:container.py


示例4: PUT

    def PUT(self, req):
        """HTTP PUT request handler."""
	print 'in PUT function of accountcontroller class'
        if not self.app.allow_account_management:
            return HTTPMethodNotAllowed(
                request=req,
                headers={'Allow': ', '.join(self.allowed_methods)})
        error_response = check_metadata(req, 'account')
	print 'error_response'
        if error_response:
            return error_response
        if len(self.account_name) > constraints.MAX_ACCOUNT_NAME_LENGTH:
            resp = HTTPBadRequest(request=req)
            resp.body = 'Account name length of %d longer than %d' % \
                        (len(self.account_name),
                         constraints.MAX_ACCOUNT_NAME_LENGTH)
            return resp
        account_partition, accounts = \
            self.app.account_ring.get_nodes(self.account_name)
	print ' account_partition, accounts',account_partion,accounts
        headers = self.generate_request_headers(req, transfer=True)
	print 'headers',headers
        clear_info_cache(self.app, req.environ, self.account_name)
        resp = self.make_requests(
            req, self.app.account_ring, account_partition, 'PUT',
            req.swift_entity_path, [headers] * len(accounts))
	print 'resp',resp
        self.add_acls_from_sys_metadata(resp)
	print 'in PUT function of accountcontroller class END'
        return resp
开发者ID:jannatunnoor,项目名称:test_swift,代码行数:30,代码来源:account.py


示例5: POST

 def POST(self, req):
     """HTTP POST request handler."""
     if len(self.account_name) > constraints.MAX_ACCOUNT_NAME_LENGTH:
         resp = HTTPBadRequest(request=req)
         resp.body = 'Account name length of %d longer than %d' % \
                     (len(self.account_name),
                      constraints.MAX_ACCOUNT_NAME_LENGTH)
         return resp
     error_response = check_metadata(req, 'account')
     if error_response:
         return error_response
     account_partition, accounts = \
         self.app.account_ring.get_nodes(self.account_name)
     headers = self.generate_request_headers(req, transfer=True)
     clear_info_cache(self.app, req.environ, self.account_name)
     resp = self.make_requests(
         req, self.app.account_ring, account_partition, 'POST',
         req.swift_entity_path, [headers] * len(accounts))
     if resp.status_int == HTTP_NOT_FOUND and self.app.account_autocreate:
         self.autocreate_account(req, self.account_name)
         resp = self.make_requests(
             req, self.app.account_ring, account_partition, 'POST',
             req.swift_entity_path, [headers] * len(accounts))
     self.add_acls_from_sys_metadata(resp)
     return resp
开发者ID:Ahiknsr,项目名称:swift,代码行数:25,代码来源:account.py


示例6: DELETE

    def DELETE(self, req):
        """HTTP DELETE request handler."""
        account_partition, accounts, container_count = \
            self.account_info(self.account_name, req)
        if not accounts:
            return HTTPNotFound(request=req)

        policy_index = self._convert_policy_to_index(req)
        if policy_index is None:
            policy_index = int(POLICIES.default)
        cloud_ring = CloudRing(self.container_name, POLICIES.get_by_index(policy_index))

        container_partition, containers = self.app.container_ring.get_nodes(
            self.account_name, self.container_name)
        headers = self._backend_requests(req, len(containers),
                                         account_partition, accounts)
        clear_info_cache(self.app, req.environ,
                         self.account_name, self.container_name)
        resp = self.make_requests(
            req, self.app.container_ring, container_partition, 'DELETE',
            req.swift_entity_path, headers)
        # Indicates no server had the container
        if resp.status_int == HTTP_ACCEPTED:
            return HTTPNotFound(request=req)
        return_flag, _info = cloud_ring.delete_containers()
        if not return_flag:
            msg = 'Failed:' + str(_info)
            raise DELETECloudContainerException(msg)
        return resp
开发者ID:kun--hust,项目名称:sdscloud,代码行数:29,代码来源:container.py


示例7: PUT

    def PUT(self, req):
        """HTTP PUT request handler."""
        error_response = \
            self.clean_acls(req) or check_metadata(req, 'container')
        if error_response:
            return error_response
        policy_index = self._convert_policy_to_index(req)
        if policy_index is None:
            policy_index = int(POLICIES.default)
        if not req.environ.get('swift_owner'):
            for key in self.app.swift_owner_headers:
                req.headers.pop(key, None)
        if len(self.container_name) > constraints.MAX_CONTAINER_NAME_LENGTH:
            resp = HTTPBadRequest(request=req)
            resp.body = 'Container name length of %d longer than %d' % \
                        (len(self.container_name),
                         constraints.MAX_CONTAINER_NAME_LENGTH)
            return resp
        account_partition, accounts, container_count = \
            self.account_info(self.account_name, req)
        if not accounts and self.app.account_autocreate:
            self.autocreate_account(req, self.account_name)
            account_partition, accounts, container_count = \
                self.account_info(self.account_name, req)
        if not accounts:
            return HTTPNotFound(request=req)
        if self.app.max_containers_per_account > 0 and \
                container_count >= self.app.max_containers_per_account and \
                self.account_name not in self.app.max_containers_whitelist:
            container_info = \
                self.container_info(self.account_name, self.container_name,
                                    req)
            if not is_success(container_info.get('status')):
                resp = HTTPForbidden(request=req)
                resp.body = 'Reached container limit of %s' % \
                    self.app.max_containers_per_account
                return resp
        container_partition, containers = self.app.container_ring.get_nodes(
            self.account_name, self.container_name)
        headers = self._backend_requests(req, len(containers),
                                         account_partition, accounts,
                                         policy_index)
        clear_info_cache(self.app, req.environ,
                         self.account_name, self.container_name)
        resp = self.make_requests(
            req, self.app.container_ring,
            container_partition, 'PUT', req.swift_entity_path, headers)

        cloud_ring = CloudRing(self.container_name, POLICIES.get_by_index(policy_index))
        return_flag, _info = cloud_ring.create_containers()
        if not return_flag:
            msg = 'Failed:' + str(_info)
            raise PUTCloudContainerException(msg)

        return resp
开发者ID:kun--hust,项目名称:sdscloud,代码行数:55,代码来源:container.py


示例8: PUT

 def PUT(self, req):
     """HTTP PUT request handler."""
     #container元数据参数检查
     error_response = \
         self.clean_acls(req) or check_metadata(req, 'container')
     if error_response:
         return error_response
     policy_index = self._convert_policy_to_index(req)
     if not req.environ.get('swift_owner'):
         for key in self.app.swift_owner_headers:
             req.headers.pop(key, None)
     if len(self.container_name) > constraints.MAX_CONTAINER_NAME_LENGTH:
         resp = HTTPBadRequest(request=req)
         resp.body = 'Container name length of %d longer than %d' % \
                     (len(self.container_name),
                      constraints.MAX_CONTAINER_NAME_LENGTH)
         return resp
     #获取account的元数据信息,分区、节点、以及container数量
     account_partition, accounts, container_count = \
         self.account_info(self.account_name, req)
     #如果account不存在,则创建account
     if not accounts and self.app.account_autocreate:
         self.autocreate_account(req, self.account_name)
         account_partition, accounts, container_count = \
             self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     #检查account里面container超过上限值,则报错
     if self.app.max_containers_per_account > 0 and \
             container_count >= self.app.max_containers_per_account and \
             self.account_name not in self.app.max_containers_whitelist:
         container_info = \
             self.container_info(self.account_name, self.container_name,
                                 req)
         if not is_success(container_info.get('status')):
             resp = HTTPForbidden(request=req)
             resp.body = 'Reached container limit of %s' % \
                 self.app.max_containers_per_account
             return resp
     #通过ring环计算分区、container所在节点
     container_partition, containers = self.app.container_ring.get_nodes(
         self.account_name, self.container_name)
     #生成创建container请求的header
     headers = self._backend_requests(req, len(containers),
                                      account_partition, accounts,
                                      policy_index)
     #清除本地缓存account和container的元数据信息
     clear_info_cache(self.app, req.environ,
                      self.account_name, self.container_name)
     #发送请求到所有container节点,创建container
     resp = self.make_requests(
         req, self.app.container_ring,
         container_partition, 'PUT', req.swift_entity_path, headers)
     return resp
开发者ID:sunzz679,项目名称:swift-2.4.0--source-read,代码行数:54,代码来源:container.py


示例9: DELETE

 def DELETE(self, req):
     """HTTP DELETE request handler."""
     account_partition, accounts, container_count = \
         self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     clear_info_cache(self.app, req.environ,
                      self.account_name, self.container_name)
     resp = self.get_container_delete_resp(req)
     if resp.status_int == HTTP_ACCEPTED:
         return HTTPNotFound(request=req)
     return resp
开发者ID:fvennetier,项目名称:oio-swift,代码行数:12,代码来源:container.py


示例10: DELETE

 def DELETE(self, req):
     """HTTP DELETE request handler."""
     account_partition, accounts, container_count = self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     container_partition, containers = self.app.container_ring.get_nodes(self.account_name, self.container_name)
     headers = self._backend_requests(req, len(containers), account_partition, accounts)
     clear_info_cache(self.app, req.environ, self.account_name, self.container_name)
     resp = self.make_requests(req, self.app.container_ring, container_partition, "DELETE", req.path_info, headers)
     # Indicates no server had the container
     if resp.status_int == HTTP_ACCEPTED:
         return HTTPNotFound(request=req)
     return resp
开发者ID:zaitcev,项目名称:swift-lfs,代码行数:13,代码来源:container.py


示例11: PUT

 def PUT(self, req):
     """HTTP PUT request handler."""
     error_response = \
         self.clean_acls(req) or check_metadata(req, 'container')
     if error_response:
         return error_response
     policy_index = self._convert_policy_to_index(req)
     if not req.environ.get('swift_owner'):
         for key in self.app.swift_owner_headers:
             req.headers.pop(key, None)
     if req.environ.get('reseller_request', False) and \
             'X-Container-Sharding' in req.headers:
         req.headers[get_sys_meta_prefix('container') + 'Sharding'] = \
             str(config_true_value(req.headers['X-Container-Sharding']))
     length_limit = self.get_name_length_limit()
     if len(self.container_name) > length_limit:
         body = 'Container name length of %d longer than %d' % (
             len(self.container_name), length_limit)
         resp = HTTPBadRequest(request=req, body=body)
         return resp
     account_partition, accounts, container_count = \
         self.account_info(self.account_name, req)
     if not accounts and self.app.account_autocreate:
         if not self.autocreate_account(req, self.account_name):
             return HTTPServiceUnavailable(request=req)
         account_partition, accounts, container_count = \
             self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     if 0 < self.app.max_containers_per_account <= container_count and \
             self.account_name not in self.app.max_containers_whitelist:
         container_info = \
             self.container_info(self.account_name, self.container_name,
                                 req)
         if not is_success(container_info.get('status')):
             body = 'Reached container limit of %s' % (
                 self.app.max_containers_per_account, )
             resp = HTTPForbidden(request=req, body=body)
             return resp
     container_partition, containers = self.app.container_ring.get_nodes(
         self.account_name, self.container_name)
     headers = self._backend_requests(req, len(containers),
                                      account_partition, accounts,
                                      policy_index)
     resp = self.make_requests(
         req, self.app.container_ring,
         container_partition, 'PUT', req.swift_entity_path, headers)
     clear_info_cache(self.app, req.environ,
                      self.account_name, self.container_name)
     return resp
开发者ID:openstack,项目名称:swift,代码行数:50,代码来源:container.py


示例12: POST

 def POST(self, req):
     """HTTP POST request handler."""
     error_response = self.clean_acls(req) or check_metadata(req, "container")
     if error_response:
         return error_response
     account_partition, accounts, container_count = self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     container_partition, containers = self.app.container_ring.get_nodes(self.account_name, self.container_name)
     headers = self.generate_request_headers(req, transfer=True)
     clear_info_cache(self.app, req.environ, self.account_name, self.container_name)
     resp = self.make_requests(
         req, self.app.container_ring, container_partition, "POST", req.path_info, [headers] * len(containers)
     )
     return resp
开发者ID:zaitcev,项目名称:swift-lfs,代码行数:15,代码来源:container.py


示例13: DELETE

 def DELETE(self, req):
     """HTTP DELETE request handler."""
     # Extra safety in case someone typos a query string for an
     # account-level DELETE request that was really meant to be caught by
     # some middleware.
     if req.query_string:
         return HTTPBadRequest(request=req)
     if not self.app.allow_account_management:
         return HTTPMethodNotAllowed(request=req, headers={"Allow": ", ".join(self.allowed_methods)})
     account_partition, accounts = self.app.account_ring.get_nodes(self.account_name)
     headers = self.generate_request_headers(req)
     clear_info_cache(self.app, req.environ, self.account_name)
     resp = self.make_requests(
         req, self.app.account_ring, account_partition, "DELETE", req.swift_entity_path, [headers] * len(accounts)
     )
     return resp
开发者ID:anishnarang,项目名称:gswift-multinode,代码行数:16,代码来源:account.py


示例14: PUT

 def PUT(self, req):
     """HTTP PUT request handler."""
     if not self.app.allow_account_management:
         return HTTPMethodNotAllowed(request=req, headers={"Allow": ", ".join(self.allowed_methods)})
     error_response = check_metadata(req, "account")
     if error_response:
         return error_response
     if len(self.account_name) > MAX_ACCOUNT_NAME_LENGTH:
         resp = HTTPBadRequest(request=req)
         resp.body = "Account name length of %d longer than %d" % (len(self.account_name), MAX_ACCOUNT_NAME_LENGTH)
         return resp
     account_partition, accounts = self.app.account_ring.get_nodes(self.account_name)
     headers = self.generate_request_headers(req, transfer=True)
     clear_info_cache(self.app, req.environ, self.account_name)
     resp = self.make_requests(
         req, self.app.account_ring, account_partition, "PUT", req.path_info, [headers] * len(accounts)
     )
     return resp
开发者ID:Dieterbe,项目名称:swift,代码行数:18,代码来源:account.py


示例15: PUT

 def PUT(self, req):
     """HTTP PUT request handler."""
     error_response = \
         self.clean_acls(req) or check_metadata(req, 'container')
     if error_response:
         return error_response
     policy_index = self._convert_policy_to_index(req)
     if not req.environ.get('swift_owner'):
         for key in self.app.swift_owner_headers:
             req.headers.pop(key, None)
     if len(self.container_name) > constraints.MAX_CONTAINER_NAME_LENGTH:
         resp = HTTPBadRequest(request=req)
         resp.body = 'Container name length of %d longer than %d' % \
                     (len(self.container_name),
                      constraints.MAX_CONTAINER_NAME_LENGTH)
         return resp
     account_partition, accounts, container_count = \
         self.account_info(self.account_name, req)
     if not accounts and self.app.account_autocreate:
         self.autocreate_account(req.environ, self.account_name)
         account_partition, accounts, container_count = \
             self.account_info(self.account_name, req)
     if not accounts:
         return HTTPNotFound(request=req)
     if self.app.max_containers_per_account > 0 and \
             container_count >= self.app.max_containers_per_account and \
             self.account_name not in self.app.max_containers_whitelist:
         resp = HTTPForbidden(request=req)
         resp.body = 'Reached container limit of %s' % \
                     self.app.max_containers_per_account
         return resp
     container_partition, containers = self.app.container_ring.get_nodes(
         self.account_name, self.container_name)
     headers = self._backend_requests(req, len(containers),
                                      account_partition, accounts,
                                      policy_index)
     clear_info_cache(self.app, req.environ,
                      self.account_name, self.container_name)
     resp = self.make_requests(
         req, self.app.container_ring,
         container_partition, 'PUT', req.swift_entity_path, headers)
     return resp
开发者ID:701,项目名称:swift,代码行数:42,代码来源:container.py


示例16: POST

    def POST(self, req):
        """HTTP POST request handler."""
        error_response = \
            self.clean_acls(req) or check_metadata(req, 'container')
        if error_response:
            return error_response
        if not req.environ.get('swift_owner'):
            for key in self.app.swift_owner_headers:
                req.headers.pop(key, None)
        account_partition, accounts, container_count = \
            self.account_info(self.account_name, req)
        if not accounts:
            return HTTPNotFound(request=req)

        headers = self.generate_request_headers(req, transfer=True)
        clear_info_cache(self.app, req.environ,
                         self.account_name, self.container_name)

        resp = self.get_container_post_resp(req, headers)
        return resp
开发者ID:fvennetier,项目名称:oio-swift,代码行数:20,代码来源:container.py


示例17: PUT

    def PUT(self, req):
        """HTTP PUT request handler."""
        error_response = \
            self.clean_acls(req) or check_metadata(req, 'container')
        if error_response:
            return error_response
        if not req.environ.get('swift_owner'):
            for key in self.app.swift_owner_headers:
                req.headers.pop(key, None)
        if len(self.container_name) > constraints.MAX_CONTAINER_NAME_LENGTH:
            resp = HTTPBadRequest(request=req)
            resp.body = 'Container name length of %d longer than %d' % \
                        (len(self.container_name),
                         constraints.MAX_CONTAINER_NAME_LENGTH)
            return resp
        account_partition, accounts, container_count = \
            self.account_info(self.account_name, req)

        if not accounts and self.app.account_autocreate:
            self.autocreate_account(req, self.account_name)
            account_partition, accounts, container_count = \
                self.account_info(self.account_name, req)
        if not accounts:
            return HTTPNotFound(request=req)
        if self.app.max_containers_per_account > 0 and \
                container_count >= self.app.max_containers_per_account and \
                self.account_name not in self.app.max_containers_whitelist:
            container_info = \
                self.container_info(self.account_name, self.container_name,
                                    req)
            if not is_success(container_info.get('status')):
                resp = HTTPForbidden(request=req)
                resp.body = 'Reached container limit of %s' % \
                    self.app.max_containers_per_account
                return resp

        headers = self.generate_request_headers(req, transfer=True)
        clear_info_cache(self.app, req.environ, self.account_name,
                         self.container_name)
        resp = self.get_container_create_resp(req, headers)
        return resp
开发者ID:fvennetier,项目名称:oio-swift,代码行数:41,代码来源:container.py


示例18: POST

 def POST(self, req):
     """HTTP POST request handler."""
     if len(self.account_name) > MAX_ACCOUNT_NAME_LENGTH:
         resp = HTTPBadRequest(request=req)
         resp.body = "Account name length of %d longer than %d" % (len(self.account_name), MAX_ACCOUNT_NAME_LENGTH)
         return resp
     error_response = check_metadata(req, "account")
     if error_response:
         return error_response
     account_partition, accounts = self.app.account_ring.get_nodes(self.account_name)
     headers = self.generate_request_headers(req, transfer=True)
     clear_info_cache(self.app, req.environ, self.account_name)
     resp = self.make_requests(
         req, self.app.account_ring, account_partition, "POST", req.path_info, [headers] * len(accounts)
     )
     if resp.status_int == HTTP_NOT_FOUND and self.app.account_autocreate:
         self.autocreate_account(req.environ, self.account_name)
         resp = self.make_requests(
             req, self.app.account_ring, account_partition, "POST", req.path_info, [headers] * len(accounts)
         )
     return resp
开发者ID:Dieterbe,项目名称:swift,代码行数:21,代码来源:account.py


示例19: DELETE

    def DELETE(self, req):
        """HTTP DELETE request handler."""
	print 'in DELETE function of accountcontroller class'
        # Extra safety in case someone typos a query string for an
        # account-level DELETE request that was really meant to be caught by
        # some middleware.
        if req.query_string:
            return HTTPBadRequest(request=req)
        if not self.app.allow_account_management:
            return HTTPMethodNotAllowed(
                request=req,
                headers={'Allow': ', '.join(self.allowed_methods)})
        account_partition, accounts = \
            self.app.account_ring.get_nodes(self.account_name)
	print 'account_partition, accounts',account_partition,accounts
        headers = self.generate_request_headers(req)
        clear_info_cache(self.app, req.environ, self.account_name)
        resp = self.make_requests(
            req, self.app.account_ring, account_partition, 'DELETE',
            req.swift_entity_path, [headers] * len(accounts))
	print 'resp',resp
	'in DELETE function of accountcontroller class END'
        return resp
开发者ID:jannatunnoor,项目名称:test_swift,代码行数:23,代码来源:account.py


示例20: PUT

 def PUT(self, req):
     """HTTP PUT request handler."""
     if not self.app.allow_account_management:
         return HTTPMethodNotAllowed(
             request=req,
             headers={'Allow': ', '.join(self.allowed_methods)})
     error_response = check_metadata(req, 'account')
     if error_response:
         return error_response
     length_limit = self.get_name_length_limit()
     if len(self.account_name) > length_limit:
         resp = HTTPBadRequest(request=req)
         resp.body = b'Account name length of %d longer than %d' % \
                     (len(self.account_name), length_limit)
         return resp
     account_partition, accounts = \
         self.app.account_ring.get_nodes(self.account_name)
     headers = self.generate_request_headers(req, transfer=True)
     clear_info_cache(self.app, req.environ, self.account_name)
     resp = self.make_requests(
         req, self.app.account_ring, account_partition, 'PUT',
         req.swift_entity_path, [headers] * len(accounts))
     self.add_acls_from_sys_metadata(resp)
     return resp
开发者ID:mahak,项目名称:swift,代码行数:24,代码来源:account.py



注:本文中的swift.proxy.controllers.base.clear_info_cache函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python base.get_account_info函数代码示例发布时间:2022-05-27
下一篇:
Python server.DiskFile类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap