[augeas-devel] Recreating a subtree doesn't produce a valid tree

Matt Palmer matt at anchor.net.au
Sun May 10 21:56:13 UTC 2009


I'm trying to do edits to /etc/network/interfaces, and failing abysmally. 
In an attempt to work out what I was doing wrong, I decided to delete and
exactly recreate a known-good interface stanza, and go from there.

Lo and behold, recreating a subtree that had previously saved just fine
*still* produced the error.  WTF am I doing wrong?  I have no idea.  The
error message isn't the most enlightening I've seen. Slightly lengthy
typescript session follows, to allow reproduction of the problem if desired. 
Suggestions appreciated.

-----8<-----

matt at pirate:~$ script
Script started, file is typescript
matt at pirate:~$ cat /tmp/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        gateway 192.168.1.254
matt at pirate:~$ AUGEAS_ROOT=/tmp augtool
augtool> ls /files/etc/network/interfaces
#comment[1] = This file describes the network interfaces available on your system
#comment[2] = and how to activate them. For more information, see interfaces(5).
#comment[3] = The loopback network interface
auto[1]/ = (none)
iface[1]/ = lo
auto[2]/ = (none)
iface[2]/ = eth0
augtool> ls /files/etc/network/interfaces/iface[2]
family = inet
method = static
address = 192.168.1.1
netmask = 255.255.255.0
gateway = 192.168.1.254
augtool> set /files/etc/network/interfaces/iface[2]/address 192.168.1.10
augtool> save
Saved 1 file(s)
augtool> exit
matt at pirate:~$ cat /tmp/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.1.10
        netmask 255.255.255.0
        gateway 192.168.1.254
matt at pirate:~$ AUGEAS_ROOT=/tmp augtool
augtool> rm /files/etc/network/interfaces/iface[2]
rm : /files/etc/network/interfaces/iface[2] 7
augtool> save  
Saved 1 file(s)
augtool> exit
matt at pirate:~$ cat /tmp/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
matt at pirate:~$ AUGEAS_ROOT=/tmp augtool
augtool> set /files/etc/network/interfaces/iface[2] eth0
augtool> set /files/etc/network/interfaces/iface[2]/address 192.168.1.10
augtool> set /files/etc/network/interfaces/iface[2]/netmask 255.255.255.0
augtool> set /files/etc/network/interfaces/iface[2]/gateway 192.168.1.254
augtool> set /files/etc/network/interfaces/iface[2]/method static
augtool> set /files/etc/network/interfaces/iface[2]/family inet
augtool> ls /files/etc/network/interfaces/iface[2]
address = 192.168.1.10
netmask = 255.255.255.0
gateway = 192.168.1.254
method = static
family = inet  
augtool> save  
Saving failed
augtool> ls /augeas/files/etc/network/interfaces/error
path = /files/etc/network/interfaces/iface
lens = /usr/share/augeas/lenses/dist/interfaces.aug:76.16-80.67
message = Failed to match /(family/)(method/)((#comment/)|(/))(((#comment/)|(/))*)((((allow-[a-z-][a-z-][a-z-]*_[_a-z-]*|allow-[a-z-]_[_a-z-]*|allow-(_[_a-z-]*|)|allow([_a-z][_a-z-]*|)|allo([_a-vx-z-][_a-z-]*|)|all([_a-np-z-][_a-z-]*|)|auto[_a-z-][_a-z-]*|aut([_a-np-z-][_a-z-]*|)|au([_a-su-z-][_a-z-]*|)|al([_a-km-z-][_a-z-]*|)|iface[_a-z-][_a-z-]*|ifac([_a-df-z-][_a-z-]*|)|ifa([_abd-z-][_a-z-]*|)|if([_b-z-][_a-z-]*|)|mapping[_a-z-][_a-z-]*|mappin([_a-fh-z-][_a-z-]*|)|mappi([_a-mo-z-][_a-z-]*|)|mapp([_a-hj-z-][_a-z-]*|)|map([_a-oq-z-][_a-z-]*|)|ma([_a-oq-z-][_a-z-]*|)|(m[_b-z-]|i[_a-eg-z-]|a[_a-km-tv-z-]|[_b-hj-ln-z-][_a-z-])[_a-z-]*|m|i|a|[_b-hj-ln-z-])/)((((allow-[a-z-][a-z-][a-z-]*_[_a-z-]*|allow-[a-z-]_[_a-z-]*|allow-(_[_a-z-]*|)|allow([_a-z][_a-z-]*|)|allo([_a-vx-z-][_a-z-]*|)|all([_a-np-z-][_a-z-]*|)|auto[_a-z-][_a-z-]*|aut([_a-np-z-][_a-z-]*|)|au([_a-su-z-][_a-z-]*|)|al([_a-km-z-][_a-z-]*|)|iface[_a-z-][_a-z-]*|ifac([_a-df-z-][_a-z-]*|)|ifa([_abd-z-][_a-z-]*|)|if([_b-z-][_a-z-]*|)|mapping[_a-z-][_a-z-]*|mappin([_a-fh-z-][_a-z-]*|)|mappi([_a-mo-z-][_a-z-]*|)|mapp([_a-hj-z-][_a-z-]*|)|map([_a-oq-z-][_a-z-]*|)|ma([_a-oq-z-][_a-z-]*|)|(m[_b-z-]|i[_a-eg-z-]|a[_a-km-tv-z-]|[_b-hj-ln-z-][_a-z-])[_a-z-]*|m|i|a|[_b-hj-ln-z-])/)|(#comment/)|(/))*))?)/ with address/netmask/gateway/method/family/
augtool>

----->8-----


-- 
Matt Palmer - Systems Administrator

A view into the Anchor Engineroom: http://anchor.com.au/blog/
Web Hosting Knowledgebase: http://anchor.com.au/wiki/

Anchor Systems Pty Ltd - Hosting Heavyweights
W: http://www.anchor.com.u - E: support at anchor.com.au
Phone: 1300 883 979 - Fax: 02 8296 5199




More information about the augeas-devel mailing list