From: Kefu Chai Date: Mon, 6 Apr 2020 08:55:05 +0000 (+0800) Subject: qa/tasks/radosgw_admin.py: do not use dict.has_keys() X-Git-Tag: v14.2.10~17^2~58 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=77a88c87fc9d3d036341325317c64345b037ceb9;p=ceph.git qa/tasks/radosgw_admin.py: do not use dict.has_keys() in python3, `dict.has_key()` was removed. let's use __contains__ instead. Signed-off-by: Kefu Chai (cherry picked from commit 590e9b35aa86ab3e70561a8ecde21da2729dafb3) --- diff --git a/qa/tasks/radosgw_admin.py b/qa/tasks/radosgw_admin.py index fbe76582a4c4b..d8cde603365a5 100644 --- a/qa/tasks/radosgw_admin.py +++ b/qa/tasks/radosgw_admin.py @@ -98,7 +98,7 @@ class usage_acc: def update(self, c, cat, user, out, b_in, err): x = self.c2x(c, cat) usage_acc_update2(x, out, b_in, err) - if not err and cat == 'create_bucket' and not x.has_key('owner'): + if not err and cat == 'create_bucket' and 'owner' not in x: x['owner'] = user def make_entry(self, cat, bucket, user, out, b_in, err): if cat == 'create_bucket' and err: @@ -116,7 +116,7 @@ class usage_acc: def get_usage(self): return self.results def compare_results(self, results): - if not results.has_key('entries') or not results.has_key('summary'): + if 'entries' not in results or 'summary' not in results: return ['Missing entries or summary'] r = [] for e in self.results['entries']: