From f096a07858608655369d4489d53a7a6bd66409b9 Mon Sep 17 00:00:00 2001 From: Joshua Blanch Date: Wed, 6 Nov 2024 16:26:00 +0000 Subject: [PATCH] upmap: add regex to remove inf from osd dump before parsing to JSON Signed-off-by: Joshua Blanch --- tools/upmap/upmap-remapped.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/upmap/upmap-remapped.py b/tools/upmap/upmap-remapped.py index 002e5b8..0edc0a1 100755 --- a/tools/upmap/upmap-remapped.py +++ b/tools/upmap/upmap-remapped.py @@ -38,7 +38,7 @@ # Hacked by: Dan van der Ster -import json, subprocess, sys +import json, subprocess, sys, re try: import rados @@ -159,6 +159,7 @@ def rm_upmap_pg_items(pgid): cmd = {"prefix": "osd dump", "format": "json"} ret, output, errs = cluster.mon_command(json.dumps(cmd), b'', timeout=5) osd_dump_json = output.decode('utf-8').strip() + osd_dump_json = re.sub(r':\s*inf\b', ': "inf"', osd_dump_json) upmaps = json.loads(osd_dump_json)['pg_upmap_items'] except ValueError: eprint('Error loading existing upmaps')