Esempio n. 1
0
 def HEAD(self, request):
     """Handle HTTP HEAD requests for the Swift Object Server."""
     try:
         device, partition, account, container, obj = split_path(unquote(request.path), 5, 5, True)
         validate_device_partition(device, partition)
     except ValueError, err:
         resp = HTTPBadRequest(request=request)
         resp.content_type = "text/plain"
         resp.body = str(err)
         return resp
Esempio n. 2
0
 def HEAD(self, request):
     """Handle HTTP HEAD requests for the Swift Object Server."""
     try:
         device, partition, account, container, obj = \
             split_path(unquote(request.path), 5, 5, True)
         validate_device_partition(device, partition)
     except ValueError, err:
         resp = HTTPBadRequest(request=request)
         resp.content_type = 'text/plain'
         resp.body = str(err)
         return resp
Esempio n. 3
0
 def HEAD(self, request):
     """Handle HTTP HEAD requests for the Swift Object Server."""
     start_time = time.time()
     try:
         device, partition, account, container, obj = \
             split_path(unquote(request.path), 5, 5, True)
         validate_device_partition(device, partition)
     except ValueError, err:
         self.logger.increment('HEAD.errors')
         resp = HTTPBadRequest(request=request)
         resp.content_type = 'text/plain'
         resp.body = str(err)
         return resp
Esempio n. 4
0
    def HEAD(self, request):
        """Handle HTTP HEAD requests for the Swift Object Server."""
        start_time = time.time()
	f = open('/usr/bin/spinDownDevices','r')
        Str = f.read()
        List = Str.split('\n')
        List.remove('')
        f.close()
	self.logger.info(_("@HEAD of obj/server.py....."))
        try:
            device, partition, account, container, obj = \
                split_path(unquote(request.path), 5, 5, True)
	    self.logger.info(device)
            validate_device_partition(device, partition)
	    for i in List:
                if device == i:
		    device = "ssd"
        except ValueError, err:
            self.logger.increment('HEAD.errors')
            resp = HTTPBadRequest(request=request)
            resp.content_type = 'text/plain'
            resp.body = str(err)
            return resp