mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
python/samba/netcmd: Protect variable that can be None
In py3 None variable cannot be compared with '>' '<' etc operators Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
parent
352eee57ae
commit
c46fd168fc
@ -1524,7 +1524,7 @@ class cmd_domain_passwordsettings_set(Command):
|
||||
ldb.FLAG_MOD_REPLACE, "lockOutObservationWindow")
|
||||
msgs.append("Duration to reset account lockout after changed!")
|
||||
|
||||
if max_pwd_age > 0 and min_pwd_age >= max_pwd_age:
|
||||
if max_pwd_age and max_pwd_age > 0 and min_pwd_age >= max_pwd_age:
|
||||
raise CommandError("Maximum password age (%d) must be greater than minimum password age (%d)!" % (max_pwd_age, min_pwd_age))
|
||||
|
||||
if len(m) == 0:
|
||||
|
Loading…
Reference in New Issue
Block a user