Commit Graph

110286 Commits

Author SHA1 Message Date
Kefu Chai
65823a9e23
Merge pull request #34383 from matthewoliver/older-tox
tox: Fix the tox.ini's to support older versions of tox

Reviewed-by: Michael Fritch <mfritch@suse.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-04-08 09:56:24 +08:00
Kefu Chai
b28a1dacc0
Merge pull request #34427 from smithfarm/wip-44964
spec: address some warnings raised by RPM 4.15.1

Reviewed-by: Boris Ranto <branto@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
2020-04-08 09:54:33 +08:00
Kefu Chai
f1375de3eb
Merge pull request #33945 from rishabh-d-dave/fs-qa-vstart_runner.LocalRemote.sh
qa/vstart_runner: update vstart_runner.LocalRemote.sh

Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
2020-04-08 09:53:32 +08:00
Yuri Weinstein
7c2a0a455e
Merge pull request #34456 from ceph/wip-crontab-master
qa/tests: removed ceph-deploy from master and octopus (ceph-deploy is…
2020-04-07 17:29:05 -07:00
yuriw
2dc7af0f0f qa/tests: removed ceph-deploy from master and octopus (ceph-deploy isn't written to run on el8)
Signed-off-by: yuriw <yuri.weinstein@gmail.com>
2020-04-07 16:47:56 -07:00
Sebastian Wagner
6745b0ddcd
Merge pull request #34439 from jschmid1/osdspec_encrypted_docs
docs/cephadm: <encrypted> is a global flag

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-04-08 00:01:59 +02:00
Sebastian Wagner
aeb601bd37
Merge pull request #34053 from matthewoliver/iscsi-cephadm
cephadm: Add ceph-iscsi

Reviewed-by: Michael Fritch <mfritch@suse.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-04-07 23:49:06 +02:00
Sebastian Wagner
b1d5172c0d
Merge pull request #34357 from mgfritch/mgr-orch-test-warn
mgr/orch: fix python3 DeprecationWarning

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
2020-04-07 23:48:32 +02:00
Michael Fritch
3848ec26bf
qa/workunits/cephadm/test_cephadm.sh: add fsid to ceph-volume cmds
needed when testing with a multi-cluster setup

Signed-off-by: Michael Fritch <mfritch@suse.com>
2020-04-07 15:27:35 -06:00
Ernesto Puerta
2e790c1fbc
mgr/dashboard: use FQDN for failover redirection
Fixes: https://tracker.ceph.com/issues/44923
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
2020-04-07 19:36:40 +02:00
Kefu Chai
b1738cd1ef qa/standalone/scrub: s/$(pgid)/${pgid}/
to address the test failures like
```
2020-04-07T15:44:58.693 INFO:tasks.workunit.client.0.smithi049.stderr:/home/ubuntu/cephtest/clone.client.0/qa/standalone/scrub/osd-scrub-repair.sh:498: TEST_auto_repair_bluestore_failed:  ceph pg dump
pgs
2020-04-07T15:44:58.694 INFO:tasks.workunit.client.0.smithi049.stderr://home/ubuntu/cephtest/clone.client.0/qa/standalone/scrub/osd-scrub-repair.sh:498: TEST_auto_repair_bluestore_failed:  pgid
2020-04-07T15:44:58.694 INFO:tasks.workunit.client.0.smithi049.stderr:/home/ubuntu/cephtest/clone.client.0/qa/standalone/scrub/osd-scrub-repair.sh: line 498: pgid: command not found
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-08 00:54:46 +08:00
Alfonso Martínez
81d1e80d25 mgr/dashboard: fix errors related to frontend service subscriptions.
- Created TimerService: for getting a scheduled observable that checks if there are any observers subscribed before sending a request.
Now FeatureTogglesService uses it internally (solving a hidden bug in it).
- SummaryService & RbdMirroringService: instead of having window.setInterval/setTimeout tasks launched in constructor, now they have a method for polling (and subscribing to it). These methods are called in the appropriate component so we unsubscribe properly.
- Fixed: some subscriptions were not being unsubscribed properly.
- RbdFormComponent: little refactoring and fixed (also improved) unit tests.

Fixes: https://tracker.ceph.com/issues/44228
Signed-off-by: Alfonso Martínez <almartin@redhat.com>
2020-04-07 18:07:54 +02:00
Ernesto Puerta
d8d3b33633
rpm: add python3-saml as install dependency
`python.*-saml` is required for Ceph-Dashboard SSO support (optional
feature).

Fixes: https://tracker.ceph.com/issues/44721
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
2020-04-07 18:06:26 +02:00
Kefu Chai
6eb57a2a4f qa/tasks/cephadm.py: decode data returned by teuthology.get_file()
it's used as part of the command line sent to shell, so we need to
decode it first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 23:06:20 +08:00
Ishan Rai
7b6c2ac00e mgr/dashboard: Clean up HTML
cleaned up BootstrapCreateModalComponent and footers

Fixes: https://tracker.ceph.com/issues/44848

Signed-off-by: Ishan Rai <ishanrai05@gmail.com>
2020-04-07 19:35:07 +05:30
Lenz Grimmer
da52df8a8d
Merge pull request #34396 from tspmelo/wip-npm-hacking
mgr/dashboard: Update HACKING.rst

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Kiefer Chang <kiefer.chang@suse.com>
Reviewed-by: Stephan Müller <smueller@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Volker Theile <vtheile@suse.com>
2020-04-07 15:54:39 +02:00
Kefu Chai
23ddf03d26 test/rgw/rgw_multi: return (str, int) from make_request()
so its consumer can feed the returned str to json.loads()

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
6c2f40a528 qa/tasks/mgr: s/urllib.quote_plus/parse.quote_plus/
in Python3, urllib.quote_plus is moved into urllib.parse, let's use
six.moves at this moment.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
4e87fcfea0 test/rgw/rgw_multi: s/urllib.urlencode/urlparse.urlencode/
urllib in python3 does not offer urlencode anymore, so let's use
six.moves.parse now.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
adfcf08588 test/rgw/rgw_multi: pass bytes to hmac.new()
in Python3, `key` passed to `hmac.new()` should be bytes or bytearray

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
96ed9c87c0 qa/tasks/radosgw_admin.py: coerce key.name and key.acl to str
if `key.name` is not set, boto fills it with md5, in that case, it comes
from `base64.b64encode()`. so we need to make sure it's str before
passing it to shell.

the same applies to `key.get_xml_acl()`, as its return value comes
directly from something like
```
        response = self.connection.make_request('GET', self.name, key_name,
                                                query_args=query_args,
                                                headers=headers)
        body = response.read()
        # ...
        return body
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
ea63b52b17 test/rgw/rgw_multi/tests.py: decode retval of bucket.get_policy()
return value of bucket.get_policy() is a bytes, so we need to decode it
before comparing it with a string, since the content of policy is ASCII,
it'd be suffice to decode it with 'ascii'.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
fcf4de3855 test/rgw: pass encoding to Key.get_content_as_string()
we assume that boto.Key.get_content_as_string() returns str instead of
bytes, and compare the return value with a string, so, to ensure that
lhs and rhs are both strings, we need to decode the returned content.

since we always store strings composed with ASCII, it's safe to use
'ascii' to decode them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
9ccf88d95f qa/tasks: pass encoding to Key.get_content_as_string()
we assume that boto.Key.get_content_as_string() returns str instead of
bytes, and compare the return value with a string, so, to ensure that
lhs and rhs are both strings, we need to decode the returned content.

since we always store strings composed with ASCII, it's safe to use
'ascii' to decode them.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
dcecf1dbe4 qa/tasks/s3tests_java.py: do not change a dict while iterating it
in Python3, dict.items() returns a view instead of an instance of list,
so we have to materialize the view for changing the dict being iterated.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
3809737fb8 qa/tasks/ragweed.py: open file in text mode
this file is a template for `boto.cfg` which only contains text, so we
can just open it in text mode, and the file-like object will be passed
to run() as stdin, which is able to consume strings.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
91b49ab39d qa,test: decode return val of base64.b64encode()
base64.b64encode() returns bytes in Python3, and we will pass it as a
commandline parameter later on, which will be quoted. so the command
line can be consumed by shell. so before sending it to shell, we should
convert it to string.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
c79e1e1a52 qa/tasks/barbican.py: convert to str before json.loads()
in Python3, json.loads() expects a string, while
HTTPConnection.getresponse() returns a byte-like object, so we need to
coerce it to str first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
590e9b35aa 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 <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
5ef3a5fe32 qa/tasks/tempest.py: always write str is value of options
in Python2, ConfigParser is almost the same as RawConfigParser, which
allows set non-string values, but in Python3, ConfigParser.set() only
accepts strings as value of option.

since we do not use "cpar" as an internal storage for options, it does
not matter what type of options we set using ConfigParser as long as it
can be consumed by tempest. boolean settings are translated to "true" or
"false". see also
https://docs.openstack.org/tempest/latest/sampleconf.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
b1726bfb08 qa/tasks/tempest.py: use configparser from six.moves
as ConfigParser is offerd by `configparser` module in Python3, so use
six.moves before the migration.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
6ad2ca9767 qa/tasks/ragweed.py: use str methods of helper from string module
in Python3, some methods offered by `string` module are now member
method of `str` class, and `string.uppercase` is renamed to
`string.ascii_uppercase` in Python2 and Python3. so let's update
accordingly.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
7202d8a72c test/rgw/rgw_multi: do not decode a str
`s` comes from `rgwadmin()`, which passes `StringIO` as stdout, so the
the output should an instance of `str` in both Python2 and Python3.
hence there is no need to decode it using UTF-8 codecs again.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
4a9c43313a 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 <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
35a3d5f7f8 qa/tasks/keystone.py: use list(a_dict) for concatenating lists
`dict.items()` does not return a list in python3, so we need to convert
it to a list first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
5d0dc8346c qa/tasks/util/rgw: use StringIO for capturing strings
this change should address the failure of
```
2020-04-06T03:07:59.152 ERROR:teuthology.contextutil:Saw exception from nested tasks
Traceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/teuthology/contextutil.py", line 32, in nested
    vars.append(enter())
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/rgw.py", line 266, in configure_compression
    rgwadmin(ctx, client, cmd=['user', 'list'], check_status=True)
  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/util/rgw.py", line 43, in rgwadmin
    j = json.loads(out)
  File "/usr/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
981ad34987 qa/tasks/cephfs/test_cephfs_shell: assertRegex(text, regex)
per Python3 doc of unittest,

> assertRegex(text, regex, msg=None)

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:23 +08:00
Kefu Chai
7f48f61bdc qa/tasks/cephfs: return ascii decoded xattr
as callers of `TestForwardScrub._read_str_xattr()` expects str.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
162be92106 qa/tasks/cephfs: cast mds_recall_warning_decay_rate to float
this change should address the failure of
```
2020-04-05T15:14:23.088 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T15:14:23.088 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_client_limits.py", line 110, in test_client_pin_mincaps
2020-04-05T15:14:23.089 INFO:tasks.cephfs_test_runner:    self._test_client_pin(True, 200)
2020-04-05T15:14:23.089 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_client_limits.py", line 71, in _test_client_pin
2020-04-05T15:14:23.090 INFO:tasks.cephfs_test_runner:    self.wait_for_health("MDS_CLIENT_RECALL", mds_recall_warning_decay_rate*2)
2020-04-05T15:14:23.091 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/ceph_test_case.py", line 152, in wait_for_health
2020-04-05T15:14:23.091 INFO:tasks.cephfs_test_runner:    self.wait_until_true(seen_health_warning, timeout)
2020-04-05T15:14:23.092 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/ceph_test_case.py", line 193, in wait_until_true
2020-04-05T15:14:23.093 INFO:tasks.cephfs_test_runner:    if elapsed >= timeout:
2020-04-05T15:14:23.093 INFO:tasks.cephfs_test_runner:TypeError: unorderable types: int() >= str()
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
20dafc6d52 qa/tasks/cephfs: allow caller to use BytesIO when calling rados()
when the caller expects binary data, it should pass BytesIO as stdout.

this change shold address the failure of
```
2020-04-05T12:47:25.335 INFO:tasks.cephfs_test_runner:======================================================================
2020-04-05T12:47:25.336 INFO:tasks.cephfs_test_runner:ERROR: test_apply_tag (tasks.cephfs.test_forward_scrub.TestForwardScrub)
2020-04-05T12:47:25.336 INFO:tasks.cephfs_test_runner:----------------------------------------------------------------------
2020-04-05T12:47:25.336 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T12:47:25.337 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_forward_scrub.py", line 75, in test_apply_tag
2020-04-05T12:47:25.337 INFO:tasks.cephfs_test_runner:    self.assertTagged(inos[dirpath], tag, self.fs.get_metadata_pool_name())
2020-04-05T12:47:25.337 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_forward_scrub.py", line 98, in assertTagged
2020-04-05T12:47:25.338 INFO:tasks.cephfs_test_runner:    "scrub_tag"
2020-04-05T12:47:25.338 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_forward_scrub.py", line 35, in _read_str_xattr
2020-04-05T12:47:25.339 INFO:tasks.cephfs_test_runner:    strlen = struct.unpack('i', output[0:4])[0]
2020-04-05T12:47:25.339 INFO:tasks.cephfs_test_runner:TypeError: a bytes-like object is required, not 'str'
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
eb2c6b3740 qa/tasks/cephfs: use BytesIO for capturing binary
this change partially reverts e46eb8348e.

xattrs could contain non-utf8 encoded data, and should be captured using
BytesIO. moreover, it will be fed to `ceph-dencoder`, which expects
binary when performing "import".

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
51fc7a9922 qa/tasks/fs.py: use six.viewitems()
in python3, dict.viewitems() is replaced with dict.items().

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
21d6c5a95b qa/tasks/cephfs: use assertCountEqual if PY3
assertItemsEqual is renamed to assertCountEqual in Python3.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
83e41daec4 qa/tasks/cephfs: compare number with number
to address following failure:
```
2020-04-05T12:25:30.997 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T12:25:30.997 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_misc.py", line 50, in test_root_rctime
2020-04-05T12:25:30.998 INFO:tasks.cephfs_test_runner:    self.assertGreaterEqual(rctime, t-10)
2020-04-05T12:25:30.998 INFO:tasks.cephfs_test_runner:  File "/usr/lib/python3.5/unittest/case.py", line 1215, in assertGreaterEqual
2020-04-05T12:25:30.998 INFO:tasks.cephfs_test_runner:    if not a >= b:
2020-04-05T12:25:30.999 INFO:tasks.cephfs_test_runner:TypeError: unorderable types: str() >= float()
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
40d0356249 qa/tasks/cephfs: do no radom.sample(a_dict)
collect the keys instead of filtering a dict,
to address following failure:
```
2020-04-05T12:15:36.275 INFO:tasks.cephfs_test_runner:Traceback (most recent call last):
2020-04-05T12:15:36.275 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_strays.py", line 29, in test_files_throttle
2020-04-05T12:15:36.275 INFO:tasks.cephfs_test_runner:    self._test_throttling(self.FILES_THROTTLE)
2020-04-05T12:15:36.276 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_strays.py", line 96, in _test_throttling
2020-04-05T12:15:36.276 INFO:tasks.cephfs_test_runner:    return self._do_test_throttling(throttle_type)
2020-04-05T12:15:36.278 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/test_strays.py", line 176, in _do_test_throttling
2020-04-05T12:15:36.278 INFO:tasks.cephfs_test_runner:    mds_max_purge_ops = int(self.fs.get_config("mds_max_purge_ops", 'mds'))
2020-04-05T12:15:36.279 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/cephfs/filesystem.py", line 285, in get_config
2020-04-05T12:15:36.279 INFO:tasks.cephfs_test_runner:    service_id = random.sample(filter(lambda i: self.mds_daemons[i].running(), self.mds_daemons), 1)[0]
2020-04-05T12:15:36.280 INFO:tasks.cephfs_test_runner:  File "/home/teuthworker/src/git.ceph.com_git_teuthology_py3/virtualenv/lib/python3.5/random.py", line 311, in sample
2020-04-05T12:15:36.280 INFO:tasks.cephfs_test_runner:    raise TypeError("Population must be a sequence or set.  For dicts, use list(d).")
2020-04-05T12:15:36.280 INFO:tasks.cephfs_test_runner:TypeError: Population must be a sequence or set.  For dicts, use list(d).
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Kefu Chai
8bfe977854 qa/tasks: use StringIO for capturing string output
see d8d44ed156

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 21:51:22 +08:00
Jan Fajerski
2822c53ef6
Merge pull request #34412 from jan--f/c-v-fix-simple-scan-log-string
devices/simple/scan: Fix string in log statement
2020-04-07 15:37:09 +02:00
Kefu Chai
253fc93180 test/rgw: use "a // b" instead of "a / b"
for expressions where the value is expected to be integer. as in
python3, `a / b` returns a float.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kefu Chai
2089bf04b9 qa/tasks: use "a // b" instead of "a / b"
for expressions where the value is expected to be integer. as in
python3, `a / b` returns a float.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00
Kefu Chai
9ca45bd942 qa/tasks: do not random.choice(a_view)
use `random.sample()` instead of `random.choice(list(a_view))` for better performance.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-04-07 20:33:47 +08:00