mirror of
https://github.com/veops/cmdb.git
synced 2025-08-26 15:00:39 +08:00
fix(api): Code scanning alerts (#254)
This commit is contained in:
@@ -36,9 +36,10 @@ def parse_plugin_script(script):
|
||||
attributes = []
|
||||
try:
|
||||
x = compile(script, '', "exec")
|
||||
exec(x)
|
||||
unique_key = locals()['AutoDiscovery']().unique_key
|
||||
attrs = locals()['AutoDiscovery']().attributes() or []
|
||||
local_ns = {}
|
||||
exec(x, {}, local_ns)
|
||||
unique_key = local_ns['AutoDiscovery']().unique_key
|
||||
attrs = local_ns['AutoDiscovery']().attributes() or []
|
||||
except Exception as e:
|
||||
return abort(400, str(e))
|
||||
|
||||
|
Reference in New Issue
Block a user