2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-28 11:57:34 +00:00

Set warning according to expiry

Since the expiration warning can block expiration, always
set warning when expiration set.

Aim for 8% of the interval.

Change-Id: Iecffb9c26822a21632b22170607bb2019fb52e29
This commit is contained in:
Jarrod Johnson 2019-08-30 08:25:47 -04:00
parent c711fc5dbe
commit 795ff2d046

View File

@ -861,6 +861,9 @@ class XCCClient(IMMClient):
self.ipmicmd.xraw_command(0x3a, 0xf1, data=[2])
elif key.lower() in self.rulemap:
ruleset[self.rulemap[key.lower()]] = changeset[key]['value']
if key.lower() == 'password_expiration':
warntime = str(int(int(changeset[key]['value']) * 0.08))
rulset['USER_GlobalPassExpWarningPeriod'] = warntime
else:
raise pygexc.InvalidParameterValue(
'{0} not a known setting'.format(key))