added exception for internet connector JSON file without group[]

This commit is contained in:
mischa 2022-06-21 22:53:01 +02:00
parent 471887eac0
commit 090b4e1cc8

19
push.py
View File

@ -268,6 +268,12 @@ for connector in config.sections():
logging.debug(f"CONFIG cxp: {section['cxp']}") logging.debug(f"CONFIG cxp: {section['cxp']}")
body['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: if 'segments' in body:
logging.debug(f"JSON segments: {body['segments'][0]}") logging.debug(f"JSON segments: {body['segments'][0]}")
if 'segments' in section: if 'segments' in section:
@ -276,7 +282,12 @@ for connector in config.sections():
if 'group' in body: if 'group' in body:
logging.debug(f"JSON group: {body['group']}") 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']}") logging.debug(f"CONFIG group: {section['group']}")
body['group'] = section['group'] body['group'] = section['group']
@ -286,12 +297,6 @@ for connector in config.sections():
logging.debug(f"CONFIG billingtags: {section['billingtags']}") logging.debug(f"CONFIG billingtags: {section['billingtags']}")
body['billingTags'][0] = 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(): if 'services' in connector_name and 'credentialId' in body and 'service_credentialid' in locals():
logging.debug(f'API credentialid: {service_credentialid}') logging.debug(f'API credentialid: {service_credentialid}')
body['credentialId'] = service_credentialid body['credentialId'] = service_credentialid