def useradd(pwfile, user, password, opts='', runas=None):
 if (not os.path.exists(pwfile)):
  opts += 'c'
 cmd = ['htpasswd', '-b{0}'.format(opts), pwfile, user, password]
 return __salt__['cmd.run_all'](cmd, runas=runas, python_shell=False)

def useradd ( pwfile , user , password , opts = '' , runas = None ) : if ( not os . path . exists ( pwfile ) ) : opts += 'c' cmd = [ 'htpasswd' , '-b{0}' . format ( opts ) , pwfile , user , password ] return __salt__ [ 'cmd.run_all' ] ( cmd , runas = runas , python_shell = False )
add http user using the htpasswd command .