def set_warndays(name, warndays):
 pre_info = info(name)
 if (warndays == pre_info['warn']):
  return True
 cmd = 'passwd -w {0} {1}'.format(warndays, name)
 __salt__['cmd.run'](cmd, python_shell=False)
 post_info = info(name)
 if (post_info['warn'] != pre_info['warn']):
  return (post_info['warn'] == warndays)
 return False

def set_warndays ( name , warndays ) : pre_info = info ( name ) if ( warndays == pre_info [ 'warn' ] ) : return True cmd = 'passwd -w {0} {1}' . format ( warndays , name ) __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) post_info = info ( name ) if ( post_info [ 'warn' ] != pre_info [ 'warn' ] ) : return ( post_info [ 'warn' ] == warndays ) return False
set the number of days of warning before a password change is required .