2
0
mirror of https://opendev.org/x/pyghmi synced 2026-05-18 04:07:19 +00:00

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
This commit is contained in:
Jarrod Johnson
2021-11-04 07:39:57 -04:00
parent 6730deaa34
commit c2bd02e884
+4 -2
View File
@@ -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: