<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 24 Apr 2013, at 3:50 PM, Raphaël Pinson <<a href="mailto:raphael.pinson@camptocamp.com">raphael.pinson@camptocamp.com</a>> wrote:</div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">set /files/etc/fstab/1[file='/home/monica/minfrin']/spec "/dev/vg001/home-monica-minfrin2"<br></blockquote><div><br></div><div style="">This line doesn't really make sense: you're selecting the first entry, but only if its file value is "/home/monica/minfin". I guess you want:</div>
<div style=""><br></div><div style="">    set /files/etc/fstab/*[file='/home/monica/minfrin']/spec "/dev/vg001/home-monica-minfrin2"<br></div><div><br></div><div style="">which will update whichever entry matches the condition (not only if it's the first one). If you want only the first entry matching the condition, then use:</div>
<div style=""><br></div><div style=""><div>    set /files/etc/fstab/*[file='/home/monica/minfrin'][1]/spec "/dev/vg001/home-monica-minfrin2"<br></div></div></div></div></div></blockquote><div><br></div><div>This worked, thank you:</div><div><br></div><div><div>augtool -s <<-EOF</div><div>set /files/etc/fstab/*[file='/home/monica/minfrin']/spec "/dev/vg001/home-monica-minfrin2"</div><div>print /augeas//error</div><div>EOF</div><div><br></div></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div style="">The entry didn't exist at all (or was not the first entry, as mentioned above), so your "set" command created a "spec" node in the tree, without the other mandatory sibling nodes for a valid fstab entry. When trying to save the new tree to the file, it failed because the tree was not valid.</div></div></div></div></blockquote><div><br></div><div>Does a mechanism exist for the lens to sanity check preconditions, and then return human readable error messages for each condition?</div><div><br></div><div>Regards,</div><div>Graham</div><div>--</div><div><br></div></div></body></html>