From 964aba978816cd17eafbbe4d22859a4fee3537fb Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 20 Nov 2023 09:02:43 -0500 Subject: [PATCH] Generate messages that work with stricter Eliot --- src/allmydata/immutable/upload.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/allmydata/immutable/upload.py b/src/allmydata/immutable/upload.py index 36bd86fa6..22210ad0a 100644 --- a/src/allmydata/immutable/upload.py +++ b/src/allmydata/immutable/upload.py @@ -78,7 +78,7 @@ _READONLY_PEERS = Field( def _serialize_existing_shares(existing_shares): return { - server: list(shares) + ensure_str(server): list(shares) for (server, shares) in existing_shares.items() } @@ -91,7 +91,7 @@ _EXISTING_SHARES = Field( def _serialize_happiness_mappings(happiness_mappings): return { - sharenum: base32.b2a(serverid) + str(sharenum): ensure_str(base32.b2a(serverid)) for (sharenum, serverid) in happiness_mappings.items() } @@ -112,7 +112,7 @@ _UPLOAD_TRACKERS = Field( u"upload_trackers", lambda trackers: list( dict( - server=tracker.get_name(), + server=ensure_str(tracker.get_name()), shareids=sorted(tracker.buckets.keys()), ) for tracker @@ -123,7 +123,7 @@ _UPLOAD_TRACKERS = Field( _ALREADY_SERVERIDS = Field( u"already_serverids", - lambda d: d, + lambda d: {str(k): v for k, v in d.items()}, u"Some servers which are already holding some shares that we were interested in uploading.", )