From 7b21a960bdcb969674547198bd5ad9eae6684433 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Thu, 12 May 2011 16:04:52 +0200
Subject: [PATCH] Survive in case of no product_config support.

---
 product/DeadlockDebugger/__init__.py | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/product/DeadlockDebugger/__init__.py b/product/DeadlockDebugger/__init__.py
index 73346159ec..61c74f751c 100644
--- a/product/DeadlockDebugger/__init__.py
+++ b/product/DeadlockDebugger/__init__.py
@@ -34,17 +34,18 @@ except ImportError:
     LOG('DeadlockDebugger', ERROR, "Incorrectly installed threadframe module")
 else:
     config = getConfiguration()
-    deadlockdebugger = config.product_config.get('deadlockdebugger')
-    dump_url = ''
-    secret = ''
-    if deadlockdebugger is None:
-        LOG('DeadlockDebugger', ERROR, 'Missing configuration statement '
-          '<product-config deadlockdebugger>, not activated')
-    else:
-        if not 'dump_url' in deadlockdebugger:
-            LOG('DeadlockDebugger', ERROR, 'Please configure dump_url and '
-                'optionally secret in <product-config deadlockdebugger>, not '
-                'activated')
+    if getattr(config, 'product_config', None) is not None:
+        deadlockdebugger = config.product_config.get('deadlockdebugger')
+        dump_url = ''
+        secret = ''
+        if deadlockdebugger is None:
+            LOG('DeadlockDebugger', ERROR, 'Missing configuration statement '
+              '<product-config deadlockdebugger>, not activated')
         else:
-            import dumper
-            LOG('DeadlockDebugger', INFO, "Installed")
+            if not 'dump_url' in deadlockdebugger:
+                LOG('DeadlockDebugger', ERROR, 'Please configure dump_url and '
+                    'optionally secret in <product-config deadlockdebugger>, not '
+                    'activated')
+            else:
+                import dumper
+                LOG('DeadlockDebugger', INFO, "Installed")
-- 
2.30.9