Create existing local users.

        <users group="root">
          <user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" name="root"/>
        </users>

        :param node:
        :return:
421303
def _set_users(self, node):
        '''
        
        '''
        # Get real local users with the local passwords
        shadow = {}
        with salt.utils.files.fopen('/etc/shadow') as rfh:
            for sh_line in rfh.read().split(os.linesep):
                if sh_line.strip():
                    login, pwd = sh_line.split(":")[:2]
                    if pwd and pwd[0] not in '!*':
                        shadow[login] = {'p': pwd}

        with salt.utils.files.fopen('/etc/passwd') as rfh:
            for ps_line in rfh.read().split(os.linesep):
                if ps_line.strip():
                    ps_line = ps_line.strip().split(':')
                    if ps_line[0] in shadow:
                        shadow[ps_line[0]]['h'] = ps_line[5]
                        shadow[ps_line[0]]['s'] = ps_line[6]
                        shadow[ps_line[0]]['g'] = self._get_user_groups(ps_line[0])

        users_groups = []
        users_node = etree.SubElement(node, 'users')
        for u_name, u_data in shadow.items():
            user_node = etree.SubElement(users_node, 'user')
            user_node.set('password', u_data['p'])
            user_node.set('home', u_data['h'])
            user_node.set('name', u_name)
            users_groups.extend(u_data['g'])
        users_node.set('group', ','.join(users_groups))

        return users_node
205862
def create(self, name, **kwargs):
        
        # These arguments are required
        self.required('create', kwargs, ['hostname', 'port',
                      'storage_hostname', 'volume_type_name', 'size'])
        kwargs['name'] = name
        return self.http_post('/nodes', params=kwargs)
1158837
def create_new_node(project_root, environment)
      # Ask the hostname for node
      hostname = ask_not_existing_hostname(project_root, environment)
      # Ask IP for node
      ip = ask_ip(environment)
      # Node creation
      node = Bebox::Node.new(environment, project_root, hostname, ip)
      output = node.create
      ok _('wizard.node.creation_success')
      return output
    end
1323757
def create_package_node(self, team, user, package, dry_run=False):
        
        contents = RootNode(dict())
        if dry_run:
            return contents

        self.check_name(team, user, package)
        assert contents is not None
        self.create_dirs()

        # Delete any existing data.
        path = self.package_path(team, user, package)
        try:
            os.remove(path)
        except OSError:
            pass

        return contents
726044
def node(self,port, hub_address=("localhost", 4444)):
        '''  
        '''
        self._ip, self._port = hub_address
        self.command = [self._conf["java_path"], "-jar", self._conf["jar_path"], "-port", str(port), "-role", "node", "-hub", "http://%s:%s/grid/register/" %(self._ip, self._port)]        
        return self
31800
def create_user(name, email, datum = nil)
      current_path = '/api/v1/users'
      payload = { name: name, mail: email }
      payload.merge!(datum) unless datum.nil?
      @conn.post(current_path, payload.to_json)
    end
1316328
def node(name, options = {}, &block)
        return unless resolve_condition(options)

        result = block.call(@_object)
        if name.present?
          @_result[create_key(name)] = result
        elsif result.is_a?(Hash) # merge hash into root hash
          @_result.merge!(result)
        end
      end
