Adds host to stack inventory
503673
def add_to_inventory(self):
        """"""
        if not self.server_attrs:
            return
        for addy in self.server_attrs[A.server.PUBLIC_IPS]:
            self.stack.add_host(addy, self.groups, self.hostvars)
635701
public ContainerRequest setupContainerAskForRM(int containerMemory, int containerVirtualCores, int priority, String[] racks, String[] hosts) {
        Priority pri = Priority.newInstance(priority);
        Resource capability = Resource.newInstance(containerMemory,
                containerVirtualCores);
        ContainerRequest request = new ContainerRequest(capability, hosts, racks,
                pri, false);
        LOG.info("By Thrift Server Requested container  ask: " + request.toString());
        return request;
    }
195163
def cli(env):
    """"""
    manager = PlacementManager(env.client)
    result = manager.list()
    table = formatting.Table(
        ["Id", "Name", "Backend Router", "Rule", "Guests", "Created"],
        title="Placement Groups"
    )
    for group in result:
        table.add_row([
            group['id'],
            group['name'],
            group['backendRouter']['hostname'],
            group['rule']['name'],
            group['guestCount'],
            group['createDate']
        ])

    env.fout(table)
877159
function _add_permanently_to(stack, item_or_list){
	if( item_or_list && tcache[stack] ){
	    if( ! us.isArray(item_or_list) ){ // atom
		tcache[stack].push(item_or_list);
	    }else{ // list
		tcache[stack] = tcache[stack].concat(item_or_list);
	    }
	}
	return tcache[stack];
    }
375256
def do_stack(self,args):
        """"""
        parser = CommandArgumentParser("stack")
        parser.add_argument(dest='stack',help='stack index or name');
        args = vars(parser.parse_args(args))

        print "loading stack {}".format(args['stack'])
        try:
            index = int(args['stack'])            
            stackSummary = self.wrappedStack['resourcesByTypeIndex']['AWS::CloudFormation::Stack'][index]
        except ValueError:
            stackSummary = self.wrappedStack['resourcesByTypeName']['AWS::CloudFormation::Stack'][args['stack']]

        self.stackResource(stackSummary.stack_name,stackSummary.logical_id)
999555
function(virtualIps) {

        if (!virtualIps) {
            return;
        }

        var self = this;

        self.virtualIps = [];

        _.each(virtualIps, function(virtualIp) {
            self.virtualIps.push(new rackspace.VirtualIp(virtualIp));
        });
    }
1024476
def addHost(self, name=None):
        '''
        
        '''
        if name is None:
            while True:
                name = 'h' + str(self.__hnum)
                self.__hnum += 1
                if name not in self.__nxgraph:
                    break
        self.__addNode(name, Host)
        return name
75589
def add_host(self, ip, mac):
		
		msg = OmapiMessage.open(b"host")
		msg.message.append((b"create", struct.pack("!I", 1)))
		msg.message.append((b"exclusive", struct.pack("!I", 1)))
		msg.obj.append((b"hardware-address", pack_mac(mac)))
		msg.obj.append((b"hardware-type", struct.pack("!I", 1)))
		msg.obj.append((b"ip-address", pack_ip(ip)))
		response = self.query_server(msg)
		if response.opcode != OMAPI_OP_UPDATE:
			raise OmapiError("add failed")
886978
def _add_index_server(self):
        """"""
        index_servers = '\n\t'.join(self.servers.keys())
        self.conf.set('distutils', 'index-servers', index_servers)
980071
protected void addUserToContainer(IndexedContainer container, CmsUser user) {

        if (m_blackList.contains(user)) {
            return;
        }
        Item item = container.addItem(user);
        fillItem(item, user);
    }
974986
def _build_inventory(self, cluster):
        
        inventory_data = defaultdict(list)
        for node in cluster.get_all_nodes():
            if node.kind not in self.groups:
                # FIXME: should this raise a `ConfigurationError` instead?
                warn("Node kind `{0}` not defined in cluster!".format(node.kind))
                continue
            extra_vars = ['ansible_user=%s' % node.image_user]
            # check for nonstandard port, either IPv4 or IPv6
            if node.preferred_ip and ':' in node.preferred_ip:
                match = IPV6_RE.match(node.preferred_ip)
                if match:
                    host_port = match.groups()[1]
                else:
                    _, _, host_port = node.preferred_ip.partition(':')
                if host_port:
                    extra_vars.append('ansible_port=%s' % host_port)

            if node.kind in self.environment:
                extra_vars.extend('%s=%s' % (k, v) for k, v in
                                  self.environment[node.kind].items())
            for group in self.groups[node.kind]:
                connection_ip = node.preferred_ip
                if connection_ip:
                    inventory_data[group].append(
                        (node.name, connection_ip, str.join(' ', extra_vars)))

        if not inventory_data:
            elasticluster.log.info("No inventory file was created.")
            return None

        # create a temporary file to pass to ansible, since the
        # api is not stable yet...
        if self._storage_path_tmp:
            if not self._storage_path:
                self._storage_path = tempfile.mkdtemp()
            elasticluster.log.warning(
                "Writing inventory file to tmp dir `%s`", self._storage_path)

        inventory_path = os.path.join(
            self._storage_path, (cluster.name + '.inventory'))
        log.debug("Writing Ansible inventory to file `%s` ...", inventory_path)
        with open(inventory_path, 'w+') as inventory_file:
            for section, hosts in inventory_data.items():
                # Ansible throws an error "argument of type 'NoneType' is not
                # iterable" if a section is empty, so ensure we have something
                # to write in there
                if hosts:
                    inventory_file.write("\n[" + section + "]\n")
                    for host in hosts:
                        # don't want port, makes it look like ipv6
                        if ':' in host[1]:
                            match = IPV6_RE.match(node.preferred_ip)
                            if match:
                                host = (host[0], match.groups()[0], host[2])
                            else:
                                host = (host[0], host[1].partition(':')[0],
                                        host[2])
                        hostline = "%s ansible_host=%s %s\n" % host
                        inventory_file.write(hostline)
        return inventory_path
1086856
private void setupHost(ListItemHostWidget host, Widget view, final int dataIndex) {
        boolean selected = setupView(view, dataIndex);
        host.setGuest(view, dataIndex);
        host.setSelected(selected);
        host.requestLayout();

        if (mContent.getChildren().contains(host)) {
            Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "setupItem(%s): added item(%s) at dataIndex [%d]",
                    getName(), view.getName(), dataIndex);
        } else {
            Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "setupItem(%s): reuse item(%s) at dataIndex [%d]",
                    getName(), view.getName(), dataIndex);
        }
    }
1158771
def cli(env, identifier, sortby, cpu, domain, hostname, memory, tag, columns):
    """"""

    mgr = SoftLayer.DedicatedHostManager(env.client)
    guests = mgr.list_guests(host_id=identifier,
                             cpus=cpu,
                             hostname=hostname,
                             domain=domain,
                             memory=memory,
                             tags=tag,
                             mask=columns.mask())

    table = formatting.Table(columns.columns)
    table.sortby = sortby

    for guest in guests:
        table.add_row([value or formatting.blank()
                       for value in columns.row(guest)])

    env.fout(table)
504013
function addDeployPlugin(webpackConfig, wpkConfig, env) {
    env = proccessFtpPath(env);

    webpackConfig.plugins.push(new DeployPlugin({
        server: `${env.__ftp_user__}:${env.__ftp_password__}@${env.__ftp_host__}:${env.__ftp_port__}`,
        workspace: wpkConfig.output.path,
        deployTo: env.__ftp_path__
    }));
}
235186
public function addHost(Host $host)
    {
        if (empty($host)) return $this;

        $this->_host_list["{$host->name}:{$host->port}"] = $host;

        return $this;
    }
67261
def addthisbunch(bunchdt, data, commdct, thisbunch, theidf):
    """"""
    key = thisbunch.key.upper()
    obj = copy.copy(thisbunch.obj)
    abunch = obj2bunch(data, commdct, obj)
    bunchdt[key].append(abunch)
    return abunch
431477
def _parse_hosts_inventory(self, inventory_path):
        
        hosts_contents = []
        if os.path.isdir(inventory_path):
            self.log.debug("Inventory path {} is a dir. Looking for inventory files in that dir.".format(inventory_path))
            for fname in os.listdir(inventory_path):
                # Skip .git folder
                if fname == '.git':
                    continue
                path = os.path.join(inventory_path, fname)
                if os.path.isdir(path):
                    continue
                with codecs.open(path, 'r', encoding='utf8') as f:
                    hosts_contents += f.readlines()
        else:
            self.log.debug("Inventory path {} is a file. Reading as inventory.".format(inventory_path))
            with codecs.open(inventory_path, 'r', encoding='utf8') as f:
                hosts_contents = f.readlines()

        # Parse inventory and apply it to the hosts
        hosts_parser = parser.HostsParser(hosts_contents)
        for hostname, key_values in hosts_parser.hosts.items():
            self.update_host(hostname, key_values)