def _set_account_policy(name, policy):
 cmd = 'pwpolicy -u {0} -setpolicy "{1}"'.format(name, policy)
 try:
  return salt.utils.mac_utils.execute_return_success(cmd)
 except CommandExecutionError as exc:
  if ('Error: user <{0}> not found'.format(name) in exc.strerror):
   raise CommandExecutionError('User not found: {0}'.format(name))
  raise CommandExecutionError('Unknown error: {0}'.format(exc.strerror))

def _set_account_policy ( name , policy ) : cmd = 'pwpolicy -u {0} -setpolicy "{1}"' . format ( name , policy ) try : return salt . utils . mac_utils . execute_return_success ( cmd ) except CommandExecutionError as exc : if ( 'Error: user <{0}> not found' . format ( name ) in exc . strerror ) : raise CommandExecutionError ( 'User not found: {0}' . format ( name ) ) raise CommandExecutionError ( 'Unknown error: {0}' . format ( exc . strerror ) )
set a value in the user accountpolicy .