30436
def create_node(vm_, newid):
    '''
    
    '''
    newnode = {}

    if 'technology' not in vm_:
        vm_['technology'] = 'openvz'  # default virt tech if none is given

    if vm_['technology'] not in ['qemu', 'openvz', 'lxc']:
        # Wrong VM type given
        log.error('Wrong VM type. Valid options are: qemu, openvz (proxmox3) or lxc (proxmox4)')
        raise SaltCloudExecutionFailure

    if 'host' not in vm_:
        # Use globally configured/default location
        vm_['host'] = config.get_cloud_config_value(
            'default_host', get_configured_provider(), __opts__, search_global=False
        )

    if vm_['host'] is None:
        # No location given for the profile
        log.error('No host given to create this VM on')
        raise SaltCloudExecutionFailure

    # Required by both OpenVZ and Qemu (KVM)
    vmhost = vm_['host']
    newnode['vmid'] = newid

    for prop in 'cpuunits', 'description', 'memory', 'onboot':
        if prop in vm_:  # if the property is set, use it for the VM request
            newnode[prop] = vm_[prop]

    if vm_['technology'] == 'openvz':
        # OpenVZ related settings, using non-default names:
        newnode['hostname'] = vm_['name']
        newnode['ostemplate'] = vm_['image']

        # optional VZ settings
        for prop in ['cpus', 'disk', 'ip_address', 'nameserver',
                     'password', 'swap', 'poolid', 'storage']:
            if prop in vm_:  # if the property is set, use it for the VM request
                newnode[prop] = vm_[prop]

    elif vm_['technology'] == 'lxc':
        # LXC related settings, using non-default names:
        newnode['hostname'] = vm_['name']
        newnode['ostemplate'] = vm_['image']

        static_props = ('cpuunits', 'cpulimit', 'rootfs', 'cores', 'description', 'memory',
                        'onboot', 'net0', 'password', 'nameserver', 'swap', 'storage', 'rootfs')
        for prop in _get_properties('/nodes/{node}/lxc',
                                    'POST',
                                    static_props):
            if prop in vm_:  # if the property is set, use it for the VM request
                newnode[prop] = vm_[prop]

        if 'pubkey' in vm_:
            newnode['ssh-public-keys'] = vm_['pubkey']

        # inform user the "disk" option is not supported for LXC hosts
        if 'disk' in vm_:
            log.warning('The "disk" option is not supported for LXC hosts and was ignored')

        # LXC specific network config
        # OpenVZ allowed specifying IP and gateway. To ease migration from
        # Proxmox 3, I've mapped the ip_address and gw to a generic net0 config.
        # If you need more control, please use the net0 option directly.
        # This also assumes a /24 subnet.
        if 'ip_address' in vm_ and 'net0' not in vm_:
            newnode['net0'] = 'bridge=vmbr0,ip=' + vm_['ip_address'] + '/24,name=eth0,type=veth'

            # gateway is optional and does not assume a default
            if 'gw' in vm_:
                newnode['net0'] = newnode['net0'] + ',gw=' + vm_['gw']

    elif vm_['technology'] == 'qemu':
        # optional Qemu settings
        static_props = (
            'acpi', 'cores', 'cpu', 'pool', 'storage', 'sata0', 'ostype', 'ide2', 'net0')
        for prop in _get_properties('/nodes/{node}/qemu',
                                    'POST',
                                    static_props):
            if prop in vm_:  # if the property is set, use it for the VM request
                newnode[prop] = vm_[prop]

    # The node is ready. Lets request it to be added
    __utils__['cloud.fire_event'](
        'event',
        'requesting instance',
        'salt/cloud/{0}/requesting'.format(vm_['name']),
        args={
            'kwargs': __utils__['cloud.filter_event']('requesting', newnode, list(newnode)),
        },
        sock_dir=__opts__['sock_dir'],
    )

    log.debug('Preparing to generate a node using these parameters: %s ', newnode)
    if 'clone' in vm_ and vm_['clone'] is True and vm_['technology'] == 'qemu':
        postParams = {}
        postParams['newid'] = newnode['vmid']

        for prop in 'description', 'format', 'full', 'name':
            if 'clone_' + prop in vm_:  # if the property is set, use it for the VM request
                postParams[prop] = vm_['clone_' + prop]

        if 'host' in vm_:
            postParams['target'] = vm_['host']

        try:
            int(vm_['clone_from'])
        except ValueError:
            if ':' in vm_['clone_from']:
                vmhost = vm_['clone_from'].split(':')[0]
                vm_['clone_from'] = vm_['clone_from'].split(':')[1]

        node = query('post', 'nodes/{0}/qemu/{1}/clone'.format(
            vmhost, vm_['clone_from']), postParams)
    else:
        node = query('post', 'nodes/{0}/{1}'.format(vmhost, vm_['technology']), newnode)
    return _parse_proxmox_upid(node, vm_)
846514
def node(self, source, args=(), env={}):
        

        return self._exec(self.node_bin, source, args=args, env=env)
