From: Yehuda Sadeh Date: Sat, 7 Dec 2019 09:12:19 +0000 (-0800) Subject: qa: radosgw-admin: remove dependency on bunch package X-Git-Tag: v15.1.0~588^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1bf21326aa7f8eaafd7049b44eb73aeb36bcc5d7;p=ceph-ci.git qa: radosgw-admin: remove dependency on bunch package Fixes: https://tracker.ceph.com/issues/43184 Signed-off-by: Yehuda Sadeh --- diff --git a/qa/tasks/radosgw_admin.py b/qa/tasks/radosgw_admin.py index ce551e5c298..6dab13f058f 100644 --- a/qa/tasks/radosgw_admin.py +++ b/qa/tasks/radosgw_admin.py @@ -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,