fix fetching of Neutron DB name 41/40341/1
authoryayogev <yaronyogev@gmail.com>
Mon, 28 Aug 2017 04:44:24 +0000 (07:44 +0300)
committeryayogev <yaronyogev@gmail.com>
Mon, 28 Aug 2017 04:44:24 +0000 (07:44 +0300)
Change-Id: Ibe377bf081c3b92a14d8b32569a233ddb2a885b0
Signed-off-by: yayogev <yaronyogev@gmail.com>
app/discover/fetchers/db/db_access.py

index 47f4f9e..49fdb5e 100644 (file)
@@ -52,10 +52,8 @@ class DbAccess(Fetcher):
         # check if DB schema 'neutron' exists
         cursor = DbAccess.conn.cursor(dictionary=True)
         cursor.execute('SHOW DATABASES')
-        matches = []
-        for row in cursor:
-            if 'neutron' in row.get('Database', ''):
-                matches.append(row)
+        matches = [row.get('Database', '') for row in cursor
+                   if 'neutron' in row.get('Database', '')]
         if not matches:
             raise ScanError('Unable to find Neutron schema in OpenStack DB')
         if len(matches) > 1: