[sqoop] Importer does not list databases of configured DBs
@@ -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,10 +77,12 @@ 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_['status'] = 0
except Exception, e:
