From c2bd02e8846ff902c88f7f6456a23a621d7f98c0 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 4 Nov 2021 07:39:57 -0400 Subject: [PATCH] Recognize another etag message Some implementations use a differennt msgid to indicate the etag mismatch, fix support for those platforms. Further, it was discovered that if the display label for a setting changed the setting to no longer match the setting, the retry would be invalid. Support checking for mismatched spacing. Change-Id: I9f83bfcf1c163fa36d6f684dd2685c828bd63507 --- pyghmi/redfish/command.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyghmi/redfish/command.py b/pyghmi/redfish/command.py index c53bcf28..f64c4411 100644 --- a/pyghmi/redfish/command.py +++ b/pyghmi/redfish/command.py @@ -1091,7 +1091,8 @@ class Command(object): self._set_system_configuration(changeset) return except exc.RedfishError as re: - if 'etag' not in re.msgid.lower(): + if ('etag' not in re.msgid.lower() + and 'PreconditionFailed' not in re.msgid): raise def _set_system_configuration(self, changeset): @@ -1139,7 +1140,8 @@ class Command(object): if not normval.endswith('*'): normval += '*' for cand in currsettings[change]['possible']: - if fnmatch(cand.lower(), normval): + if fnmatch(cand.lower().replace(' ', ''), + normval.replace(' ', '')): changeset[change] = cand break else: