Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Augeas PHP lens fails on empty values #107

Open
Jack12816 opened this issue Dec 4, 2014 · 3 comments
Open

Augeas PHP lens fails on empty values #107

Jack12816 opened this issue Dec 4, 2014 · 3 comments

Comments

@Jack12816
Copy link
Contributor

If you got a ini file with this line for example:

xcache.coveragedump_directory = ""

You cant work on this file.

@jippi
Copy link
Owner

jippi commented Dec 4, 2014

that seem to be an augeas error - what do you want to do? remove the entry or?

@dbeckham
Copy link
Contributor

dbeckham commented Jan 9, 2015

@Jack12816 iirc, the php.aug file is based off the built-in ini file lens which, yes, is actually quite buggy, especially with the regular expressions that it uses to validate the right side of an assignment. In this particular case though, the lens will refuse to set an empty string like that.

My suggestion is to fix it using the clear command that Puppet supports in the augeas resource type. In a php::config resource for the ini file in question, you can clear that entry and hopefully work around the poorly written ini file lens with this Puppet code:

php::config { 'fix-lazy-augeas-built-in-lens':
  file   => '/path/to/file.ini',
  config => [ 'clear xcache.coveragedump_directory' ],
}

This will result in your PHP ini file having this entry: xcache.coveragedump_directory= which has the exact same meaning.

I have a couple of PHP settings that I don't necessarily want to set myself, but want to make sure are unset so they use the default, and this is the method I use to do this.

@dbeckham
Copy link
Contributor

@jippi I was wrong about this problem. It can't be fixed with Augeas commands. The xcache module on Ubuntu 14 LTS (Trusty) is 100% incompatible with the Augeas. The Inifile lens that the PHP lens relies on is so amazingly buggy in every release before the version packaged for Ubuntu Trusty and is still broken in the latest release.

The three options are to:

  • Ask the Augeas upstream to fix the Inifile lens.
  • Ask the Ubuntu upstream maintainer of the php5-xcache package to remove the unnecessary empty quotes.
  • Add an xcache.ini file to this puppet module to replace the initial xcache config file with a sane config so that Augeas can be used.

The first two aren't ever happening. In order to get around the problem myself, I just don't bother using this module for the xcache install and do it manually. I have if "trusty" crapping up my manifests because Augeas is so broken. =(

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

No branches or pull requests

3 participants