def userdel(pwfile, user, runas=None, all_results=False):
 if (not os.path.exists(pwfile)):
  return 'Error: The specified htpasswd file does not exist'
 cmd = ['htpasswd', '-D', pwfile, user]
 if all_results:
  out = __salt__['cmd.run_all'](cmd, runas=runas, python_shell=False)
 else:
  out = __salt__['cmd.run'](cmd, runas=runas, python_shell=False).splitlines()
 return out

def userdel ( pwfile , user , runas = None , all_results = False ) : if ( not os . path . exists ( pwfile ) ) : return 'Error: The specified htpasswd file does not exist' cmd = [ 'htpasswd' , '-D' , pwfile , user ] if all_results : out = __salt__ [ 'cmd.run_all' ] ( cmd , runas = runas , python_shell = False ) else : out = __salt__ [ 'cmd.run' ] ( cmd , runas = runas , python_shell = False ) . splitlines ( ) return out
delete a user from the specified htpasswd file .