]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: radosgw-admin: remove dependency on bunch package 32215/head
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 7 Dec 2019 09:12:19 +0000 (01:12 -0800)
committerNathan Cutler <ncutler@suse.com>
Thu, 12 Dec 2019 14:59:48 +0000 (15:59 +0100)
Fixes: https://tracker.ceph.com/issues/43184
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 1bf21326aa7f8eaafd7049b44eb73aeb36bcc5d7)

qa/tasks/radosgw_admin.py

index f23a3b9ef409202299a8a045d4eaeecb492282fd..57857949f613527df2c2e72b56a26260c4a272a7 100644 (file)
@@ -16,7 +16,6 @@ import logging
 import time
 import datetime
 import Queue
-import bunch
 
 import sys
 
@@ -207,7 +206,7 @@ class requestlog_queue():
            pass
        elif response.status < 200 or response.status >= 400:
            error = True
-        self.q.put(bunch.Bunch({'t': now, 'o': request, 'i': response, 'e': error}))
+        self.q.put({'t': now, 'o': request, 'i': response, 'e': error})
     def clear(self):
         with self.q.mutex:
             self.q.queue.clear()
@@ -215,16 +214,16 @@ class requestlog_queue():
         while not self.q.empty():
             j = self.q.get()
            bytes_out = 0
-            if 'Content-Length' in j.o.headers:
-               bytes_out = int(j.o.headers['Content-Length'])
+            if 'Content-Length' in j['o'].headers:
+               bytes_out = int(j['o'].headers['Content-Length'])
             bytes_in = 0
-            if 'content-length' in j.i.msg.dict:
-               bytes_in = int(j.i.msg.dict['content-length'])
+            if 'content-length' in j['i'].msg.dict:
+               bytes_in = int(j['i'].msg.dict['content-length'])
             log.info('RL: %s %s %s bytes_out=%d bytes_in=%d failed=%r'
-               % (cat, bucket, user, bytes_out, bytes_in, j.e))
+               % (cat, bucket, user, bytes_out, bytes_in, j['e']))
            if add_entry == None:
                add_entry = self.adder
-           add_entry(cat, bucket, user, bytes_out, bytes_in, j.e)
+           add_entry(cat, bucket, user, bytes_out, bytes_in, j['e'])
 
 def create_presigned_url(conn, method, bucket_name, key_name, expiration):
     return conn.generate_url(expires_in=expiration,