diff --git a/openldap_opencensus_stats/config_transformers/child_object.py b/openldap_opencensus_stats/config_transformers/child_object.py index ef6b3dd..6f74f75 100644 --- a/openldap_opencensus_stats/config_transformers/child_object.py +++ b/openldap_opencensus_stats/config_transformers/child_object.py @@ -15,8 +15,8 @@ def process(configuration): config = copy.deepcopy(configuration) for server_config in config.get('ldap_servers'): - ldap_server = ChildObjectConfigurationTransformer.get_ldap_server(server_config) - if not ldap_server.get('sync_only', False): + if not server_config.get('sync_only', False): + ldap_server = ChildObjectConfigurationTransformer.get_ldap_server(server_config) server_config['object'] = ChildObjectConfigurationTransformer.process_objects_for_ldap_server( configuration=server_config.get('object', {}), dn='', diff --git a/openldap_opencensus_stats/config_transformers/metric_name_interpolation.py b/openldap_opencensus_stats/config_transformers/metric_name_interpolation.py index 0c41f66..d37b35c 100644 --- a/openldap_opencensus_stats/config_transformers/metric_name_interpolation.py +++ b/openldap_opencensus_stats/config_transformers/metric_name_interpolation.py @@ -15,8 +15,8 @@ def process(configuration): config = copy.deepcopy(configuration) for server_config in config.get('ldap_servers'): - ldap_server = ConfigurationTransformer.get_ldap_server(server_config=server_config) - if not ldap_server.get('sync_only', False): + if not server_config.get('sync_only', False): + ldap_server = ConfigurationTransformer.get_ldap_server(server_config=server_config) server_config['object'] = MetricNameInterpolationConfigurationTransformer.process_objects_for_ldap_server( configuration=server_config.get('object', {}), dn='',