[omd-commits] OMD Git: omd: FIX: Fixed handling of comments in distro files

git version control git at mathias-kettner.de
Wed Jun 5 13:42:16 CEST 2013


Module:   omd
Branch:   master
Commit:   2b3d0ebc6e760be73c43a31fcde04fb02fe1cc29
URL:      http://omdistro.org/projects/omd/repository/revisions/2b3d0ebc6e760be73c43a31fcde04fb02fe1cc29

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Jun  5 13:41:51 2013 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Wed Jun  5 13:41:51 2013 +0200

FIX: Fixed handling of comments in distro files

repairs "omd setup" on some platforms

---

 Changelog        |    2 ++
 packages/omd/omd |    3 +++
 2 files changed, 5 insertions(+)

diff --git a/Changelog b/Changelog
index e1ce335..1dcec35 100644
--- a/Changelog
+++ b/Changelog
@@ -19,6 +19,8 @@ This file documents the revision history for the Open Monitoring Distribution
               to off right at creation, useful for test sites!)
             - update: Ensure execution of the target versions hooks
             - update: Added update log ~/var/log/update.log
+            - FIX: Fixed handling of comments in distro files (repairs "omd
+              setup" on some platforms)
           - PNP4Nagios: Updated to version 0.6.21
              - Added INIT hooks to npcd and pnp_gearman_worker scripts
           - Support Ubuntu 12.10 (Quantal)
diff --git a/packages/omd/omd b/packages/omd/omd
index 2df19b7..7166a56 100644
--- a/packages/omd/omd
+++ b/packages/omd/omd
@@ -330,6 +330,9 @@ def read_info():
                     # Skip comment and empty lines
                     if line.startswith('#') or line == '':
                         continue
+                    # Remove everything after the first comment sign
+                    if '#' in line:
+                        line = line[:line.index('#')].strip()
                     var, value = line.split('=')
                     value = value.strip()
                     if var.endswith("+"):



More information about the omd-commits mailing list