[netcf-devel] Improved logic for finding ifcfg- files (BZ 512950)

David Lutterkort lutter at redhat.com
Fri Sep 4 23:27:13 UTC 2009


When we look for the ifcfg file for an interface DEV, we can't just blindly
take ifcfg-$DEV, since that might not exist, or even the ifcfg file with an
entry 'DEVICE=$DEV', since there might be multiple such files.

Instead, we need to follow the logic in need_config in
/etc/sysconfig/network-scripts/network-functions; that logic is
  * ignore any ifcfg file whose extension matches __sed_discard_ignored_files
  * if ifcfg-$DEV exists, use that
  * get the MAC address of $DEV and find the ifcfg file with a
    matching HWADDR= entry. If that exists, use it
  * use an ifcfg-* file with entry DEVICE=$DEV (the first one that appears
    when expanding hte glob ifcfg-*)

All this was sparked by BZ 512590, where danpb noticed that netcf stumbles
over editor backup files.

David


More information about the netcf-devel mailing list