original_docstring: 
          Get module config from dhcpcd.conf.
  
          dhcpcd.conf is the default network manager on raspbian stretch and above
  
          Notes:
              See notes about network configuration in stretch and above:
              https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip-address/37921# 37921
  
          Args:
              interfaces_names (list): list of all existing interfaces names
  
          Returns:
              dict: configured interfaces::
  
              {
                  interface name (string): {
                      interface (string): interface name,
                      mode (string): interface mode (see etcnetworkinterface MODE_XXX)
                      address (string): ip address
                      netmask (string): netmask address
                      gateway (string): gateway address
                      dnsnameservers (string): dns nameservers
                      wifi (bool): True if interface is wifi
                      wifinetwork (string): name of network if device is connected via wifi
                  },
                  ...
              }
  
          
docstring: Get module config from dhcpcd.conf.
  dhcpcd.conf is the default network manager on raspbian stretch and above
  
  
docstring_tokens: Get module config from dhcpcd . conf . dhcpcd . conf is the default network manager on raspbian stretch and above
code: def _get_network_config_from_dhcpcd(self, interfaces_names):
          """
          Get module config from dhcpcd.conf.
  
          dhcpcd.conf is the default network manager on raspbian stretch and above
  
          Notes:
              See notes about network configuration in stretch and above:
              https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip-address/37921# 37921
  
          Args:
              interfaces_names (list): list of all existing interfaces names
  
          Returns:
              dict: configured interfaces::
  
              {
                  interface name (string): {
                      interface (string): interface name,
                      mode (string): interface mode (see etcnetworkinterface MODE_XXX)
                      address (string): ip address
                      netmask (string): netmask address
                      gateway (string): gateway address
                      dnsnameservers (string): dns nameservers
                      wifi (bool): True if interface is wifi
                      wifinetwork (string): name of network if device is connected via wifi
                  },
                  ...
              }
  
          """
          # get wired configuration from dhcpcd
          configured_interfaces = {}
          dhcpcd_config = self.dhcpcd.get_configurations()
          self.logger.debug('dhcpcd_config: %s' % dhcpcd_config)
  
          # add more infos (iterates over current status because with dhcpcd does not return dhcp configured interfaces)
          for interface_name in interfaces_names:
              # add new entry. Dict entry content is imitating output of etcnetworkinterfaces library.
              configured_interfaces[interface_name] = {
                  'interface': interface_name,
                  'mode': None,
                  'address': None,
                  'netmask': None,
                  'gateway': None,
                  'dnsnameservers': None,
                  'wifi': None,
                  'wifinetwork': None,
              }
  
              # fill config with dhcpcd data
              if interface_name in dhcpcd_config:
                  # interface is configured
                  configured_interfaces[interface_name].update({
                      'mode': self.etcnetworkinterfaces.MODE_STATIC,
                      'address': dhcpcd_config[interface_name]['ip_address'],
                      'netmask': dhcpcd_config[interface_name]['netmask'],
                      'gateway': dhcpcd_config[interface_name]['gateway'],
                      'dnsnameservers': dhcpcd_config[interface_name]['dns_address'],
                  })
              else:
                  # interface has no configuration, set mode has dhcp
                  configured_interfaces[interface_name].update({
                      'mode': self.etcnetworkinterfaces.MODE_DHCP
                  })
  
              # fill config with wifi config
              if interface_name in self.wifi_interfaces:
                  # wifi interface
                  configured_interfaces[interface_name].update({
                      'wifi': True,
                      'wifinetwork': self.wifi_interfaces[interface_name]['network'],
                  })
              else:
                  # interface is not wifi
                  configured_interfaces[interface_name].update({
                      'wifi': False,
                      'wifinetwork': None,
                  })
  
          return configured_interfaces
code_tokens: def _get_network_config_from_dhcpcd ( self , interfaces_names ) : configured_interfaces = { } dhcpcd_config = self . dhcpcd . get_configurations ( ) self . logger . debug ( 'dhcpcd_config: %s' % dhcpcd_config ) for interface_name in interfaces_names : configured_interfaces [ interface_name ] = { 'interface' : interface_name , 'mode' : None , 'address' : None , 'netmask' : None , 'gateway' : None , 'dnsnameservers' : None , 'wifi' : None , 'wifinetwork' : None , } if interface_name in dhcpcd_config : configured_interfaces [ interface_name ] . update ( { 'mode' : self . etcnetworkinterfaces . MODE_STATIC , 'address' : dhcpcd_config [ interface_name ] [ 'ip_address' ] , 'netmask' : dhcpcd_config [ interface_name ] [ 'netmask' ] , 'gateway' : dhcpcd_config [ interface_name ] [ 'gateway' ] , 'dnsnameservers' : dhcpcd_config [ interface_name ] [ 'dns_address' ] , } ) else : configured_interfaces [ interface_name ] . update ( { 'mode' : self . etcnetworkinterfaces . MODE_DHCP } ) if interface_name in self . wifi_interfaces : configured_interfaces [ interface_name ] . update ( { 'wifi' : True , 'wifinetwork' : self . wifi_interfaces [ interface_name ] [ 'network' ] , } ) else : configured_interfaces [ interface_name ] . update ( { 'wifi' : False , 'wifinetwork' : None , } ) return configured_interfaces
short_docstring: Get module config from dhcpcd.conf.
short_docstring_tokens: Get module config from dhcpcd . conf .
comment: """
          Get module config from dhcpcd.conf.
  
          dhcpcd.conf is the default network manager on raspbian stretch and above
  
          Notes:
              See notes about network configuration in stretch and above:
              https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip-address/37921# 37921
  
          Args:
              interfaces_names (list): list of all existing interfaces names
  
          Returns:
              dict: configured interfaces::
  
              {
                  interface name (string): {
                      interface (string): interface name,
                      mode (string): interface mode (see etcnetworkinterface MODE_XXX)
                      address (string): ip address
                      netmask (string): netmask address
                      gateway (string): gateway address
                      dnsnameservers (string): dns nameservers
                      wifi (bool): True if interface is wifi
                      wifinetwork (string): name of network if device is connected via wifi
                  },
                  ...
              }
  
          """$SEP$# get wired configuration from dhcpcd$SEP$# add more infos (iterates over current status because with dhcpcd does not return dhcp configured interfaces)$SEP$# add new entry. Dict entry content is imitating output of etcnetworkinterfaces library.$SEP$# fill config with dhcpcd data$SEP$# interface is configured$SEP$# interface has no configuration, set mode has dhcp$SEP$# fill config with wifi config$SEP$# wifi interface$SEP$# interface is not wifi