]> git.apps.os.sepia.ceph.com Git - ceph.git/log
ceph.git
5 years agotests: update unmap.t for table spacing changes 34494/head
Ilya Dryomov [Thu, 9 Apr 2020 10:41:34 +0000 (12:41 +0200)]
tests: update unmap.t for table spacing changes

Introduced in 4d42b4c5a0ed ("common/TextTable: default to 2 spaces
separating columns") and 41f003518a07 ("common/TextTable: only pad
between columns").

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
5 years agoMerge pull request #34471 from idryomov/wip-rbd-fio-rstrip
Ilya Dryomov [Thu, 9 Apr 2020 09:37:14 +0000 (11:37 +0200)]
Merge pull request #34471 from idryomov/wip-rbd-fio-rstrip

qa/tasks/rbd_fio: unbreak after the conversion from StringIO

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34408 from dillaman/wip-44727
Mykola Golub [Thu, 9 Apr 2020 07:13:57 +0000 (10:13 +0300)]
Merge pull request #34408 from dillaman/wip-44727

rbd-mirror: improved replication statistics

Reviewed-by: Mykola Golub <mgolub@suse.com>
5 years agoMerge pull request #34264 from tchaikov/wip-qa-py3
Kefu Chai [Thu, 9 Apr 2020 02:08:44 +0000 (10:08 +0800)]
Merge pull request #34264 from tchaikov/wip-qa-py3

qa/tasks: be python3 compatible

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
5 years agoMerge pull request #34284 from liewegas/followon-34266-cleanup
Kefu Chai [Thu, 9 Apr 2020 00:39:27 +0000 (08:39 +0800)]
Merge pull request #34284 from liewegas/followon-34266-cleanup

mgr/DaemonServer: add missing ceph_abort

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34414 from yuvalif/add_timeout_to_http_client
Casey Bodley [Wed, 8 Apr 2020 19:35:11 +0000 (15:35 -0400)]
Merge pull request #34414 from yuvalif/add_timeout_to_http_client

rgw/http: add timeout to http client

Reviewed-by: Casey Bodley <cbodley@redhat.com>
5 years agoMerge pull request #34463 from jan--f/c-v-batch-filter-check-lvs-before-access
Jan Fajerski [Wed, 8 Apr 2020 16:07:06 +0000 (18:07 +0200)]
Merge pull request #34463 from jan--f/c-v-batch-filter-check-lvs-before-access

ceph-volume/batch: check lvs list before access

5 years agoMerge pull request #34472 from jan--f/c-v-noninteractive-batch-idempotency-all-filtered
Jan Fajerski [Wed, 8 Apr 2020 15:14:24 +0000 (17:14 +0200)]
Merge pull request #34472 from jan--f/c-v-noninteractive-batch-idempotency-all-filtered

ceph-volume/batch: return success when all devices are filtered

5 years agorbd-mirror: fixed race condition with snapshot sync and shutdown 34408/head
Jason Dillaman [Tue, 7 Apr 2020 16:13:46 +0000 (12:13 -0400)]
rbd-mirror: fixed race condition with snapshot sync and shutdown

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
5 years agoceph-volume/batch: return success when all devices are filtered 34472/head
Jan Fajerski [Wed, 8 Apr 2020 09:55:57 +0000 (11:55 +0200)]
ceph-volume/batch: return success when all devices are filtered

batch should only return an error if some (but not all) devices are
filtered. When only some devices are filtered the resulting osd layout
could look very different from what a user expects. If all devies are
filtered just return success.

Fixes: https://tracker.ceph.com/issues/44994
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
5 years agomgr/telegraf: catch FileNotFoundError exception 34264/head
Kefu Chai [Wed, 8 Apr 2020 12:21:25 +0000 (20:21 +0800)]
mgr/telegraf: catch FileNotFoundError exception

in tasks/module_selftest.yaml, `TestModuleSelftest.test_telegraf()` is
called. but we fail to prepare a unix domain socket to which the telegraf
module can send stats. and telegraf module does not catch
FileNotFoundError exception, so the exception is populated to ceph-mgr
and is found by the test, hence the test is marked a failure whenever
telegraf is tested.

in this change,

* catch this exception, so it won't be caught by ceph-mgr
* whitelist the error message, so the test can pass

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa/tasks/openssl_keys.py: sort cert configs before creating certs
Kefu Chai [Wed, 8 Apr 2020 11:22:06 +0000 (19:22 +0800)]
qa/tasks/openssl_keys.py: sort cert configs before creating certs

we cannot rely on the order in which items are arranged in a dict, the
order varies from version to another. in Python2, it happens to work,
and we can always have the self-signed cert added first. but in Python3,
it does not. and an exception is thrown
```
teuthology.exceptions.ConfigError: ssl: ca root not found for
certificate rgw.client.0
```

in this change, before creating certs, the settings are reordered so
that the self-signed ones are created first.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34398 from rzarzynski/wip-crimson-outdata-to-pglog
Kefu Chai [Wed, 8 Apr 2020 13:03:31 +0000 (21:03 +0800)]
Merge pull request #34398 from rzarzynski/wip-crimson-outdata-to-pglog

crimson/osd: record op's outdata and rval in pg log

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34466 from tchaikov/wip-cmake-get-git-version
Kefu Chai [Wed, 8 Apr 2020 12:29:08 +0000 (20:29 +0800)]
Merge pull request #34466 from tchaikov/wip-cmake-get-git-version

cmake: check $top_srcdir/.git directly

Reviewed-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
5 years agoMerge pull request #34220 from mgfritch/cephadm-nfs-container-image
Sebastian Wagner [Wed, 8 Apr 2020 11:46:00 +0000 (13:46 +0200)]
Merge pull request #34220 from mgfritch/cephadm-nfs-container-image

mgr/cephadm: allow config for an nfs `container_image`

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
5 years agoMerge pull request #34422 from dillaman/wip-44938
Mykola Golub [Wed, 8 Apr 2020 11:23:51 +0000 (14:23 +0300)]
Merge pull request #34422 from dillaman/wip-44938

rbd: ignore tx-only mirror peers when adding new peers

Reviewed-by: Mykola Golub <mgolub@suse.com>
5 years agoMerge pull request #34058 from rhcs-dashboard/44228-fix-frontend-services-subscriptio...
Lenz Grimmer [Wed, 8 Apr 2020 11:17:10 +0000 (13:17 +0200)]
Merge pull request #34058 from rhcs-dashboard/44228-fix-frontend-services-subscription-errors

mgr/dashboard: fix errors related to frontend service subscriptions.

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: Laura Paduano <lpaduano@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
5 years agoqa/tasks/rbd_fio: unbreak after the conversion from StringIO 34471/head
Ilya Dryomov [Wed, 8 Apr 2020 10:24:51 +0000 (12:24 +0200)]
qa/tasks/rbd_fio: unbreak after the conversion from StringIO

Fix a bad typo in commit db7ae8eff60a ("qa/tasks/rbd_fio: get rid of
StringIO for py3").

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
5 years agocrimson/osd: record op's outdata and rval in pg log. 34398/head
Radoslaw Zarzynski [Fri, 3 Apr 2020 11:42:45 +0000 (13:42 +0200)]
crimson/osd: record op's outdata and rval in pg log.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
5 years agoosd: pg_log_entry_t::set_op_returns() takes const reference now.
Radoslaw Zarzynski [Fri, 3 Apr 2020 11:41:30 +0000 (13:41 +0200)]
osd: pg_log_entry_t::set_op_returns() takes const reference now.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
5 years agocmake: check $top_srcdir/.git directly 34466/head
Kefu Chai [Wed, 8 Apr 2020 10:00:10 +0000 (18:00 +0800)]
cmake: check $top_srcdir/.git directly

in 0437adc33a8b83847ed36666971b5ea4d88a4901, we stop right before
reaching $top_srcdir, but we should stop at its parent directory.

in this change, instead of trying to be smart and to walk all the way
up to the root directory or $top_srcdir, we just check $top_srcdir/.git
directly, as we just know it's there or it does not exist at all.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoceph-volume/batch: check lvs list before access 34463/head
Jan Fajerski [Wed, 8 Apr 2020 08:41:56 +0000 (10:41 +0200)]
ceph-volume/batch: check lvs list before access

Fixes: https://tracker.ceph.com/issues/44989
Signed-off-by: Jan Fajerski <jfajerski@suse.com>
5 years agoMerge pull request #34229 from Yan-waller/wip-walle-fixsparsereadlength
Kefu Chai [Wed, 8 Apr 2020 07:42:26 +0000 (15:42 +0800)]
Merge pull request #34229 from Yan-waller/wip-walle-fixsparsereadlength

osd/PrimaryLogPG: fix SPARSE_READ stat

Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
Reviewed-by: Neha Ojha <nojha@redhat.com>
5 years agoMerge pull request #34342 from ideepika/fixes-44862
Kefu Chai [Wed, 8 Apr 2020 07:39:48 +0000 (15:39 +0800)]
Merge pull request #34342 from ideepika/fixes-44862

mon: calculate min_size on osd pool set size

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Reviewed-by: Neha Ojha <nojha@redhat.com>
5 years agoMerge pull request #34219 from yanghonggang/bluefs-tool
Kefu Chai [Wed, 8 Apr 2020 07:34:16 +0000 (15:34 +0800)]
Merge pull request #34219 from yanghonggang/bluefs-tool

os/bluestore: Don't pollute old journal when add new device

Reviewed-by: Igor Fedotov <ifedotov@suse.com>
5 years agoMerge pull request #34143 from tchaikov/wip-mgr-disable-dne-module
Kefu Chai [Wed, 8 Apr 2020 07:32:49 +0000 (15:32 +0800)]
Merge pull request #34143 from tchaikov/wip-mgr-disable-dne-module

mon/MgrMonitor: show different error message when disabling a dne module

Reviewed-by: Neha Ojha <nojha@redhat.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
5 years agoMerge pull request #34366 from SUSE/wip-mgr-fix-python-traceback
Kefu Chai [Wed, 8 Apr 2020 07:29:34 +0000 (15:29 +0800)]
Merge pull request #34366 from SUSE/wip-mgr-fix-python-traceback

mgr/PyModule: fix missing tracebacks in handle_pyerror()

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34337 from majianpeng/throttle-remove-lock
Kefu Chai [Wed, 8 Apr 2020 07:28:04 +0000 (15:28 +0800)]
Merge pull request #34337 from majianpeng/throttle-remove-lock

common/Throttle: Don't lock for atomic type update.

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34381 from rhcs-dashboard/fix-44721-master
Kefu Chai [Wed, 8 Apr 2020 07:25:22 +0000 (15:25 +0800)]
Merge pull request #34381 from rhcs-dashboard/fix-44721-master

rpm: add python3-saml as install dependency

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34409 from adamemerson/wip-namespace-osd
Kefu Chai [Wed, 8 Apr 2020 07:20:22 +0000 (15:20 +0800)]
Merge pull request #34409 from adamemerson/wip-namespace-osd

osd: build without `using namespace` declarations in headers

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34460 from majianpeng/cmakefile-fix
Kefu Chai [Wed, 8 Apr 2020 07:07:00 +0000 (15:07 +0800)]
Merge pull request #34460 from majianpeng/cmakefile-fix

cmake: remove duplicated code.

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34451 from tchaikov/wip-standalone-pgid
Kefu Chai [Wed, 8 Apr 2020 04:50:47 +0000 (12:50 +0800)]
Merge pull request #34451 from tchaikov/wip-standalone-pgid

qa/standalone/scrub: s/$(pgid)/${pgid}/

Reviewed-by: Neha Ojha <nojha@redhat.com>
5 years agoqa/tasks/ceph_objectstore_tool.py: use str.startswit
Kefu Chai [Wed, 8 Apr 2020 04:32:54 +0000 (12:32 +0800)]
qa/tasks/ceph_objectstore_tool.py: use str.startswit

in Python3, string module does not offer `string.find()` anymore, let's
use `str.find()` method instead.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34245 from rzarzynski/wip-bug-24995
Kefu Chai [Wed, 8 Apr 2020 03:55:59 +0000 (11:55 +0800)]
Merge pull request #34245 from rzarzynski/wip-bug-24995

mgr: synchronize ClusterState's health and mon_status.

Reviewed-by: Tim Serong <tserong@suse.com>
5 years agocmake: remove duplicated code. 34460/head
Jianpeng Ma [Wed, 8 Apr 2020 03:08:02 +0000 (11:08 +0800)]
cmake: remove duplicated code.

Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
5 years agotest/rgw: upload using a NamedTemporaryFile
Kefu Chai [Wed, 8 Apr 2020 02:50:21 +0000 (10:50 +0800)]
test/rgw: upload using a NamedTemporaryFile

in boto, it tries to figure out the MIME type of a file by its name, if
the file-like objects has an attribute of "name". in Python2, the "name"
is always "<fdopen>", fortunately. while in Python3, `TemporaryFile` also
have a "name" which is its fd, and it is an integer now. so we have following
error when sending a `TemporaryFile` using
`upload_part_from_file()`:
```
2020-04-08T02:25:34.660 INFO:tasks.rgw_multisite_tests:Traceback (most recent call last):
2020-04-08T02:25:34.661 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/virtualenv/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
2020-04-08T02:25:34.661 INFO:tasks.rgw_multisite_tests:    self.test(*self.arg)
2020-04-08T02:25:34.662 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/github.com_tchaikov_ceph_wip-qa-py3/qa/tasks/rgw_multi/tests_ps.py", line 2567, in test_ps_creation_triggers
2020-04-08T02:25:34.662 INFO:tasks.rgw_multisite_tests:    uploader.upload_part_from_file(fp, 1)
2020-04-08T02:25:34.663 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/virtualenv/lib/python3.5/site-packages/boto/s3/multipart.py", line 260, in upload_part_from_file
2020-04-08T02:25:34.663 INFO:tasks.rgw_multisite_tests:    query_args=query_args, size=size)
2020-04-08T02:25:34.664 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/virtualenv/lib/python3.5/site-packages/boto/s3/key.py", line 1293, in set_contents_from_file
2020-04-08T02:25:34.664 INFO:tasks.rgw_multisite_tests:    chunked_transfer=chunked_transfer, size=size)
2020-04-08T02:25:34.664 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/virtualenv/lib/python3.5/site-packages/boto/s3/key.py", line 750, in send_file
2020-04-08T02:25:34.665 INFO:tasks.rgw_multisite_tests:    chunked_transfer=chunked_transfer, size=size)
2020-04-08T02:25:34.665 INFO:tasks.rgw_multisite_tests:  File "/home/teuthworker/src/git.ceph.com_git_teuthology_wip-py3/virtualenv/lib/python3.5/site-packages/boto/s3/key.py", line 920, in
_send_file_internal
2020-04-08T02:25:34.666 INFO:tasks.rgw_multisite_tests:    self.content_type = mimetypes.guess_type(self.path)[0]
2020-04-08T02:25:34.666 INFO:tasks.rgw_multisite_tests:  File "/usr/lib/python3.5/mimetypes.py", line 289, in guess_type
2020-04-08T02:25:34.667 INFO:tasks.rgw_multisite_tests:    return _db.guess_type(url, strict)
2020-04-08T02:25:34.667 INFO:tasks.rgw_multisite_tests:  File "/usr/lib/python3.5/mimetypes.py", line 114, in guess_type
2020-04-08T02:25:34.667 INFO:tasks.rgw_multisite_tests:    scheme, url = urllib.parse.splittype(url)
2020-04-08T02:25:34.668 INFO:tasks.rgw_multisite_tests:  File "/usr/lib/python3.5/urllib/parse.py", line 881, in splittype
2020-04-08T02:25:34.668 INFO:tasks.rgw_multisite_tests:    match = _typeprog.match(url)
2020-04-08T02:25:34.669 INFO:tasks.rgw_multisite_tests:TypeError: expected string or bytes-like object
```

to address this issue, in this change, a `NamedTemporaryFile` is used
instead of `TemporaryFile`. the former does have a "name" which is a
`str`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa/standalone/scrub: s/$(pgid)/${pgid}/
Kefu Chai [Tue, 7 Apr 2020 16:53:55 +0000 (00:53 +0800)]
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>
5 years agoqa/tasks/ceph_manager.py: do not return a filter
Kefu Chai [Tue, 7 Apr 2020 16:45:49 +0000 (00:45 +0800)]
qa/tasks/ceph_manager.py: do not return a filter

as the caller might want to `len(manager.get_osd_status()['raw'])`, and
`len()` does not accept a `filter` object.

also, the filtered osd statuses are printed out using `self.log()`, so
we should materialize the `filter` object before sending it to logging
facility. otherwise we will have something like:
```
2020-04-08T02:58:37.001 INFO:tasks.ceph.ceph_manager.ceph:<filter object at 0x7f5a080e1518>
```
in the logging message.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34368 from majianpeng/msg-remove-unsued-code
Kefu Chai [Wed, 8 Apr 2020 01:59:51 +0000 (09:59 +0800)]
Merge pull request #34368 from majianpeng/msg-remove-unsued-code

msg, common/Throttle: remove unsued code.

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34369 from smithfarm/wip-43895
Kefu Chai [Wed, 8 Apr 2020 01:57:04 +0000 (09:57 +0800)]
Merge pull request #34369 from smithfarm/wip-43895

cmake: really stop at top of source code tree

Reviewed-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34383 from matthewoliver/older-tox
Kefu Chai [Wed, 8 Apr 2020 01:56:24 +0000 (09:56 +0800)]
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>
5 years agoMerge pull request #34427 from smithfarm/wip-44964
Kefu Chai [Wed, 8 Apr 2020 01:54:33 +0000 (09:54 +0800)]
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>
5 years agoMerge pull request #33945 from rishabh-d-dave/fs-qa-vstart_runner.LocalRemote.sh
Kefu Chai [Wed, 8 Apr 2020 01:53:32 +0000 (09:53 +0800)]
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>
5 years agoMerge pull request #34456 from ceph/wip-crontab-master
Yuri Weinstein [Wed, 8 Apr 2020 00:29:05 +0000 (17:29 -0700)]
Merge pull request #34456 from ceph/wip-crontab-master

qa/tests: removed ceph-deploy from master and octopus (ceph-deploy is…

5 years agoqa/tests: removed ceph-deploy from master and octopus (ceph-deploy isn't written... 34456/head
yuriw [Tue, 7 Apr 2020 23:47:56 +0000 (16:47 -0700)]
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>
5 years agoMerge pull request #34439 from jschmid1/osdspec_encrypted_docs
Sebastian Wagner [Tue, 7 Apr 2020 22:01:59 +0000 (00:01 +0200)]
Merge pull request #34439 from jschmid1/osdspec_encrypted_docs

docs/cephadm: <encrypted> is a global flag

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
5 years agoMerge pull request #34053 from matthewoliver/iscsi-cephadm
Sebastian Wagner [Tue, 7 Apr 2020 21:49:06 +0000 (23:49 +0200)]
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>
5 years agoMerge pull request #34357 from mgfritch/mgr-orch-test-warn
Sebastian Wagner [Tue, 7 Apr 2020 21:48:32 +0000 (23:48 +0200)]
Merge pull request #34357 from mgfritch/mgr-orch-test-warn

mgr/orch: fix python3 DeprecationWarning

Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
5 years agoqa/standalone/scrub: s/$(pgid)/${pgid}/ 34451/head
Kefu Chai [Tue, 7 Apr 2020 16:53:55 +0000 (00:53 +0800)]
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>
5 years agomgr/dashboard: fix errors related to frontend service subscriptions. 34058/head
Alfonso MartĂ­nez [Tue, 7 Apr 2020 16:07:54 +0000 (18:07 +0200)]
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>
5 years agorpm: add python3-saml as install dependency 34381/head
Ernesto Puerta [Thu, 2 Apr 2020 16:26:40 +0000 (18:26 +0200)]
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>
5 years agoqa/tasks/cephadm.py: decode data returned by teuthology.get_file()
Kefu Chai [Tue, 7 Apr 2020 15:05:30 +0000 (23:05 +0800)]
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>
5 years agoMerge pull request #34396 from tspmelo/wip-npm-hacking
Lenz Grimmer [Tue, 7 Apr 2020 13:54:39 +0000 (15:54 +0200)]
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>
5 years agotest/rgw/rgw_multi: return (str, int) from make_request()
Kefu Chai [Tue, 7 Apr 2020 13:22:36 +0000 (21:22 +0800)]
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>
5 years agoqa/tasks/mgr: s/urllib.quote_plus/parse.quote_plus/
Kefu Chai [Tue, 7 Apr 2020 12:27:08 +0000 (20:27 +0800)]
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>
5 years agotest/rgw/rgw_multi: s/urllib.urlencode/urlparse.urlencode/
Kefu Chai [Tue, 7 Apr 2020 12:00:52 +0000 (20:00 +0800)]
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>
5 years agotest/rgw/rgw_multi: pass bytes to hmac.new()
Kefu Chai [Tue, 7 Apr 2020 05:29:27 +0000 (13:29 +0800)]
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>
5 years agoqa/tasks/radosgw_admin.py: coerce key.name and key.acl to str
Kefu Chai [Mon, 6 Apr 2020 16:51:12 +0000 (00:51 +0800)]
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>
5 years agotest/rgw/rgw_multi/tests.py: decode retval of bucket.get_policy()
Kefu Chai [Mon, 6 Apr 2020 15:20:32 +0000 (23:20 +0800)]
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>
5 years agotest/rgw: pass encoding to Key.get_content_as_string()
Kefu Chai [Mon, 6 Apr 2020 15:11:21 +0000 (23:11 +0800)]
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>
5 years agoqa/tasks: pass encoding to Key.get_content_as_string()
Kefu Chai [Mon, 6 Apr 2020 15:08:59 +0000 (23:08 +0800)]
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>
5 years agoqa/tasks/s3tests_java.py: do not change a dict while iterating it
Kefu Chai [Mon, 6 Apr 2020 14:41:10 +0000 (22:41 +0800)]
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>
5 years agoqa/tasks/ragweed.py: open file in text mode
Kefu Chai [Mon, 6 Apr 2020 13:14:36 +0000 (21:14 +0800)]
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>
5 years agoqa,test: decode return val of base64.b64encode()
Kefu Chai [Mon, 6 Apr 2020 10:55:53 +0000 (18:55 +0800)]
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>
5 years agoqa/tasks/barbican.py: convert to str before json.loads()
Kefu Chai [Mon, 6 Apr 2020 09:36:18 +0000 (17:36 +0800)]
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>
5 years agoqa/tasks/radosgw_admin.py: do not use dict.has_keys()
Kefu Chai [Mon, 6 Apr 2020 08:55:05 +0000 (16:55 +0800)]
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>
5 years agoqa/tasks/tempest.py: always write str is value of options
Kefu Chai [Mon, 6 Apr 2020 08:37:55 +0000 (16:37 +0800)]
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>
5 years agoqa/tasks/tempest.py: use configparser from six.moves
Kefu Chai [Mon, 6 Apr 2020 07:18:51 +0000 (15:18 +0800)]
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>
5 years agoqa/tasks/ragweed.py: use str methods of helper from string module
Kefu Chai [Mon, 6 Apr 2020 07:12:46 +0000 (15:12 +0800)]
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>
5 years agotest/rgw/rgw_multi: do not decode a str
Kefu Chai [Mon, 6 Apr 2020 07:03:22 +0000 (15:03 +0800)]
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>
5 years agoqa/tasks/radosgw_admin: use HTTPMessage as a dict in PY3
Kefu Chai [Mon, 6 Apr 2020 06:52:02 +0000 (14:52 +0800)]
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>
5 years agoqa/tasks/keystone.py: use list(a_dict) for concatenating lists
Kefu Chai [Mon, 6 Apr 2020 05:25:54 +0000 (13:25 +0800)]
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>
5 years agoqa/tasks/util/rgw: use StringIO for capturing strings
Kefu Chai [Mon, 6 Apr 2020 04:48:18 +0000 (12:48 +0800)]
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>
5 years agoqa/tasks/cephfs/test_cephfs_shell: assertRegex(text, regex)
Kefu Chai [Sun, 5 Apr 2020 16:12:09 +0000 (00:12 +0800)]
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>
5 years agoqa/tasks/cephfs: return ascii decoded xattr
Kefu Chai [Sun, 5 Apr 2020 15:59:06 +0000 (23:59 +0800)]
qa/tasks/cephfs: return ascii decoded xattr

as callers of `TestForwardScrub._read_str_xattr()` expects str.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa/tasks/cephfs: cast mds_recall_warning_decay_rate to float
Kefu Chai [Sun, 5 Apr 2020 15:30:13 +0000 (23:30 +0800)]
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>
5 years agoqa/tasks/cephfs: allow caller to use BytesIO when calling rados()
Kefu Chai [Sun, 5 Apr 2020 13:45:51 +0000 (21:45 +0800)]
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>
5 years agoqa/tasks/cephfs: use BytesIO for capturing binary
Kefu Chai [Sun, 5 Apr 2020 13:16:10 +0000 (21:16 +0800)]
qa/tasks/cephfs: use BytesIO for capturing binary

this change partially reverts e46eb8348e0639ea162b7e224bca40e0257ad6ef.

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>
5 years agoqa/tasks/fs.py: use six.viewitems()
Kefu Chai [Sun, 5 Apr 2020 12:54:02 +0000 (20:54 +0800)]
qa/tasks/fs.py: use six.viewitems()

in python3, dict.viewitems() is replaced with dict.items().

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa/tasks/cephfs: use assertCountEqual if PY3
Kefu Chai [Sun, 5 Apr 2020 12:50:11 +0000 (20:50 +0800)]
qa/tasks/cephfs: use assertCountEqual if PY3

assertItemsEqual is renamed to assertCountEqual in Python3.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa/tasks/cephfs: compare number with number
Kefu Chai [Sun, 5 Apr 2020 12:44:20 +0000 (20:44 +0800)]
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>
5 years agoqa/tasks/cephfs: do no radom.sample(a_dict)
Kefu Chai [Sun, 5 Apr 2020 12:39:35 +0000 (20:39 +0800)]
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>
5 years agoqa/tasks: use StringIO for capturing string output
Kefu Chai [Sun, 5 Apr 2020 10:35:42 +0000 (18:35 +0800)]
qa/tasks: use StringIO for capturing string output

see d8d44ed1566b19eec055e07da2a0fed88fed4152

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoMerge pull request #34412 from jan--f/c-v-fix-simple-scan-log-string
Jan Fajerski [Tue, 7 Apr 2020 13:37:09 +0000 (15:37 +0200)]
Merge pull request #34412 from jan--f/c-v-fix-simple-scan-log-string

devices/simple/scan: Fix string in log statement

5 years agotest/rgw: use "a // b" instead of "a / b"
Kefu Chai [Sat, 4 Apr 2020 16:20:42 +0000 (00:20 +0800)]
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>
5 years agoqa/tasks: use "a // b" instead of "a / b"
Kefu Chai [Sat, 4 Apr 2020 16:02:40 +0000 (00:02 +0800)]
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>
5 years agoqa/tasks: do not random.choice(a_view)
Kefu Chai [Thu, 2 Apr 2020 05:29:45 +0000 (13:29 +0800)]
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>
5 years agopybind/mgr/dashboard/.pylintrc: drop xrange from the whitelist
Kefu Chai [Wed, 1 Apr 2020 12:22:21 +0000 (20:22 +0800)]
pybind/mgr/dashboard/.pylintrc: drop xrange from the whitelist

since dashboard is now xrange-free, there is no need to have
xrange-builtin in whitelist, moreover, in python3 the error message
cannot be emitted at seeing xrange.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agopybind: s/xrange/range/
Kefu Chai [Wed, 1 Apr 2020 12:20:13 +0000 (20:20 +0800)]
pybind: s/xrange/range/

fortunately, cython does not complain at seeing xrange, but let's drop
the last bit of python2.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa,tes: s/xrange/range/
Kefu Chai [Wed, 1 Apr 2020 12:14:02 +0000 (20:14 +0800)]
qa,tes: s/xrange/range/

use six.moves.range for python3 copatibility, we can drop six after
migrating to python3.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa/tasks/cephfs: use StringIO for capturing str
Kefu Chai [Sat, 28 Mar 2020 11:10:03 +0000 (19:10 +0800)]
qa/tasks/cephfs: use StringIO for capturing str

if we don't expect non-utf8 in stdout, use StringIO instead of BytesIO.

see also d8d44ed1566b19eec055e07da2a0fed88fed4152

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agoqa/tasks: use next(iter(..)) for accessing first element in a view
Kefu Chai [Tue, 31 Mar 2020 02:16:40 +0000 (10:16 +0800)]
qa/tasks: use next(iter(..)) for accessing first element in a view

in python2, dict.values() and dict.keys() return lists. but in python3,
they return views, which cannot be indexed directly using an integer index.

there are three use cases when we access these views in python3:

1. get the first element
2. get all the elements and then *might* want to access them by index
3. get the first element assuming there is only a single element in
   the view
4. iterate thru the view

in the 1st case, we cannot assume the number of elements, so to be
python3 compatible, we should use `next(iter(a_dict))` instead.

in the 2nd case, in this change, the view is materialized using
`list(a_dict)`.

in the 3rd case, we can just continue using the short hand of
```py
(first_element,) = a_dict.keys()
```
to unpack the view. this works in both python2 and python3.

in the 4th case, the existing code works in both python2 and python3, as
both list and view can be iterated using `iter`, and `len` works as
well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
5 years agorbd: ignore tx-only mirror peers when adding new peers 34422/head
Jason Dillaman [Mon, 6 Apr 2020 14:55:28 +0000 (10:55 -0400)]
rbd: ignore tx-only mirror peers when adding new peers

There is a restriction for supporting only a single RX peer but
we should support multiple TX-only peers.

Fixes: https://tracker.ceph.com/issues/44938
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
5 years agodoc/cephadm: <encrypted> is a global flag 34439/head
Joshua Schmid [Tue, 7 Apr 2020 09:50:25 +0000 (11:50 +0200)]
doc/cephadm: <encrypted> is a global flag

Signed-off-by: Joshua Schmid <jschmid@suse.de>
5 years agoMerge pull request #34406 from liewegas/fix-cephadm-upgrade-start
Sebastian Wagner [Tue, 7 Apr 2020 09:59:00 +0000 (11:59 +0200)]
Merge pull request #34406 from liewegas/fix-cephadm-upgrade-start

qa/suites/rados/cephadm/upgrade: start from v15.2.0

Reviewed-by: Michael Fritch <mfritch@suse.com>
Reviewed-by: Sebastian Wagner <sebastian.wagner@suse.com>
5 years agorgw/http: add timeout to http client 34414/head
Yuval Lifshitz [Mon, 6 Apr 2020 09:50:37 +0000 (12:50 +0300)]
rgw/http: add timeout to http client

also, prevent "Expect: 100-continue" from being sent
when not needed

Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
5 years agoMerge pull request #34310 from badone/wip-restful-api-dont-pass-empty-dict-to-get
Brad Hubbard [Mon, 6 Apr 2020 22:14:03 +0000 (08:14 +1000)]
Merge pull request #34310 from badone/wip-restful-api-dont-pass-empty-dict-to-get

qa/suites/rados/rest: don't pass empty dict as data arg

Reviewed-by: Sage Weil <sage@redhat.com>
5 years agoMerge pull request #34302 from badone/wip-specify-rule-for-pool-creation
Brad Hubbard [Mon, 6 Apr 2020 21:44:30 +0000 (07:44 +1000)]
Merge pull request #34302 from badone/wip-specify-rule-for-pool-creation

Wip specify rule for pool creation

Reviewed-by: Yuri Weinstein <yweinste@redhat.com>
5 years agoceph.spec.in: remove extra tokens at end of %endif directive 34427/head
Nathan Cutler [Mon, 6 Apr 2020 21:00:43 +0000 (23:00 +0200)]
ceph.spec.in: remove extra tokens at end of %endif directive

RPM 4.15.1 warns: extra tokens at the end of %endif directive

Heed the warning.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
5 years agoceph.spec.in: version an Obsoletes
Nathan Cutler [Mon, 6 Apr 2020 20:59:51 +0000 (22:59 +0200)]
ceph.spec.in: version an Obsoletes

RPM 4.15.1 warns: It's not recommended to have unversioned Obsoletes.

Heed the warning.

Signed-off-by: Nathan Cutler <ncutler@suse.com>