Upstream incomplete fix:
https://github.com/hercules-team/augeas/pull/661

Downstream bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1807010

We encountered a mke2fs.conf file which cannot be parsed by augeas.
It contains a fragment like this.  The default_mntopts entry cannot be
parsed:

        rhel6_ext4 = {
            features = 
has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
            inode_size = 256
            enable_periodic_fsck = 1
            default_mntopts = ""            ## error here
        }

e2fsprogs uses homebrew parsing.  At the first layer of parsing, any
of these is possible:

   default_mntopts = "acl,^discard"
   default_mntopts = acl,^discard
   default_mntopts = acl
   default_mntopts = ""
   default_mntopts =

All of these are parsed simply as strings.

Then there is a second layer of parsing which splits the string into
fields (eg. [ "acl", "^discard" ] or empty list).  It is then turned
into a bitfield.

Augeas parses the non-empty cases fine, into something like:

    /files/etc/mke2fs.conf/fs_types/filesystem[3] = "rhel6_ext4"
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features/has_journal
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features/extent
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features/huge_file
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features/flex_bg
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features/uninit_bg
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features/dir_nlink
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/features/extra_isize
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/inode_size = "256"
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/enable_periodic_fsck = "1"
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/default_mntopts
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/default_mntopts/acl
    /files/etc/mke2fs.conf/fs_types/filesystem[3]/default_mntopts/^discard

I had a go at trying to fix the empty list case in Augeas but just
cannot work out how to express an empty list.  I can turn it into just:

    /files/etc/mke2fs.conf/fs_types/filesystem[3]/default_mntopts

with no subentries, which seems fine? but how to turn that back into
default_mntopts = "" without getting lots of different peculiar augeas
errors, eg "exception: ambiguous tree iteration" and others.

Can anyone help here?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top

_______________________________________________
augeas-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/augeas-devel

Reply via email to