python: Fix build issues when using "make build_cached"
[omd.git] / packages / icinga / merge-icinga-config
blobbfb5d0cf0bdd6ec0d5c29f1c803a163a53a5ffbd
1 #!/usr/bin/python
3 import sys
5 sys.stdout.write("""#
6 # This file has been created by OMD out of the following files:
8 """)
10 for fn in sys.argv[1:]:
11 sys.stdout.write("# %s\n" % fn)
13 sys.stdout.write("""#
14 # Do not edit this file. It will be recreated each time Nagios
15 # is started or reloaded. Rather change things in the original
16 # files.
18 # ------------------------------------------------------------
20 """)
22 for fn in sys.argv[1:]:
23 lineno = 0
24 for line in file(fn):
25 lineno += 1
26 ls = line.strip()
27 if ls == "" or ls.startswith("#"):
28 continue
29 sys.stdout.write("# %s:%d\n" % (fn, lineno))
30 sys.stdout.write(line)