From 090b4e1cc8557753c8bcb16be16ee18cea393c7b Mon Sep 17 00:00:00 2001 From: mischa Date: Tue, 21 Jun 2022 22:53:01 +0200 Subject: [PATCH] added exception for internet connector JSON file without group[] --- push.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/push.py b/push.py index 8275548..dcb4f0b 100755 --- a/push.py +++ b/push.py @@ -268,6 +268,12 @@ for connector in config.sections(): logging.debug(f"CONFIG cxp: {section['cxp']}") body['cxp'] = section['cxp'] + if 'size' in body: + logging.debug(f"JSON size: {body['size']}") + if 'size' in section: + logging.debug(f"CONFIG size: {section['size']}") + body['size'] = section['size'] + if 'segments' in body: logging.debug(f"JSON segments: {body['segments'][0]}") if 'segments' in section: @@ -276,7 +282,12 @@ for connector in config.sections(): if 'group' in body: logging.debug(f"JSON group: {body['group']}") - if 'group' in section: + if 'group' in section: + logging.debug(f"CONFIG group: {section['group']}") + body['group'] = section['group'] + + if 'group' not in body: + if 'group' in section: logging.debug(f"CONFIG group: {section['group']}") body['group'] = section['group'] @@ -286,12 +297,6 @@ for connector in config.sections(): logging.debug(f"CONFIG billingtags: {section['billingtags']}") body['billingTags'][0] = section['billingtags'] - if 'size' in body: - logging.debug(f"JSON size: {body['size']}") - if 'size' in section: - logging.debug(f"CONFIG size: {section['size']}") - body['size'] = section['size'] - if 'services' in connector_name and 'credentialId' in body and 'service_credentialid' in locals(): logging.debug(f'API credentialid: {service_credentialid}') body['credentialId'] = service_credentialid