Finds the default network.
348085
def get_default_network(zone)
      params = {
          'command' => 'listNetworks',
          'isDefault' => true,
          'zoneid' => zone
      }
      json = send_request(params)

      networks = json['network']
      return nil if !networks || networks.empty?

      default = networks.first
      return default if networks.length == 1

      networks.each { |n|
        if n['type'] == 'Direct' then
          default = n
          break
        end
      }

      default
    end
289791
public function getDefaultChannel()
    {
        if (!isset($this->getConnectionMap()[$this->defaultConnectionName])) {
            throw new DefaultConnectionNotFoundException(
                'Default queue connection not found, You can fix this by adding RabbitMqEnv::RABBITMQ_DEFAULT_CONNECTION = true in your queue connection in config_* files'
            );
        }

        return $this->getConnectionMap()[$this->defaultConnectionName]->getChannel();
    }
1134882
public static function getDefaultConnection()
    {
        if (self::$defaultConnection === null) {
            $databaseSettings = StemSettings::singleton();

            self::$defaultConnection = static::getConnection($databaseSettings);

            if ($databaseSettings->stickyWriteConnection) {
                self::$readOnlyConnection = self::$defaultConnection;
            }
        }

        return self::$defaultConnection;
    }
577347
def get_default_config(self):
        
        config = super(ConnTrackCollector, self).get_default_config()
        config.update({
            "path":  "conntrack",
            "dir":   "/proc/sys/net/ipv4/netfilter,/proc/sys/net/netfilter",
            "files": "ip_conntrack_count,ip_conntrack_max,"
                     "nf_conntrack_count,nf_conntrack_max",
        })
        return config
575221
def get_default_config(self):
        
        default_config = super(SNMPRawCollector,
                               self).get_default_config()
        default_config.update({
            'oids': {},
            'path_prefix': 'servers',
            'path_suffix': 'snmp',
        })
        return default_config
127805
def get_default_config(self):
        
        config = super(NtpdCollector, self).get_default_config()
        config.update({
            'path':         'ntpd',
            'ntpq_bin':     self.find_binary('/usr/bin/ntpq'),
            'ntpdc_bin':    self.find_binary('/usr/bin/ntpdc'),
            'use_sudo':     False,
            'sudo_cmd':     self.find_binary('/usr/bin/sudo'),
        })
        return config
513430
def _parse_current_network_settings():
    '''
    
    '''
    opts = salt.utils.odict.OrderedDict()
    opts['networking'] = ''

    if os.path.isfile(_DEB_NETWORKING_FILE):
        with salt.utils.files.fopen(_DEB_NETWORKING_FILE) as contents:
            for line in contents:
                salt.utils.stringutils.to_unicode(line)
                if line.startswith('#'):
                    continue
                elif line.startswith('CONFIGURE_INTERFACES'):
                    opts['networking'] = line.split('=', 1)[1].strip()

    hostname = _parse_hostname()
    domainname = _parse_domainname()
    searchdomain = _parse_searchdomain()

    opts['hostname'] = hostname
    opts['domainname'] = domainname
    opts['searchdomain'] = searchdomain
    return opts
761250
def network_show(self, name):
        '''
        
        '''
        nt_ks = self.compute_conn
        net_list = nt_ks.networks.list()
        return self._network_show(name, net_list)
50409
def delete_network(self, network):
        '''
        
        '''
        net_id = self._find_network_id(network)
        ret = self.network_conn.delete_network(network=net_id)
        return ret if ret else True
1138462
def show_network_ip_availability(self, network, **_params):
        """"""
        return self.get(self.network_ip_availability_path % (network),
                        params=_params)
885362
def get_network(network_id):
    """"""
    try:
        net = models.Network.query.filter_by(id=network_id).one()
    except NoResultFound:
        return error_response(error_type="/network GET: no network found", status=403)

    # return the data
    return success_response(network=net.__json__())
1056995
def get_default_config(self):
        
        config = super(UnboundCollector, self).get_default_config()
        config.update({
            'path':         'unbound',
            'bin':          self.find_binary('/usr/sbin/unbound-control'),
            'histogram':    True,
        })
        return config
958545
function findSystemPortRange() {
  if (systemRange) {
    return systemRange;
  }
  var range = process.platform === 'win32' ?
      findWindowsPortRange() : findUnixPortRange();
  return systemRange = range.thenCatch(function() {
    return DEFAULT_IANA_RANGE;
  });
}
1140967
def get_default_config(self):
        
        default_config = super(SNMPInterfaceCollector,
                               self).get_default_config()
        default_config['path'] = 'interface'
        default_config['byte_unit'] = ['bit', 'byte']
        return default_config
134222
def getNetworkName(self):
        """"""
        print '%s call getNetworkname' % self.port
        networkName = self.__sendCommand(WPANCTL_CMD + 'getprop -v Network:Name')[0]
        return self.__stripValue(networkName)
526445
def _default_interface(self, route_output=None):
        
        if not route_output:
            out, __, __ = exec_cmd('/sbin/ip route')
            lines = out.splitlines()
        else:
            lines = route_output.split("\n")

        for line in lines:
            line = line.split()
            if 'default' in line:
                iface = line[4]
                return self.interfaces.get(iface, None)
359697
def find_default(self, filename):
        
        for path in self.DEFAULT_PATH:
            # Normalize path
            path = os.path.expanduser(os.path.expandvars(path))
            fullname = os.path.realpath(os.path.join(path, filename))

            if os.path.exists(fullname) and os.path.isfile(fullname):
                yield fullname