fix #41044; allow for date param to be 0

This commit is contained in:
Rossen Georgiev 2017-10-12 21:49:02 +01:00
parent d89c317d96
commit a81a6fe23c

View file

@ -67,7 +67,7 @@ def _changes(name,
workphone='',
homephone='',
loginclass=None,
date=0,
date=None,
mindays=0,
maxdays=999999,
inactdays=0,
@ -134,7 +134,7 @@ def _changes(name,
change['passwd'] = password
if empty_password and lshad['passwd'] != '':
change['empty_password'] = True
if date and date is not 0 and lshad['lstchg'] != date:
if date is not None and lshad['lstchg'] != date:
change['date'] = date
if mindays and mindays is not 0 and lshad['min'] != mindays:
change['mindays'] = mindays
@ -675,7 +675,7 @@ def present(name,
'empty password'.format(name)
ret['result'] = False
ret['changes']['password'] = ''
if date:
if date is not None:
__salt__['shadow.set_date'](name, date)
spost = __salt__['shadow.info'](name)
if spost['lstchg'] != date: