diff -Nru bcfg2-1.3.3/debian/changelog bcfg2-1.3.3/debian/changelog --- bcfg2-1.3.3/debian/changelog 2014-02-16 01:49:05.000000000 +0000 +++ bcfg2-1.3.3/debian/changelog 2014-02-16 03:15:25.000000000 +0000 @@ -1,3 +1,9 @@ +bcfg2 (1.3.3-1ubuntu3) trusty; urgency=medium + + * Also cherry-pick a sorting fix from upstream (also NagiosGen). + + -- Stéphane Graber Sat, 15 Feb 2014 22:15:23 -0500 + bcfg2 (1.3.3-1ubuntu2) trusty; urgency=medium * Cherry-pick fix from upstream master to fix NagiosGen with IPv6 hosts. diff -Nru bcfg2-1.3.3/debian/patches/1000-nagiosgen-ipv6.patch bcfg2-1.3.3/debian/patches/1000-nagiosgen-ipv6.patch --- bcfg2-1.3.3/debian/patches/1000-nagiosgen-ipv6.patch 2014-02-16 01:48:22.000000000 +0000 +++ bcfg2-1.3.3/debian/patches/1000-nagiosgen-ipv6.patch 2014-02-16 03:14:00.000000000 +0000 @@ -1,23 +1,27 @@ -From d5c70ba8b220ac7ec9a7d462ce1a896a660d8d26 Mon Sep 17 00:00:00 2001 +From f7058b792570f9a2aaa83a55cdf51df8872de02e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= -Date: Tue, 12 Nov 2013 20:57:10 -0500 -Subject: [PATCH] NagiosGen: Sort the hostgroup list +Date: Thu, 11 Jul 2013 22:52:13 -0400 +Subject: [PATCH] Replace use of gethostbyname by getaddrinfo -This prevents the hostgroup list from flipping at random. +This replaces the remaining gethostbyname() call by the equivalent +getaddrinfo() call required to properly cope with hosts being only +reachable over IPv6. --- - src/lib/Bcfg2/Server/Plugins/NagiosGen.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + src/lib/Bcfg2/Server/Plugins/NagiosGen.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) Index: bcfg2-1.3.3/src/lib/Bcfg2/Server/Plugins/NagiosGen.py =================================================================== ---- bcfg2-1.3.3.orig/src/lib/Bcfg2/Server/Plugins/NagiosGen.py 2014-02-15 20:48:19.404605700 -0500 -+++ bcfg2-1.3.3/src/lib/Bcfg2/Server/Plugins/NagiosGen.py 2014-02-15 20:48:19.400605700 -0500 -@@ -56,7 +56,7 @@ - - if host_groups: - host_config.append(self.line_fmt % ("hostgroups", -- ",".join(host_groups))) -+ ",".join(sorted(host_groups)))) - - # read the config - xtra = dict() +--- bcfg2-1.3.3.orig/src/lib/Bcfg2/Server/Plugins/NagiosGen.py 2014-02-15 22:12:22.700395469 -0500 ++++ bcfg2-1.3.3/src/lib/Bcfg2/Server/Plugins/NagiosGen.py 2014-02-15 22:13:58.600391471 -0500 +@@ -42,8 +42,8 @@ + def createhostconfig(self, entry, metadata): + """Build host specific configuration file.""" + try: +- host_address = socket.gethostbyname(metadata.hostname) +- except socket.gaierror: ++ host_address = socket.getaddrinfo(metadata.hostname, None)[0][4][0] ++ except socket.error: + self.logger.error("Failed to find IP address for %s" % + metadata.hostname) + raise Bcfg2.Server.Plugin.PluginExecutionError diff -Nru bcfg2-1.3.3/debian/patches/1001-nagiosgen-sort-groups.patch bcfg2-1.3.3/debian/patches/1001-nagiosgen-sort-groups.patch --- bcfg2-1.3.3/debian/patches/1001-nagiosgen-sort-groups.patch 1970-01-01 00:00:00.000000000 +0000 +++ bcfg2-1.3.3/debian/patches/1001-nagiosgen-sort-groups.patch 2014-02-16 03:14:40.000000000 +0000 @@ -0,0 +1,23 @@ +From d5c70ba8b220ac7ec9a7d462ce1a896a660d8d26 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?St=C3=A9phane=20Graber?= +Date: Tue, 12 Nov 2013 20:57:10 -0500 +Subject: [PATCH] NagiosGen: Sort the hostgroup list + +This prevents the hostgroup list from flipping at random. +--- + src/lib/Bcfg2/Server/Plugins/NagiosGen.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: bcfg2-1.3.3/src/lib/Bcfg2/Server/Plugins/NagiosGen.py +=================================================================== +--- bcfg2-1.3.3.orig/src/lib/Bcfg2/Server/Plugins/NagiosGen.py 2014-02-15 22:14:37.896389833 -0500 ++++ bcfg2-1.3.3/src/lib/Bcfg2/Server/Plugins/NagiosGen.py 2014-02-15 22:14:37.892389833 -0500 +@@ -56,7 +56,7 @@ + + if host_groups: + host_config.append(self.line_fmt % ("hostgroups", +- ",".join(host_groups))) ++ ",".join(sorted(host_groups)))) + + # read the config + xtra = dict() diff -Nru bcfg2-1.3.3/debian/patches/series bcfg2-1.3.3/debian/patches/series --- bcfg2-1.3.3/debian/patches/series 2014-02-16 01:48:13.000000000 +0000 +++ bcfg2-1.3.3/debian/patches/series 2014-02-16 03:14:36.000000000 +0000 @@ -1,3 +1,4 @@ 0001-Update-Apache-configuration-for-version-2.4.patch 0002-Modify-systemd-service-files-to-suit-Debian.patch 1000-nagiosgen-ipv6.patch +1001-nagiosgen-sort-groups.patch