@@ -226,7 +226,7 @@ def serviceClassToConfigKeys(serviceClassName: str) -> list[str]:
226226 candidates = []
227227
228228 # remove namespaces (namespaces are not part of any candidate)
229- try : serviceClassName = serviceClassName [:serviceClassName .index ('::' )]
229+ try : serviceClassName = serviceClassName [:serviceClassName .rindex ('::' )]
230230 except ValueError : pass # no namespace
231231
232232 if not serviceClassName : return [] # ?!
@@ -284,10 +284,10 @@ def readServiceConfig(getConfig, configKey, returnConfigKey = True):
284284 = tuple (base + suffix for base in serviceClassToConfigKeys (configKey ))
285285
286286 Logger .debug ("Configuration from candidates: '%s'" , "', '" .join (configKeys ))
287- for configKey in configKeys :
288- try : config = getConfig (configKey )
287+ for candidateKey in configKeys :
288+ try : config = getConfig (candidateKey )
289289 except Exception : continue
290- return (config , configKey ) if returnConfigKey else config
290+ return (config , candidateKey ) if returnConfigKey else config
291291 raise RuntimeError (f"No configuration for service key '{ configKey } '" )
292292# readServiceConfig()
293293
@@ -701,6 +701,8 @@ def fullConfig(self): return self.serviceTable is None
701701 def isValid (self ): return self .configPath is not None
702702 def hasExtraConfig (self ): return bool (self .extraConfig )
703703 def needsCustom (self ): return not self .fullConfig () or self .hasExtraConfig ()
704+ def serviceTableName (self ):
705+ return 'services' if self .fullConfig () else self .serviceTable
704706
705707 def addExtraConfig (self , extra ): self .extraConfig += "\n " + extra
706708
@@ -811,7 +813,7 @@ def loadConfiguration(self):
811813 '\n # ==============================='
812814 .format (
813815 configPath = configurationInfo .configPath ,
814- serviceTable = configurationInfo .serviceTable ,
816+ serviceTable = configurationInfo .serviceTableName () ,
815817 extraConfig = configurationInfo .extraConfig ,
816818 )
817819 )
0 commit comments