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

Jonas Eriksson jonas.j.eriksson at ericsson.com
Mon Sep 7 06:44:47 UTC 2009


On Fri, Sep 04, 2009 at 04:27:13PM -0700 David Lutterkort wrote:
> 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.

ACK to this series, looks good.

/Jonas

-- 
Jonas Eriksson
Consultant at AS/EAB/FLJ/IL
Phone: +46 8 58086281
Combitech AB
Älvsjö, Sweden


More information about the netcf-devel mailing list