From 795ff2d0464646a0f075c156109742bbccf89677 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 Aug 2019 08:25:47 -0400 Subject: [PATCH] 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 --- pyghmi/ipmi/oem/lenovo/imm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index f2ea1c4b..4889877a 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -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))