From 8d11159f42a1b1f970267a4e06cd26c98b6780de Mon Sep 17 00:00:00 2001 From: mischa Date: Tue, 21 Jun 2022 18:43:45 +0200 Subject: [PATCH] extra checks for correct key settings for services and connectors --- push.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/push.py b/push.py index 90cc8f7..9149f02 100755 --- a/push.py +++ b/push.py @@ -292,15 +292,15 @@ for connector in config.sections(): logging.debug(f"CONFIG size: {section['size']}") body['size'] = section['size'] - if '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}') body['credentialId'] = service_credentialid - if 'instances' in body and 'credentialId' in body['instances'][0] and 'service_instance_credentialid' in locals(): + if 'services' in connector_name and 'instances' in body and 'credentialId' in body['instances'][0] and 'service_instance_credentialid' in locals(): logging.debug(f'API instance credentialid: {service_instance_credentialid}') body['instances'][0]['credentialId'] = service_instance_credentialid - if 'managementServer' in body and 'globalCidrListId' in body['managementServer'] and 'service_global_cidr_id' in locals(): + if 'services' in connector_name and 'managementServer' in body and 'globalCidrListId' in body['managementServer'] and 'service_global_cidr_id' in locals(): logging.debug(f'API globalCidrListId: {service_global_cidr_id}') body['managementServer']['globalCidrListId'] = service_global_cidr_id