Merge pull request #113 from ahubaoan/dev_for_tp4a

修改一处数据库错误
pull/130/head
Apex Liu 2018-10-14 02:24:04 +08:00 committed by GitHub
commit 80a792342d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -221,6 +221,8 @@ def get_accounts(sql_filter, sql_order, sql_limit, sql_restrict, sql_exclude):
for _acc in s.recorder:
if _acc.host_id not in host_ids:
host_ids.append(_acc.host_id)
if len(host_ids) == 0:
return TPE_OK, 0, 1, None
s_host = SQL(db)
s_host.select_from('host', ['id', 'name', 'ip', 'router_ip', 'router_port', 'state'], alt_name='h')
str_host_ids = ','.join([str(i) for i in host_ids])