@@ -58,7 +58,8 @@ def to_internal_filter(self, attribute_profile, external_attribute_names):
58
58
try :
59
59
profile_mapping = self .to_internal_attributes [attribute_profile ]
60
60
except KeyError :
61
- logger .warn ("no attribute mapping found for the given attribute profile '%s'" , attribute_profile )
61
+ logline = "no attribute mapping found for the given attribute profile {}" .format (attribute_profile )
62
+ logger .warn (logline )
62
63
# no attributes since the given profile is not configured
63
64
return []
64
65
@@ -88,21 +89,27 @@ def to_internal(self, attribute_profile, external_dict):
88
89
89
90
for internal_attribute_name , mapping in self .from_internal_attributes .items ():
90
91
if attribute_profile not in mapping :
91
- logger .debug ("no attribute mapping found for internal attribute '%s' the attribute profile '%s'" % (
92
- internal_attribute_name , attribute_profile ))
92
+ logline = "no attribute mapping found for internal attribute {internal} the attribute profile {attribute}" .format (
93
+ internal = internal_attribute_name , attribute = attribute_profile
94
+ )
95
+ logger .debug (logline )
93
96
# skip this internal attribute if we have no mapping in the specified profile
94
97
continue
95
98
96
99
external_attribute_name = mapping [attribute_profile ]
97
100
attribute_values = self ._collate_attribute_values_by_priority_order (external_attribute_name ,
98
101
external_dict )
99
102
if attribute_values : # Only insert key if it has some values
100
- logger .debug ("backend attribute '%s' mapped to %s" % (external_attribute_name ,
101
- internal_attribute_name ))
103
+ logline = "backend attribute {external} mapped to {internal}" .format (
104
+ external = external_attribute_name , internal = internal_attribute_name
105
+ )
106
+ logger .debug (logline )
102
107
internal_dict [internal_attribute_name ] = attribute_values
103
108
else :
104
- logger .debug ("skipped backend attribute '%s': no value found" , external_attribute_name )
105
-
109
+ logline = "skipped backend attribute {}: no value found" .format (
110
+ external_attribute_name
111
+ )
112
+ logger .debug (logline )
106
113
internal_dict = self ._handle_template_attributes (attribute_profile , internal_dict )
107
114
return internal_dict
108
115
@@ -181,20 +188,27 @@ def from_internal(self, attribute_profile, internal_dict):
181
188
try :
182
189
attribute_mapping = self .from_internal_attributes [internal_attribute_name ]
183
190
except KeyError :
184
- logger .debug ("no attribute mapping found for the internal attribute '%s'" , internal_attribute_name )
191
+ logline = "no attribute mapping found for the internal attribute {}" .format (
192
+ internal_attribute_name
193
+ )
194
+ logger .debug (logline )
185
195
continue
186
196
187
197
if attribute_profile not in attribute_mapping :
188
198
# skip this internal attribute if we have no mapping in the specified profile
189
- logger .debug ("no mapping found for '%s' in attribute profile '%s'" %
190
- (internal_attribute_name , attribute_profile ))
199
+ logline = "no mapping found for '{internal}' in attribute profile '{attribute}'" .format (
200
+ internal = internal_attribute_name , attribute = attribute_profile
201
+ )
202
+ logger .debug (logline )
191
203
continue
192
204
193
205
external_attribute_names = self .from_internal_attributes [internal_attribute_name ][attribute_profile ]
194
206
# select the first attribute name
195
207
external_attribute_name = external_attribute_names [0 ]
196
- logger .debug ("frontend attribute %s mapped from %s" % (external_attribute_name ,
197
- internal_attribute_name ))
208
+ logline = "frontend attribute {external} mapped from {internal}" .format (
209
+ external = external_attribute_name , internal = internal_attribute_name
210
+ )
211
+ logger .debug (logline )
198
212
199
213
if self .separator in external_attribute_name :
200
214
nested_attribute_names = external_attribute_name .split (self .separator )
0 commit comments