From 6d353317f039137f795463d6f3749357e45eb214 Mon Sep 17 00:00:00 2001 From: mischa Date: Tue, 21 Jun 2022 12:24:59 +0200 Subject: [PATCH] added extra debug when post fails with 400 --- push.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/push.py b/push.py index a0abb6d..5475263 100755 --- a/push.py +++ b/push.py @@ -90,18 +90,21 @@ url_exceptions = { "ftntfw": "ftnt-fw-", "chkpfw": "chkp-fw-", "ocivcnconnectors": "oci-vcn-connectors", - "ftntfwservices": "ftnt-fw-services" + "ftntfwservices": "ftnt-fw-services", + "chkpfwservices": "chkp-fw-services" } # URL Exceptions creating credentials service_credentials = { "panfwservices": "pan", - "ftntfwservices": "ftntfw" + "ftntfwservices": "ftntfw", + "chkpfwservices": "chkp-fw" } # URL Exceptions creating instance credentials service_instance_credentials = { - "ftntfwservices": "ftntfw-" + "ftntfwservices": "ftntfw-", + "chkpfwservices": "chkp-fw-" } # Credential Types @@ -123,6 +126,8 @@ def alkira_post(session, uri, body): url = f'{ALKIRA_BASE_URI}{uri}' try: response = session.post(url, data=json.dumps(body), headers=headers) + if response.status_code == 400: + logging.debug(response.content) response.raise_for_status() except Exception as e: logging.error(f'Error: {str(e)}')