[perf-web] Fix startup when there is are machine configurations



commit a8b33992b46d7cc2f86e3f821624184674a2aee6
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Tue Jul 22 20:34:06 2014 -0400

    Fix startup when there is are machine configurations

 metrics/config.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/metrics/config.py b/metrics/config.py
index 061a49f..9575dfe 100644
--- a/metrics/config.py
+++ b/metrics/config.py
@@ -68,12 +68,15 @@ class Configuration:
         self._load_file('testsets.conf')
         self._load_file('metrics.conf')
         machinedir = os.path.join(settings.CONFIG_ROOT, 'machines')
-        for f in os.listdir(machinedir):
-            if f.endswith('.conf'):
-                self._load_file(os.path.join('machines', f))
+        if os.path.exists(machinedir):
+            for f in os.listdir(machinedir):
+                if f.endswith('.conf'):
+                    self._load_file(os.path.join('machines', f))
 
         # Error messages are confusing if we don't validate in order
         for cls in ['Partition', 'Target']:
+            if not cls in self.objects:
+                continue
             objs = self.objects[cls]
             bad_names = []
             for name in objs:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]