diff options
author | Vratko Polak <vrpolak@cisco.com> | 2021-11-23 17:03:16 +0100 |
---|---|---|
committer | Vratko Polak <vrpolak@cisco.com> | 2021-11-25 09:14:49 +0000 |
commit | 7f8933997cc1a6c9a20657f3d84fce8935363cc9 (patch) | |
tree | a6ae1091cf1f6aca5ac2625fbc4ef8a6a64911ca /resources/libraries | |
parent | 8822e6ed5801da972e66055d23f05892eddafc34 (diff) |
PAPI: Include more details in PAPI fail message
This helps to distinguish different symptoms for PAL failure alerting.
Change-Id: Idd8e8f4b427641fa055516bdf17715f6b967ca72
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r-- | resources/libraries/python/PapiExecutor.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/resources/libraries/python/PapiExecutor.py b/resources/libraries/python/PapiExecutor.py index 7bfc8614a5..ecee70c9c5 100644 --- a/resources/libraries/python/PapiExecutor.py +++ b/resources/libraries/python/PapiExecutor.py @@ -794,16 +794,17 @@ class PapiSocketExecutor: if not isinstance(reply, list): reply = [reply] for item in reply: - self.crc_checker.check_api_name(item.__class__.__name__) + message_name = item.__class__.__name__ + self.crc_checker.check_api_name(message_name) dict_item = dictize(item) if u"retval" in dict_item.keys(): # *_details messages do not contain retval. retval = dict_item[u"retval"] if retval != exp_rv: - # TODO: What exactly to log and raise here? raise AssertionError( f"Retval {retval!r} does not match expected " - f"retval {exp_rv!r}" + f"retval {exp_rv!r} in message {message_name} " + f"for command {command}." ) replies.append(dict_item) return replies |