File tree 2 files changed +8
-9
lines changed
2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,17 @@ def extract_agent_config(config):
16
16
agentConfig = {}
17
17
18
18
backend = config .get ('Main' , 'service_discovery_backend' )
19
- agentConfig ['service_discovery' ] = True
19
+ if backend in SD_BACKENDS :
20
+ agentConfig ['service_discovery' ] = True
21
+ else :
22
+ log .error ("The backend {0} is not supported. "
23
+ "Service discovery won't be enabled." .format (backend ))
24
+ agentConfig ['service_discovery' ] = False
20
25
21
26
conf_backend = None
22
27
if config .has_option ('Main' , 'sd_config_backend' ):
23
28
conf_backend = config .get ('Main' , 'sd_config_backend' )
24
29
25
- if backend not in SD_BACKENDS :
26
- log .error ("The backend {0} is not supported. "
27
- "Service discovery won't be enabled." .format (backend ))
28
- agentConfig ['service_discovery' ] = False
29
-
30
30
if conf_backend is None :
31
31
log .debug ('No configuration backend provided for service discovery. '
32
32
'Only auto config templates will be used.' )
Original file line number Diff line number Diff line change @@ -408,10 +408,9 @@ def get_configs(self):
408
408
else :
409
409
configs [check_name ] = (source , (init_config , [instance ]))
410
410
else :
411
- conflict_init_msg = 'Different versions of `init_config` found for check {}. ' \
412
- 'Keeping the first one found.'
413
411
if configs [check_name ][1 ][0 ] != init_config :
414
- log .warning (conflict_init_msg .format (check_name ))
412
+ log .warning ('Different versions of `init_config` found for check %s. '
413
+ 'Keeping the first one found.' % check_name )
415
414
if isinstance (instance , list ):
416
415
for inst in instance :
417
416
configs [check_name ][1 ][1 ].append (inst )
You can’t perform that action at this time.
0 commit comments