From 3aba6c8e4ec287bf0b15852ad850a6e65f939eb3 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Thu, 26 Aug 2021 16:45:07 -0400 Subject: [PATCH] tests/rgw: use json format output for user info If the radosgw user already exists then we need to have the output in json format because we are expecting to load the output with json.loads() Otherwise we have pytest failure like: ```console self = , s = '', idx = 0 def raw_decode(self, s, idx=0): """Decode a JSON document from ``s`` (a ``str`` beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. """ try: obj, end = self.scan_once(s, idx) except StopIteration as err: > raise JSONDecodeError("Expecting value", s, err.value) from None E json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ``` Signed-off-by: Dimitri Savineau (cherry picked from commit f2bd8ae70f0ae5d0c7c7a36bd6ecdad6383feed9) --- tests/functional/tests/rgw/test_rgw_tuning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/tests/rgw/test_rgw_tuning.py b/tests/functional/tests/rgw/test_rgw_tuning.py index 35855e78b8..00f2007f7f 100644 --- a/tests/functional/tests/rgw/test_rgw_tuning.py +++ b/tests/functional/tests/rgw/test_rgw_tuning.py @@ -13,7 +13,7 @@ def test_rgw_bucket_default_quota_is_set(self, node, host, setup): @pytest.mark.no_docker def test_rgw_bucket_default_quota_is_applied(self, node, host, setup): - radosgw_admin_cmd = "timeout --foreground -s KILL 5 sudo radosgw-admin --cluster={cluster} -n client.rgw.{hostname}.rgw0 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}.rgw0/keyring user info --uid=test".format( # noqa E501 + radosgw_admin_cmd = "timeout --foreground -s KILL 5 sudo radosgw-admin --cluster={cluster} -n client.rgw.{hostname}.rgw0 --keyring /var/lib/ceph/radosgw/{cluster}-rgw.{hostname}.rgw0/keyring user info --uid=test --format=json".format( # noqa E501 hostname=node["vars"]["inventory_hostname"], cluster=setup['cluster_name'] )