[augeas-devel] "put_failed" for /etc/network/interfaces on Debian

Francis Giraldeau francis.giraldeau at usherbrooke.ca
Mon Jun 6 17:33:08 UTC 2011


On Mon, 2011-06-06 at 12:51 -0400, Adam Kosmin wrote:
> I am able to reproduce this error on both Debian sqeeze and wheezy.
> Corresponding package versions of augeas-lenses are 0.7.2-1 (squeeze)
> and 0.7.3-1 (wheezy)
> 
> 
> augtool> print /files/etc/network/interfaces
> /files/etc/network/interfaces
> /files/etc/network/interfaces/#comment = "The loopback network
> interface"
> /files/etc/network/interfaces/auto
> /files/etc/network/interfaces/auto/1 = "lo"
> /files/etc/network/interfaces/iface[1] = "lo"
> /files/etc/network/interfaces/iface[1]/family = "inet"
> /files/etc/network/interfaces/iface[1]/method = "loopback"
> /files/etc/network/interfaces/iface[1]/#comment = "The primary network
> interface"
> /files/etc/network/interfaces/allow-hotplug
> /files/etc/network/interfaces/allow-hotplug/1 = "eth0"
> /files/etc/network/interfaces/iface[2] = "eth0"
> /files/etc/network/interfaces/iface[2]/family = "inet"
> /files/etc/network/interfaces/iface[2]/method = "dhcp"
> 
> augtool> set /files/etc/network/interfaces/iface[last()+1] eth1
> augtool> set /files/etc/network/interfaces/iface[last()+1]/family inet
> augtool> set /files/etc/network/interfaces/iface[last()+1]/method dhcp

Once the first last()+1 executes, a new entry is created. Then, to
access it, you should use only last().

test Interfaces.lns put "" after 
	set "/iface[last()+1]" "eth1";
	set "/iface[last()]/family" "inet";
	set "/iface[last()]/method" "dhcp" = 
"iface eth1 inet dhcp
"

Cheer, 

Francis




More information about the augeas-devel mailing list