Skip to content

Commit 7e3e4c7

Browse files
authored
Defer pottery import in reconciler to suppress monkey-patch message (#2132)
After 87c58c3, the pottery top-level import in utils/__init__.py was moved into create_redlock() with stdout/stderr suppression. This made reconciler.py the first module to import pottery (without suppression), causing the "Monkey patched json.dumps()" message to appear on every CLI invocation. Move the import into the functions where it's used, after create_redlock() has already cached pottery in sys.modules. AI-assisted: Claude Code Signed-off-by: Christian Berendt <berendt@osism.tech>
1 parent f641432 commit 7e3e4c7

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

osism/tasks/reconciler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
from celery import Celery
88
from loguru import logger
9-
from pottery import ReleaseUnlockedLock
10-
119
from osism import settings, utils
1210
from osism.tasks import Config
1311

@@ -58,6 +56,8 @@ def run(self, publish=True):
5856
if publish:
5957
utils.finish_task_output(self.request.id, rc=rc)
6058

59+
from pottery import ReleaseUnlockedLock
60+
6161
try:
6262
lock.release()
6363
except ReleaseUnlockedLock:
@@ -80,6 +80,8 @@ def run_on_change(self):
8080
)
8181
p.wait()
8282

83+
from pottery import ReleaseUnlockedLock
84+
8385
try:
8486
lock.release()
8587
except ReleaseUnlockedLock:

0 commit comments

Comments
 (0)