Bug 867783

Summary: The fstab lens doesn't accept all nfs4 options
Product: [Fedora] Fedora Reporter: Renich Bon Ciric <renich>
Component: augeasAssignee: David Lutterkort <lutter>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: apevec, dcleal, hbrock, lutter, mbooth
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-22 04:53:30 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Renich Bon Ciric 2012-10-18 05:44:33 EDT
Description of problem:
trying to add nfs4 entries with certain options fails

Version-Release number of selected component (if applicable):
augeas-0.10.0-3.fc17.x86_64

How reproducible:
do the following

su - 
cat << 'EOF' > commands
set /files/etc/fstab/#comment[last()+1] "NFSv4"
set /files/etc/fstab/01/spec "host10:/var/nfs/host10
set /files/etc/fstab/01/file /var/nfs/shares/host10
set /files/etc/fstab/01/vfstype nfs4
set /files/etc/fstab/01/opt[1] rw
set /files/etc/fstab/01/opt[2] noatime
set /files/etc/fstab/01/opt[5] "rsize=524288"
set /files/etc/fstab/01/opt[6] "wsize=524288"
set /files/etc/fstab/01/dump 0
set /files/etc/fstab/01/passno 0
save
print /augeas//error
EOF

augtool -ef commands


Actual results:
error: Failed to execute command
saving failed (run 'print /augeas//error' for details)
augtool> print /augeas//error
/augeas/files/etc/fstab/error = "put_failed"
/augeas/files/etc/fstab/error/path = "/files/etc/fstab/01"
/augeas/files/etc/fstab/error/lens = "/usr/share/augeas/lenses/dist/fstab.aug:25.17-32.22:"
/augeas/files/etc/fstab/error/message = "Failed to match \n    { /spec/ = /[^\\001-\\004\\t\\n #,][^\\001-\\004\\t\\n ]*/ }{ /file/ = /[^\\001-\\004\\t\\n #]+/ }{ /vfstype/ = /[^\\001-\\004\\t\\n #,=]+/ }({ /vfstype/ = /[^\\001-\\004\\t\\n #,=]+/ })*{ /opt/ = /[^\\001-\\004\\t\\n #,=]+/ }({ /opt/ = /[^\\001-\\004\\t\\n #,=]+/ })*({ /dump/ = /[0-9]+/ }({ /passno/ = /[0-9]+/ })?)?\n  with tree\n    { \"opt\" = \"rsize=524288\" } { \"opt\" = \"wsize=524288\" }"
/augeas/files/etc/mke2fs.conf/error = "parse_failed"
/augeas/files/etc/mke2fs.conf/error/pos = "82"
/augeas/files/etc/mke2fs.conf/error/line = "3"
/augeas/files/etc/mke2fs.conf/error/char = "0"
/augeas/files/etc/mke2fs.conf/error/lens = "/usr/share/augeas/lenses/dist/mke2fs.aug:132.10-.49:"
/augeas/files/etc/mke2fs.conf/error/message = "Get did not match entire input"
/augeas/files/etc/nsswitch.conf/error = "parse_failed"
/augeas/files/etc/nsswitch.conf/error/pos = "1055"
/augeas/files/etc/nsswitch.conf/error/line = "36"
/augeas/files/etc/nsswitch.conf/error/char = "0"
/augeas/files/etc/nsswitch.conf/error/lens = "/usr/share/augeas/lenses/dist/nsswitch.aug:88.10-.41:"
/augeas/files/etc/nsswitch.conf/error/message = "Iterated lens matched less than it should"
augtool> 


Expected results:
augeas saving one file

Additional info:
Yep, more lens errors in the message...
Comment 1 Dominic Cleal 2012-10-22 04:53:30 EDT
The problem is in the format of the tree you're trying to save.  I find the easiest way to find how it should be set up if you're unsure is to edit the file by hand and then "print" from augtool.

These two options should be represented as two nodes - the first for the option name and then a sub-node with the value, rather than a concatenation of the key and value within a single node.

set /files/etc/fstab/01/opt[5] "rsize=524288"
set /files/etc/fstab/01/opt[6] "wsize=524288"

Try this instead:

set /files/etc/fstab/01/opt[5] rsize
set /files/etc/fstab/01/opt[5]/value 524288
set /files/etc/fstab/01/opt[6] wsize
set /files/etc/fstab/01/opt[6]/value 524288"