Handle errors listing flavors and images in scenario utils

This commit adds a try except block around the api calls made during
the scenario tests' testscenario utils module. This is needed because
if a config file is present but has incorrect information the errors
raised will cause import failures during discovery. This will cause
test list (or any other operation which involves test discovery) to
fail.

Change-Id: I8f31abcba547be78fc2dc9250f522bb6ac14cb01
Closes-Bug: #1405797
diff --git a/tempest/scenario/utils.py b/tempest/scenario/utils.py
index 061f5c8..68ec6e7 100644
--- a/tempest/scenario/utils.py
+++ b/tempest/scenario/utils.py
@@ -120,12 +120,15 @@
         if not CONF.service_available.glance:
             return []
         if not hasattr(self, '_scenario_images'):
-            images = self.images_client.list_images()
-            self._scenario_images = [
-                (self._normalize_name(i['name']), dict(image_ref=i['id']))
-                for i in images if re.search(self.image_pattern,
-                                             str(i['name']))
-            ]
+            try:
+                images = self.images_client.list_images()
+                self._scenario_images = [
+                    (self._normalize_name(i['name']), dict(image_ref=i['id']))
+                    for i in images if re.search(self.image_pattern,
+                                                 str(i['name']))
+                ]
+            except Exception:
+                self._scenario_images = []
         return self._scenario_images
 
     @property
@@ -134,12 +137,15 @@
         :return: a scenario with name and uuid of flavors
         """
         if not hasattr(self, '_scenario_flavors'):
-            flavors = self.flavors_client.list_flavors()
-            self._scenario_flavors = [
-                (self._normalize_name(f['name']), dict(flavor_ref=f['id']))
-                for f in flavors if re.search(self.flavor_pattern,
-                                              str(f['name']))
-            ]
+            try:
+                flavors = self.flavors_client.list_flavors()
+                self._scenario_flavors = [
+                    (self._normalize_name(f['name']), dict(flavor_ref=f['id']))
+                    for f in flavors if re.search(self.flavor_pattern,
+                                                  str(f['name']))
+                ]
+            except Exception:
+                self._scenario_flavors = []
         return self._scenario_flavors