618641
def create_user(user_name, path=None, region=None, key=None, keyid=None,
                profile=None):
    '''
    
    '''
    if not path:
        path = '/'
    if get_user(user_name, region, key, keyid, profile):
        return True
    conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
    try:
        conn.create_user(user_name, path)
        log.info('Created IAM user : %s.', user_name)
        return True
    except boto.exception.BotoServerError as e:
        log.debug(e)
        log.error('Failed to create IAM user %s.', user_name)
        return False
517783
def create_user(name, groups=None, key_file=None):
    """"""

    groups = groups or []
    if not user_exists(name):
        for group in groups:
            if not group_exists(group):
                sudo(u"addgroup %s" % group)
        groups = groups and u'-G %s' % u','.join(groups) or ''
        sudo(u"useradd -m %s -s /bin/bash %s" % (groups, name))
        sudo(u"passwd -d %s" % name)
    if key_file:
        sudo(u"mkdir -p /home/%s/.ssh" % name)
        put(key_file, u"/home/%s/.ssh/authorized_keys" % name, use_sudo=True)
        sudo(u"chown -R %(name)s:%(name)s /home/%(name)s/.ssh" % {'name': name})
1126076
def user_create(name, passwd, user=None, password=None, host=None, port=None,
                database='admin', authdb=None, roles=None):
    '''
    
    '''
    conn = _connect(user, password, host, port, authdb=authdb)
    if not conn:
        return 'Failed to connect to mongo database'

    if not roles:
        roles = []

    try:
        log.info('Creating user %s', name)
        mdb = pymongo.database.Database(conn, database)
        mdb.add_user(name, passwd, roles=roles)
    except pymongo.errors.PyMongoError as err:
        log.error('Creating database %s failed with error: %s', name, err)
        return six.text_type(err)
    return True
1221421
def xml(self):
        
        root = Element('UsernameToken', ns=wssens)
        u = Element('Username', ns=wssens)
        u.setText(self.username)
        root.append(u)
        p = Element('Password', ns=wssens)
        p.setText(self.password)
        root.append(p)
        if self.nonce is not None:
            n = Element('Nonce', ns=wssens)
            n.setText(self.nonce)
            root.append(n)
        if self.created is not None:
            n = Element('Created', ns=wsuns)
            n.setText(str(DateTime(self.created)))
            root.append(n)
        return root
241441
public static Node create(DbConn cnx, String nodeName, Integer port, String dlRepo, String repo, String tmpDir, String dns,
            String logLevel)
    {
        QueryResult r = cnx.runUpdate("node_insert", dlRepo, dns, true, 0, 0, false, false, true, nodeName, port, repo, logLevel, false,
                tmpDir);
        Node res = new Node();
        res.id = r.getGeneratedId();
        res.name = nodeName;
        res.dns = dns;
        res.port = port;
        res.dlRepo = dlRepo;
        res.tmpDirectory = tmpDir;
        res.repo = repo;
        res.loadApiAdmin = false;
        res.loadApiClient = false;
        res.loapApiSimple = false;
        res.enabled = true;
        res.stop = false;

        return res;
    }
762539
def addNode(self, node):
        
        LOGGER.info('Adding node {}({})'.format(node.name, node.address))
        message = {
            'addnode': {
                'nodes': [{
                    'address': node.address,
                    'name': node.name,
                    'node_def_id': node.id,
                    'primary': node.primary,
                    'drivers': node.drivers,
                    'hint': node.hint
                }]
            }
        }
        self.send(message)
228551
def add(self, root):
        
        node = Element('import', ns=self.xsdns)
        node.set('namespace', self.ns)
        if self.location is not None:
            node.set('schemaLocation', self.location)
        log.debug('%s inserted', node)
        root.insert(node)
214894
def _create_ring(self, nodes):
        
        for node_name, node_conf in nodes:
            for w in range(0, node_conf['vnodes'] * node_conf['weight']):
                self._distribution[node_name] += 1
                self._ring[self.hashi('%s-%s' % (node_name, w))] = node_name
        self._keys = sorted(self._ring.keys())