From fb95535da29bd415ad0fc7089d4c1ef5e83b0aae Mon Sep 17 00:00:00 2001 From: Sheetal Pamecha Date: Mon, 22 Jul 2024 11:23:38 +0530 Subject: [PATCH] Disable rbd debug logs by default Signed-off-by: Sheetal Pamecha --- test/addons/rbd-mirror/README.md | 16 ++++++++++++++++ test/addons/rbd-mirror/start | 8 ++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 test/addons/rbd-mirror/README.md diff --git a/test/addons/rbd-mirror/README.md b/test/addons/rbd-mirror/README.md new file mode 100644 index 000000000..a3787b5c7 --- /dev/null +++ b/test/addons/rbd-mirror/README.md @@ -0,0 +1,16 @@ +# rbd-mirror addon + +## Enabling debug logs + +If Ceph developers require debug logs you can enable them by starting +the environment with RBD_MIRROR_DEBUG=1: + +``` +RBD_MIRROR_DEBUG=1 drenv start envs/regional-dr.yaml +``` + +If the environment is already running you can enable the logs using: + +``` +RBD_MIRROR_DEBUG=1 addons/rbd-mirror/start dr1 dr2 +``` diff --git a/test/addons/rbd-mirror/start b/test/addons/rbd-mirror/start index 9c28e8fc7..660f1f991 100755 --- a/test/addons/rbd-mirror/start +++ b/test/addons/rbd-mirror/start @@ -240,12 +240,12 @@ cluster1 = sys.argv[1] cluster2 = sys.argv[2] # Run with RBD_MIRROR_DEBUG=0 to disable debug logs. -if os.environ.get("RBD_MIRROR_DEBUG") == "0": - disable_rbd_mirror_debug_logs(cluster1) - disable_rbd_mirror_debug_logs(cluster2) -else: +if os.environ.get("RBD_MIRROR_DEBUG") == "1": enable_rbd_mirror_debug_logs(cluster1) enable_rbd_mirror_debug_logs(cluster2) +else: + disable_rbd_mirror_debug_logs(cluster1) + disable_rbd_mirror_debug_logs(cluster2) cluster1_info = fetch_secret_info(cluster1) cluster2_info = fetch_secret_info(cluster2)