From c12b646b094591b8633a8c548d7603bd92c3665f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 18 May 2017 15:30:58 +0200 Subject: [PATCH] More logging in PATCH handler --- pillar/api/patch_handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pillar/api/patch_handler.py b/pillar/api/patch_handler.py index 14dc910a..79168570 100644 --- a/pillar/api/patch_handler.py +++ b/pillar/api/patch_handler.py @@ -47,8 +47,8 @@ class AbstractPatchHandler: } if self.log.isEnabledFor(logging.INFO): - self.log.info('Creating PATCH handler %s%s for operations: %s', - blueprint.name, self.route, + self.log.info('Creating PATCH handler %s.%s%s for operations: %s', + blueprint.name, self.patch.__name__, self.route, sorted(self.patch_handlers.keys())) blueprint.add_url_rule(self.route, @@ -66,11 +66,13 @@ class AbstractPatchHandler: real_object_id = str2id(object_id) patch = request.get_json() if not patch: + self.log.info('Bad PATCH request, did not contain JSON') raise wz_exceptions.BadRequest('Patch must contain JSON') try: patch_op = patch['op'] except KeyError: + self.log.info("Bad PATCH request, did not contain 'op' key") raise wz_exceptions.BadRequest("PATCH should contain 'op' key to denote operation.") log.debug('User %s wants to PATCH "%s" %s %s',