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