summaryrefslogtreecommitdiffstats
path: root/app/discover
diff options
context:
space:
mode:
authoryayogev <yaronyogev@gmail.com>2017-08-28 07:44:24 +0300
committeryayogev <yaronyogev@gmail.com>2017-08-28 07:44:24 +0300
commita51550978deaf77b08579e17cd36e6e943b7abc6 (patch)
tree889a1a7f42c65e768f68e3da0e0cd72c651e53cf /app/discover
parent2f0f087b8216a123e351bbdfeca8a4e41241e999 (diff)
fix fetching of Neutron DB name
Change-Id: Ibe377bf081c3b92a14d8b32569a233ddb2a885b0 Signed-off-by: yayogev <yaronyogev@gmail.com>
Diffstat (limited to 'app/discover')
-rw-r--r--app/discover/fetchers/db/db_access.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/discover/fetchers/db/db_access.py b/app/discover/fetchers/db/db_access.py
index 47f4f9e..49fdb5e 100644
--- a/app/discover/fetchers/db/db_access.py
+++ b/app/discover/fetchers/db/db_access.py
@@ -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: