Returns the control connection host metadata.
322718
def get_control_connection_host(self):
        
        connection = self.control_connection._connection
        endpoint = connection.endpoint if connection else None
        return self.metadata.get_host(endpoint) if endpoint else None
398724
def get_execution_host_info():
    
    host = os.environ.get('HOSTNAME', None)
    cluster = os.environ.get('SGE_O_HOST', None)
    if host is None:
        try:
            import socket
            host = host or socket.gethostname()
        except:
            pass
    return host or 'unknown', cluster or 'unknown'
152274
def _ExtractInterfaceMetadata(self, metadata):
    
    interfaces = []
    for network_interface in metadata:
      mac_address = network_interface.get('mac')
      interface = self.network_utils.GetNetworkInterface(mac_address)
      ip_addresses = []
      if interface:
        ip_addresses.extend(network_interface.get('forwardedIps', []))
        if self.ip_aliases:
          ip_addresses.extend(network_interface.get('ipAliases', []))
        if self.target_instance_ips:
          ip_addresses.extend(network_interface.get('targetInstanceIps', []))
        interfaces.append(NetworkDaemon.NetworkInterface(
            interface, ip_addresses, network_interface.get('ip', [])))
      else:
        message = 'Network interface not found for MAC address: %s.'
        self.logger.warning(message, mac_address)
    return interfaces
1302793
def get_default_connection_details():
    

    return {
        'host': os.environ.get('MYSQL_HOST', '127.0.0.1'),
        'user': os.environ.get('MYSQL_USER', 'vagrant'),
        'password': os.environ.get('MYSQL_PASSWORD', 'vagrant'),
        'database': os.environ.get('MYSQL_DB', 'thanatos'),
    }
1032931
def _get_esxcluster_proxy_details():
    '''
    
    '''
    det = __salt__['esxcluster.get_details']()
    return det.get('vcenter'), det.get('username'), det.get('password'), \
            det.get('protocol'), det.get('port'), det.get('mechanism'), \
            det.get('principal'), det.get('domain'), det.get('datacenter'), \
            det.get('cluster')
391417
def get_resources(connection):
    
    resp = connection.describe(verbose=False).split('\r\n')
    resources = [x.replace('a=control:','') for x in resp if (x.find('control:') != -1 and x[-1] != '*' )]
    return resources
611542
function (control) {
				var result = Object.create(null);
				var controlPropertiesFromMetadata = control.getMetadata().getProperties();

				result.meta = Object.create(null);
				result.meta.controlName = control.getMetadata().getName();

				result.properties = Object.create(null);
				Object.keys(controlPropertiesFromMetadata).forEach(function (key) {
					result.properties[key] = Object.create(null);
					result.properties[key].value = control.getProperty(key);
					result.properties[key].type = controlPropertiesFromMetadata[key].getType().getName ? controlPropertiesFromMetadata[key].getType().getName() : '';
				});

				return result;
			}
47585
private String getSystemHostName()
	{
		if (EventUtils.isEmptyOrNull(systemHostName)) {
			try {
				systemHostName = InetAddress.getLocalHost().getHostName();
			} catch (Throwable t) {
				systemHostName = "localhost";
			}
		}
		return systemHostName;
	}
356377
def obtain_hosting_device_credentials_from_config():
    
    cred_dict = get_specific_config('cisco_hosting_device_credential')
    attr_info = {
        'name': {'allow_post': True, 'allow_put': True,
                 'validate': {'type:string': None}, 'is_visible': True,
                 'default': ''},
        'description': {'allow_post': True, 'allow_put': True,
                        'validate': {'type:string': None},
                        'is_visible': True, 'default': ''},
        'user_name': {'allow_post': True, 'allow_put': True,
                      'validate': {'type:string': None},
                      'is_visible': True, 'default': ''},
        'password': {'allow_post': True, 'allow_put': True,
                     'validate': {'type:string': None},
                     'is_visible': True, 'default': ''},
        'type': {'allow_post': True, 'allow_put': True,
                 'validate': {'type:string': None}, 'is_visible': True,
                 'default': ''}}
    credentials = {}
    for cred_uuid, kv_dict in cred_dict.items():
        # ensure cred_uuid is properly formatted
        cred_uuid = uuidify(cred_uuid)
        verify_resource_dict(kv_dict, True, attr_info)
        credentials[cred_uuid] = kv_dict
    return credentials
1152530
def get_baremetal_physnet(self, context):
        """"""
        port = context.current
        host_id = context.host
        cmd = ['show network physical-topology hosts']
        try:
            response = self._run_eos_cmds(cmd)
            binding_profile = port.get(portbindings.PROFILE, {})
            link_info = binding_profile.get('local_link_information', [])
            for link in link_info:
                switch_id = link.get('switch_id')
                for host in response[0]['hosts'].values():
                    if switch_id == host['name']:
                        physnet = host['hostname']
                        LOG.debug("get_physical_network: Physical Network for "
                                  "%(host)s is %(physnet)s",
                                  {'host': host_id, 'physnet': physnet})
                        return physnet
            LOG.debug("Physical network not found for %(host)s",
                      {'host': host_id})
        except Exception as exc:
            LOG.error(_LE('command %(cmd)s failed with '
                      '%(exc)s'), {'cmd': cmd, 'exc': exc})
        return None
546147
def get_url_metadata(self):
        
        # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template
        metadata = dict(self._mdata['url'])
        metadata.update({'existing_string_values': self._my_map['url']})
        return Metadata(**metadata)
837719
def __get_connection_info():
    '''
    
    '''
    conn_info = {}

    try:
        conn_info['hostname'] = __opts__['mysql_auth']['hostname']
        conn_info['username'] = __opts__['mysql_auth']['username']
        conn_info['password'] = __opts__['mysql_auth']['password']
        conn_info['database'] = __opts__['mysql_auth']['database']

        conn_info['auth_sql'] = __opts__['mysql_auth']['auth_sql']
    except KeyError as e:
        log.error('%s does not exist', e)
        return None

    return conn_info
1345633
private Map<String, Object> getConnectionInfo() {
        String[] hostnames = (String[]) props.get(HOST_NAMES);
        int[] ports = (int[]) props.get(PORTS);

        String hostname = (hostnames == null || hostnames.length < 1) ? null : hostnames[0];
        String port = (ports == null || ports.length < 1) ? null : String.valueOf(ports[0]);

        return sslHelper.getConnectionInfo(hostname, port);
    }
106525
def _get_host_details(self):
        """"""
        # Assuming only one system present as part of collection,
        # as we are dealing with iLO's here.
        status, headers, system = self._rest_get('/rest/v1/Systems/1')
        if status < 300:
            stype = self._get_type(system)
            if stype not in ['ComputerSystem.0', 'ComputerSystem.1']:
                msg = "%s is not a valid system type " % stype
                raise exception.IloError(msg)
        else:
            msg = self._get_extended_error(system)
            raise exception.IloError(msg)

        return system
189870
private String hostAndPort() {
        int start = url.indexOf("://") + 3;
        int end = url.indexOf("/", start);
        return url.substring(start, end);
    }
870258
def get_dict(self):
        
        return {'hostname': self.get_name(),
                'address':  self.get_address(),
                'protocol': self.get_protocol(),
                'port':     self.get_tcp_port()}
846923
private HostInfo getClientHost() {
        String host = AppProperties.get(SSRKeys.SSR_CLIENT_HOST).orElse(null);
        if (isEmpty(host)) {
            logger.info("Client host not provided using '{}' to discover host address", discovery.getClass().getSimpleName());
            return discovery.resolveHost();
        } else {
            logger.info("Client host provided: {}", host);
            InetAddress address = tryParse(host);
            if (address != null) {
                return new HostInfo(address.getHostAddress(), address.getHostName());
            }
            return new HostInfo(host, host);
        }
    }