Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplevars fails when adding a blank value to a parameter then saving. #148

Open
mwoodson opened this issue Jul 31, 2014 · 2 comments
Open

Comments

@mwoodson
Copy link

I am using the augeas lens with the commit id of:
93c8387

In the simplevars lens, it expects the format of:

PARAM = VALUE

I am able to add a new PARAM (PARAM did NOT exist before adding it) with a blank VALUE ("", empty string) and see it with a print statement. However, when I do a save, I get errors.

Here is an example of my workflow:

augtool> print /files/home/mwoodson/tmp/console.conf/
...
/files/home/mwoodson/tmp/console.conf/PARAM = VALUE1

(^^existing values shown)

augtool> set /files/home/mwoodson/tmp/console.conf/MATT_NEW_VALUE ""
augtool> print /files/home/mwoodson/tmp/console.conf/
...
/files/home/mwoodson/tmp/console.conf/PARAM = VALUE1
/files/home/mwoodson/tmp/console.conf/MATT_NEW_VALUE = ""

(^^new value added)


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

(^^save failed)

augtool> print /augeas//error
/augeas/files/home/mwoodson/tmp/console.conf/error = "put_failed"
/augeas/files/home/mwoodson/tmp/console.conf/error/path = "/files/home/mwoodson/tmp/console.conf/MATT_NEW_VALUE"
/augeas/files/home/mwoodson/tmp/console.conf/error/lens = "/usr/share/augeas/lenses/dist/simplevars.aug:31.40-.59:"
/augeas/files/home/mwoodson/tmp/console.conf/error/message = "Value '' does not match regexp /(('[^\\n']*')|(\"[^\\n\"]*\"))|([^\\n \\t'\"#][^\\n#]*[^\\n \\t#]|[^\\n \\t'\"#])/ in store lens"
augtool>
@iamkrish10
Copy link

Hi,
Any update on this issue?

Thanks.
Krish

@raphink
Copy link
Member

raphink commented Jan 18, 2019

I've started having a look. Unfortunately, fixing this is far from trivial and I haven't yet found a proper way to do it.

I have a functioning (failing) test though:

(* Test: Simplevars.lns
     Add variable with empty value (GH #148) *)
test Simplevars.lns put ""
       after set "/A" "" = "A =\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants