46 lines
1.7 KiB
Diff
46 lines
1.7 KiB
Diff
From 5c803953928ad16d56795dcf7158bb9f3d340e1d Mon Sep 17 00:00:00 2001
|
|
From: gongzt <gong_zhengtang@163.com>
|
|
Date: Thu, 21 Dec 2023 17:33:23 +0800
|
|
Subject: [PATCH] add reboot field to query host info api
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
---
|
|
apollo/database/proxy/host.py | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/apollo/database/proxy/host.py b/apollo/database/proxy/host.py
|
|
index ca709a8..6015a04 100644
|
|
--- a/apollo/database/proxy/host.py
|
|
+++ b/apollo/database/proxy/host.py
|
|
@@ -341,7 +341,8 @@ class HostMysqlProxy(MysqlProxy):
|
|
"repo": "20.03-update",
|
|
"affected_cve_num": 12,
|
|
"unaffected_cve_num": 1,
|
|
- "last_scan": 1111111111
|
|
+ "last_scan": 1111111111,
|
|
+ "reboot": true/false
|
|
}
|
|
}
|
|
"""
|
|
@@ -412,6 +413,7 @@ class HostMysqlProxy(MysqlProxy):
|
|
Host.host_group_name,
|
|
Host.repo_name,
|
|
Host.last_scan,
|
|
+ Host.reboot,
|
|
func.COUNT(func.IF(subquery.c.fixed == True, 1, None)).label("fixed_cve_num"),
|
|
func.COUNT(func.IF(and_(subquery.c.fixed == False, subquery.c.affected == True), 1, None)).label(
|
|
"affected_cve_num"
|
|
@@ -437,6 +439,7 @@ class HostMysqlProxy(MysqlProxy):
|
|
"unaffected_cve_num": row.unaffected_cve_num,
|
|
"last_scan": row.last_scan,
|
|
"fixed_cve_num": row.fixed_cve_num,
|
|
+ "reboot": row.reboot,
|
|
}
|
|
return host_info
|
|
|
|
--
|
|
Gitee
|
|
|