Bug 1198282

Summary: Bad parsing of network-scripts/ifcfg-xxxx files by sysconfig.aug lens
Product: Red Hat Enterprise Linux 7 Reporter: Laine Stump <laine>
Component: augeasAssignee: Dominic Cleal <dcleal>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.1CC: dcleal, dyuan, honzhang, huzhan, jiri.lunacek, leiwang, mzhan, wshi, xchen
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: augeas-1.4.0-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 761246 Environment:
Last Closed: 2015-11-19 10:18:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 761246    

Description Laine Stump 2015-03-03 17:22:13 UTC
+++ This bug was initially created as a clone of Bug #761246 +++

Please see original BZ for full history. In short, netcf was failing to parse ifcfg files with the following characteristics:

1) lines ending in ";":

   ^DEVICE="eth0";

2) lines containing a variable setting followed by a partial line comment:

   ^DEVICE="eth0"  # bob loblaw

3) lines starting with whitespace:

   ^   DEVICe="eth0"

This was because netcf had its own private copy of the sysconfig.aug augeas lens, which was seriously out of date.

netcf has been patched to remove the private sysconfig.aug, which eliminates problems 1 & 2 (at least when using augeas-1.3.0), but problem 3 remains. That one can be fixed with the following patch, which hasn't yet been pushed to augeas upstream:

  https://github.com/hercules-team/augeas/pull/212/files

Please either rebase augeas to a version containing the above patch, or backport the latest version of sysconfig.aug.

Comment 1 Dominic Cleal 2015-03-13 15:56:11 UTC
Third case fixed in 3bc029d, the other two already seem to work in el7.

Comment 5 Hu Jianwei 2015-06-29 02:05:54 UTC
Using the latest augeas version:

[root@localhost ~]# rpm -q netcf libvirt augeas
netcf-0.2.8-1.el7.x86_64
libvirt-1.2.16-1.el7.x86_64
augeas-1.4.0-1.el7.x86_64

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
  DEVICE=eth1;
ONBOOT=yes;
IPV6INIT="yes";
IPV6_AUTOCONF="no";
DHCPV6C="no";
IPV6ADDR="2002::200/64";
IPV6ADDR_SECONDARIES="2002::201/64 2002::202/64";
[root@localhost ~]# virsh iface-list --all
 Name                 State      MAC Address
---------------------------------------------------
 br888                inactive   
 eno1                 active     24:be:05:18:81:ce
 eth1                 inactive   
 lo                   active     00:00:00:00:00:00

[root@localhost ~]# virsh iface-dumpxml eth1
<interface type='ethernet' name='eth1'>
  <start mode='onboot'/>
  <protocol family='ipv6'>
    <ip address='2002::200' prefix='64'/>
    <ip address='2002::201' prefix='64'/>
    <ip address='2002::202' prefix='64'/>
  </protocol>
</interface>

I can not reproduce it anymore.

Comment 6 Xianghua Chen 2015-09-15 10:18:55 UTC
Verified with the package:
netcf-0.2.8-1.el7.x86_64
augeas-1.4.0-2.el7.x86_64

Verify steps:

[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
  DEVICE=eth1;  
ONBOOT=yes;
IPV6INIT="yes";
IPV6_AUTOCONF="no";
DHCPV6C="no";
IPV6ADDR="2002::200/64";
IPV6ADDR_SECONDARIES="2002::201/64 2002::202/64";

[root@localhost ~]# virsh iface-list --all
 Name                 State      MAC Address
---------------------------------------------------
 enp1s0               active     64:31:50:19:b9:74
 eth1                 inactive   
 lo                   active     00:00:00:00:00:00

[root@localhost ~]# virsh iface-dumpxml eth1
<interface type='ethernet' name='eth1'>
  <start mode='onboot'/>
  <protocol family='ipv6'>
    <ip address='2002::200' prefix='64'/>
    <ip address='2002::201' prefix='64'/>
    <ip address='2002::202' prefix='64'/>
  </protocol>
</interface>

Can not reproduce it, so verified

Comment 7 errata-xmlrpc 2015-11-19 10:18:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2015-2153.html