def _dscl(cmd, ctype='create'):
 if (__grains__['osrelease_info'] < (10, 8)):
  (source, noderoot) = ('.', '')
 else:
  (source, noderoot) = ('localhost', '/Local/Default')
 if noderoot:
  cmd[0] = (noderoot + cmd[0])
 return __salt__['cmd.run_all']((['dscl', source, ('-' + ctype)] + cmd), output_loglevel=('quiet' if (ctype == 'passwd') else 'debug'), python_shell=False)

def _dscl ( cmd , ctype = 'create' ) : if ( __grains__ [ 'osrelease_info' ] < ( 10 , 8 ) ) : ( source , noderoot ) = ( '.' , '' ) else : ( source , noderoot ) = ( 'localhost' , '/Local/Default' ) if noderoot : cmd [ 0 ] = ( noderoot + cmd [ 0 ] ) return __salt__ [ 'cmd.run_all' ] ( ( [ 'dscl' , source , ( '-' + ctype ) ] + cmd ) , output_loglevel = ( 'quiet' if ( ctype == 'passwd' ) else 'debug' ) , python_shell = False )
run a dscl -create command .