From 21d73053d1ea3ee44ee81f342836d1679f1beffc Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 6 Apr 2020 14:52:02 +0800 Subject: [PATCH] qa/tasks/radosgw_admin: use HTTPMessage as a dict in PY3 in Python3, HTTPMessage is a dict-like class by itself, and it does not offer `dict` attribute anymore. Signed-off-by: Kefu Chai (cherry picked from commit 4a9c43313acbd26d33364a43b2835e561ceb259b) --- qa/tasks/radosgw_admin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qa/tasks/radosgw_admin.py b/qa/tasks/radosgw_admin.py index c7ef3ad87f252..86564da1c63f1 100644 --- a/qa/tasks/radosgw_admin.py +++ b/qa/tasks/radosgw_admin.py @@ -214,8 +214,9 @@ class requestlog_queue(): 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']) + msg = j['i'].msg if six.PY3 else j['i'].msg.dict + if 'content-length'in msg: + bytes_in = int(msg['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'])) if add_entry == None: -- 2.39.5