diff --git a/tests/unit/test_filter_xapi_clusterd_db.py b/tests/unit/test_filter_xapi_clusterd_db.py index 0edb8a45..3d8f3b4c 100644 --- a/tests/unit/test_filter_xapi_clusterd_db.py +++ b/tests/unit/test_filter_xapi_clusterd_db.py @@ -94,7 +94,7 @@ # Same as original, but with passwords and private data replaced by: "REMOVED" # BUG: "secret-token" has to be replaced by "REMOVED" EXPECTED = r"""{ - "token": "secret-token", + "token": "REMOVED", "cluster_config": { "pems": { "blobs": "REMOVED" @@ -197,7 +197,6 @@ def test_pems_blobs(bugtool): # CA-358870: filter_xapi_clusterd_db: remove token from the report -@pytest.mark.xfail(reason="bugtool currently fails to remove the token") @pytest.mark.usefixtures("tmpdir") def test_remove_token(bugtool): """CA-358870: Assert that filter_xapi_clusterd_db() removes the token""" diff --git a/xen-bugtool b/xen-bugtool index 92483e21..57faf412 100755 --- a/xen-bugtool +++ b/xen-bugtool @@ -1512,6 +1512,8 @@ def filter_xapi_clusterd_db(cap): clusterd_data[config_key]['pems']['blobs'] = "REMOVED" clusterd_data[config_key]['authkey'] = "REMOVED" + if "token" in clusterd_data: + clusterd_data["token"] = "REMOVED" output_str = json.dumps(clusterd_data) except Exception: output_str = ''