Browse Source

HUE-8172 [sqoop] Importer does not list databases of configured DBs

Romain Rigaux 7 years ago
parent
commit
eb14057da3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      desktop/libs/indexer/src/indexer/indexers/rdbms.py

+ 4 - 1
desktop/libs/indexer/src/indexer/indexers/rdbms.py

@@ -40,6 +40,7 @@ LOG = logging.getLogger(__name__)
 def get_db_component(request):
   format_ = {'data': [], 'status': 1, 'message': ''}
   db = None
+
   try:
     source = json.loads(request.POST.get('source', '{}'))
     user = User.objects.get(username=request.user)
@@ -76,11 +77,13 @@ def get_db_component(request):
       assist = Assist(db)
     else:
       assist = JdbcAssist(db)
+
     if not source['rdbmsDatabaseName']:
       data = assist.get_databases()
     elif source['rdbmsDatabaseName']:
       data = assist.get_tables(source['rdbmsDatabaseName'])
-      format_['data'] = [{'name': element, 'value': element} for element in data]
+
+    format_['data'] = [{'name': element, 'value': element} for element in data]
     format_['status'] = 0
   except Exception, e:
     message = _('Error accessing the database %s: %s') % (name, e)