@@ -67,6 +67,7 @@ def __init__(self, provider: Optional[Any] = None, service: Optional[str] = None
67
67
def accept_state_visitor (self , visitor : StateVisitor ):
68
68
# needed for services like cognito-idp
69
69
service_name : str = self .service .replace ("-" , "_" )
70
+ LOG .debug ("Visit stores for %s" , service_name )
70
71
71
72
# try to load AccountRegionBundle from predictable location
72
73
attribute_name = f"{ service_name } _stores"
@@ -79,7 +80,6 @@ def accept_state_visitor(self, visitor: StateVisitor):
79
80
attribute = _load_attribute_from_module (module_name , attribute_name )
80
81
81
82
if attribute is not None :
82
- LOG .debug ("Visiting attribute %s in module %s" , attribute_name , module_name )
83
83
visitor .visit (attribute )
84
84
85
85
# try to load BackendDict from predictable location
@@ -95,7 +95,6 @@ def accept_state_visitor(self, visitor: StateVisitor):
95
95
attribute = _load_attribute_from_module (module_name , attribute_name )
96
96
97
97
if attribute is not None :
98
- LOG .debug ("Visiting attribute %s in module %s" , attribute_name , module_name )
99
98
visitor .visit (attribute )
100
99
101
100
@@ -106,9 +105,8 @@ def _load_attribute_from_module(module_name: str, attribute_name: str) -> Any |
106
105
"""
107
106
try :
108
107
module = importlib .import_module (module_name )
109
- return getattr (module , attribute_name )
110
- except (ModuleNotFoundError , AttributeError ) as e :
111
- LOG .debug (
112
- 'Unable to get attribute "%s" for module "%s": "%s"' , attribute_name , module_name , e
113
- )
108
+ attr = getattr (module , attribute_name )
109
+ LOG .debug ("Found attribute %s in module %s" , attribute_name , module_name )
110
+ return attr
111
+ except (ModuleNotFoundError , AttributeError ):
114
112
return None
0 commit comments