[Bug 1491406] Re: augeas-lenses-1.2.0 - NagiosCfg lens broken for /etc/nagios.cfg due to spaces

Robie Basak 1491406 at bugs.launchpad.net
Wed Jun 8 14:34:58 UTC 2016


Uploaded, thanks Ryan. A couple of comments:

I tweaked your dep3 headers as follows. Last-Updated is defined as being
hyphenated, and AIUI "Origin: upstream, ..." is appropriate for when the
patch is cherry-picked from upstream, as opposed to "Applied-Upstream:
..." which is for when the patch is going in the other direction. So I
did:

--- augeas-lenses-nagioscfg-nospace.patch.orig	2016-06-08 14:18:44.675981037 +0000
+++ augeas-lenses-nagioscfg-nospace.patch	2016-06-08 14:19:12.844037262 +0000
@@ -2,10 +2,9 @@
  Subject: [PATCH] NagiosCfg: default to no spaces around equal, fix #177
 
 Author: =?UTF-8?q?Rapha=C3=ABl=20Pinson?= <raphael.pinson at camptocamp.com>
-Origin: https://github.com/hercules-team/augeas/commit/b0add7511ca43b03e57baffd17cfd8d77442849f.patch
+Origin: upstream, https://github.com/hercules-team/augeas/commit/b0add7511ca43b03e57baffd17cfd8d77442849f.patch
 Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/augeas/+bug/1491406
-Applied-Upstream: https://github.com/hercules-team/augeas/commit/b0add7511ca43b03e57baffd17cfd8d77442849f.patch
-Last-Update: 20160607
+Last-Update: 2016-06-07
 
 ---
  lenses/nagioscfg.aug | 2 +-


Second, we use "Fix Released" in the development release since the bug did once affect the development release but was fixed at some point since.

** Changed in: augeas (Ubuntu Trusty)
       Status: New => In Progress

** Changed in: augeas (Ubuntu)
       Status: Invalid => Fix Released

** Changed in: augeas (Ubuntu Trusty)
     Assignee: (unassigned) => Ryan Harper (raharper)

-- 
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/1491406

Title:
  augeas-lenses-1.2.0 - NagiosCfg lens broken for /etc/nagios.cfg due to
  spaces

Status in augeas package in Ubuntu:
  Fix Released
Status in augeas source package in Trusty:
  In Progress

Bug description:
  [Impact]

   * The nagios lens provided in augeas-lenses can generate configuration
     values that are not parsable by nagios due to the lense creating
     these values with a space character before and after the equal.
     (foo = "bar"  vs.  foo="bar").
     
     This affects the 1.2.0 release of augeas-lenses and has been
     been fixed in newer releases available in Xenial and Yakkety.
     
   * All patches applied are already accepted upstream and newer Ubuntu
     releases are not affected.

  [Test Case]

   * On a Xenial 16.04 system
    - lxc launch ubuntu-daily:trusty t1
    - lxc exec t1 /bin/bash

    # inside the container t1
    - apt-get update && apt-get install --no-install-recommends augeas-lenses augeas-tools nagios3

    # setup temp area to test augeas out per http://augeas.net/tour.html
    - export AUGEAS_ROOT=/tmp/augeas-sandbox
    - mkdir $AUGEAS_ROOT
    - cp -pr /etc $AUGEAS_ROOT
    - chown -R $(id -nu):$(id -ng) $AUGEAS_ROOT
    - augtool -b

    # in the augtool shell, make a change (remove and reset a value)
    - print /files/etc/nagios3/nagios.cfg/log_file
    - rm /files/etc/nagios3/nagios.cfg/log_file
    - set /files/etc/nagios3/nagios.cfg/log_file /var/log/nagios3/nagios.log-wark
    - save
    - control-d

    # diff the files to see the change
    - root at t2:~# diff -u $AUGEAS_ROOT/etc/nagios3/nagios.cfg.augsave $AUGEAS_ROOT/etc/nagios3/nagios.cfg
   
    # confirm that we can still parse the new config file
    - nagios3 --verify-config $AUGEAS_ROOT/etc/nagios3/nagios.cfg

  [Regression Potential]

   * Users of nagios lens should verify that the change in output doesn't
     break  their usage, but the change only affects nagioscfg lens users.

  
  [Original Description]

  # lsb_release -rd
  Description:	Ubuntu 14.04.3 LTS
  Release:	14.04

  # apt-cache policy augeas-lenses
  augeas-lenses:
    Installed: 1.2.0-0ubuntu1.1
    Candidate: 1.2.0-0ubuntu1.1
    Version table:
   *** 1.2.0-0ubuntu1.1 0
          500 http://archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
          100 /var/lib/dpkg/status
       1.2.0-0ubuntu1 0
          500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

  3. After applying configuration changes with augeas for Nagios3 there
  should be no spaces before and after "="

  ```nagios.cfg
  var=value
  ```

  4. Nagios3 fails to parse a configuration line with spaces before and
  after "="

  ```nagios.cfg
  var = value
  ```

  ```.log
  Error in configuration file '/etc/nagios/nagios.cfg' - Line ??? (UNKNOWN VARIABLE)
     Error processing main config file!
  ```

  Upstream fix and discussion here:
  https://github.com/hercules-team/augeas/pull/177

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/augeas/+bug/1491406/+subscriptions



More information about the Ubuntu-sponsors mailing list