diff -Nru landscape-client-12.05/debian/changelog landscape-client-12.05/debian/changelog --- landscape-client-12.05/debian/changelog 2012-06-06 17:08:43.000000000 -0300 +++ landscape-client-12.05/debian/changelog 2012-09-20 09:18:35.000000000 -0300 @@ -1,3 +1,10 @@ +landscape-client (12.05-0ubuntu2) quantal-proposed; urgency=low + + * Added fix for lshw storm when the client was talking to an old + Landscape server which was then upgraded (LP: #1053057). + + -- Andreas Hasenack Thu, 20 Sep 2012 09:17:39 -0300 + landscape-client (12.05-0ubuntu1) quantal-proposed; urgency=low * New upstream release 12.05 (r561 in trunk) (LP: #1004678). diff -Nru landscape-client-12.05/debian/patches/lshw-storm-1053057.patch landscape-client-12.05/debian/patches/lshw-storm-1053057.patch --- landscape-client-12.05/debian/patches/lshw-storm-1053057.patch 1969-12-31 21:00:00.000000000 -0300 +++ landscape-client-12.05/debian/patches/lshw-storm-1053057.patch 2012-09-20 09:19:54.000000000 -0300 @@ -0,0 +1,42 @@ +--- a/landscape/manager/hardwareinfo.py ++++ b/landscape/manager/hardwareinfo.py +@@ -13,10 +13,13 @@ + run_immediately = True + command = "/usr/bin/lshw" + +- def run(self): ++ def register(self, registry): ++ super(HardwareInfo, self).register(registry) + self.call_on_accepted(self.message_type, self.send_message) ++ ++ def run(self): + return self.registry.broker.call_if_accepted( +- self.message_type, self.send_message) ++ self.message_type, self.send_message) + + def send_message(self): + result = getProcessOutput( +--- a/landscape/manager/tests/test_hardwareinfo.py ++++ b/landscape/manager/tests/test_hardwareinfo.py +@@ -43,3 +43,21 @@ + [{"data": u"-xml -quiet\n", "type": "hardware-info"}]) + + return deferred.addCallback(check) ++ ++ def test_only_on_register(self): ++ """ ++ C{call_on_accepted} is only called at register time, to not accumulate ++ callbacks to the "message-type-acceptance-changed" event. ++ """ ++ calls = [] ++ self.info.call_on_accepted = lambda x, y: calls.append((x, y)) ++ ++ deferred = self.info.run() ++ ++ def check(ignored): ++ self.assertMessages( ++ self.broker_service.message_store.get_pending_messages(), ++ [{"data": u"-xml -quiet\n", "type": "hardware-info"}]) ++ self.assertEqual([], calls) ++ ++ return deferred.addCallback(check) diff -Nru landscape-client-12.05/debian/patches/series landscape-client-12.05/debian/patches/series --- landscape-client-12.05/debian/patches/series 1969-12-31 21:00:00.000000000 -0300 +++ landscape-client-12.05/debian/patches/series 2012-09-20 09:19:07.000000000 -0300 @@ -0,0 +1 @@ +lshw-storm-1053057.patch