Skip to content

Commit 9b87384

Browse files
committed
add debug logging to follow attribute flow
1 parent 0e64113 commit 9b87384

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/satosa/attribute_mapping.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,20 @@ def to_internal(self, attribute_profile, external_dict):
8888

8989
for internal_attribute_name, mapping in self.from_internal_attributes.items():
9090
if attribute_profile not in mapping:
91-
logger.debug("no attribute mapping found for the attribute profile '%s'", attribute_profile)
91+
logger.debug("no attribute mapping found for internal attribute '%s' the attribute profile '%s'" % (
92+
internal_attribute_name, attribute_profile))
9293
# skip this internal attribute if we have no mapping in the specified profile
9394
continue
9495

9596
external_attribute_name = mapping[attribute_profile]
9697
attribute_values = self._collate_attribute_values_by_priority_order(external_attribute_name,
9798
external_dict)
9899
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))
99102
internal_dict[internal_attribute_name] = attribute_values
103+
else:
104+
logger.debug("skipped backend attribute '%s': no value found", external_attribute_name)
100105

101106
internal_dict = self._handle_template_attributes(attribute_profile, internal_dict)
102107
return internal_dict
@@ -181,12 +186,16 @@ def from_internal(self, attribute_profile, internal_dict):
181186

182187
if attribute_profile not in attribute_mapping:
183188
# skip this internal attribute if we have no mapping in the specified profile
184-
logger.debug("no attribute mapping found for the attribute profile '%s'", attribute_profile)
189+
logger.debug("no mapping found for '%s' in attribute profile '%s'" %
190+
(internal_attribute_name,
191+
attribute_profile))
185192
continue
186193

187194
external_attribute_names = self.from_internal_attributes[internal_attribute_name][attribute_profile]
188195
# select the first attribute name
189196
external_attribute_name = external_attribute_names[0]
197+
logger.debug("frontend attribute %s mapped from %s" % (external_attribute_name,
198+
internal_attribute_name))
190199

191200
if self.separator in external_attribute_name:
192201
nested_attribute_names = external_attribute_name.split(self.separator)

0 commit comments

Comments
 (0)