[augeas-devel] Fwd: Issues with automounter lens

Patrick Spinler spinler.patrick at mayo.edu
Tue Sep 3 03:00:10 UTC 2013



The automounter lens appears to be sensitive to the order in which the
'opt' elements are defined.  Is there anything I can do here?  I'd like
to be able to e.g. add missing options to a automounter entry without
that blowing up in my face.

Observe:

(Here, adding an '/opt[]' item)
augtool> set /files/etc/auto.shares.nfs/*[. = 'tivoli']/opt[4] "ro"

augtool> print /files/etc/auto.shares.nfs/4
/files/etc/auto.shares.nfs/4 = "tivoli"
/files/etc/auto.shares.nfs/4/opt[1] = "squash_root"
/files/etc/auto.shares.nfs/4/opt[2] = "nodev"
/files/etc/auto.shares.nfs/4/opt[3] = "intr"
/files/etc/auto.shares.nfs/4/location
/files/etc/auto.shares.nfs/4/location/1
/files/etc/auto.shares.nfs/4/location/1/host = "syspzl01.mayo.edu"
/files/etc/auto.shares.nfs/4/location/1/path = "/appdata/tivoli"
/files/etc/auto.shares.nfs/4/opt[4] = "ro"

(fails to save)
augtool> save
error: Failed to execute command
saving failed (run 'print /augeas//error' for details)

(error msg:)
augtool> print /augeas//error
/augeas/files/etc/auto.shares.nfs/error = "put_failed"
/augeas/files/etc/auto.shares.nfs/error/path =
"/files/etc/auto.shares.nfs/4"
/augeas/files/etc/auto.shares.nfs/error/lens =
"/shares/nfs/unixarch/share/augeas/lenses/dist/automounter.aug:110.14-111.66:"
/augeas/files/etc/auto.shares.nfs/error/message = "Failed to match \n
 ({ /opt/ = /[^\\001-\\004\\t\\n #,:=\\\\]+/ }({ /opt/ =
/[^\\001-\\004\\t\\n #,:=\\\\]+/ })*)?({ /location/ } | { /mount/ })\n
with tree\n    { \"opt\" = \"squash_root\" } { \"opt\" = \"nodev\" } {
\"opt\" = \"intr\" } { \"location\" } { \"opt\" = \"ro\" }"

(reorder it to bring all the /opt[] items contiguous)
augtool> rm /files/etc/auto.shares.nfs/4/location
rm : /files/etc/auto.shares.nfs/4/location 4

augtool> set /files/etc/auto.shares.nfs/*[. = 'tivoli']/location/1/host
"syspzl01.mayo.edu"
augtool> set /files/etc/auto.shares.nfs/*[. = 'tivoli']/location/1/path
"/appdata/tivoli"

augtool> print /files/etc/auto.shares.nfs/4
/files/etc/auto.shares.nfs/4 = "tivoli"
/files/etc/auto.shares.nfs/4/opt[1] = "squash_root"
/files/etc/auto.shares.nfs/4/opt[2] = "nodev"
/files/etc/auto.shares.nfs/4/opt[3] = "intr"
/files/etc/auto.shares.nfs/4/opt[4] = "ro"
/files/etc/auto.shares.nfs/4/location
/files/etc/auto.shares.nfs/4/location/1
/files/etc/auto.shares.nfs/4/location/1/host = "syspzl01.mayo.edu"
/files/etc/auto.shares.nfs/4/location/1/path = "/appdata/tivoli"

(now saves successfully)
augtool> save
Saved 1 file(s)

Version info:
~ $ augtool --version
augtool 1.1.0 <http://augeas.net/>
Copyright (C) 2007-2011 David Lutterkort
License LGPLv2+: GNU LGPL version 2.1 or later
                 <http://www.gnu.org/licenses/lgpl-2.1.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David Lutterkort

Testing on RHEL 5.9

Thanks,
-- Pat






More information about the augeas-devel mailing list