Bug 1201526 - index-parser can't parse systemd mount files properly
Summary: index-parser can't parse systemd mount files properly
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-12 21:54 UTC by Maros Zatko
Modified: 2015-03-23 13:37 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-23 13:37:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Maros Zatko 2015-03-12 21:54:24 UTC
Description of problem:
Seems that parser can't handle key such as:
Key=value with space

Version-Release number of selected component (if applicable):
1.29.29

How reproducible:
always

Steps to Reproduce:
1. try to parse /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
2. observe error on line 9
3. wonder :)

Comment 1 Richard W.M. Jones 2015-03-13 08:36:01 UTC
I'm slightly confused by this bug.  What is "line 9"?  What is
"index parser"?

If by "index-parser" you mean the parser in the builder/ directory,
then it's a custom parser designed to parse virt-builder metadata,
so it wouldn't be surprising that it cannot parse some other random
file format.

For parsing systemd mount files you probably should be using Augeas.

Comment 2 Pino Toscano 2015-03-13 13:40:02 UTC
> (In reply to Richard W.M. Jones from comment #1)
> I'm slightly confused by this bug.  What is "line 9"?  What is
> "index parser"?

He's referring to the index parser, used in virt-builder to parse INI-like index files.

(In reply to Maros Zatko from comment #0)
> Description of problem:
> Seems that parser can't handle key such as:
> Key=value with space

This is definitely not true, the index for images shipped on libguestfs.org has keys with spaces, like:

name=CentOS 6.6
notes=CentOS 6.6

etc.

> 1. try to parse
> /usr/lib/systemd/system/sysinit.target.wants/sys-kernel-debug.mount
> 2. observe error on line 9

The problem seems to be the empty line(s) before the first section (the commented lines don't matter). This is something which IMHO needs to be fixed regardless, as it may affect also third-parties indexes for virt-builder.

I'll post a patch for it soon.

Comment 3 Pino Toscano 2015-03-23 13:37:44 UTC
This has been fixed with
https://github.com/libguestfs/libguestfs/commit/fc6c16af0b765e39793554db0f55bd75f53fce9f
which is in libguestfs >= 1.29.31.


Note You need to log in before you can comment on or make changes to this bug.