7864ab404b
**目录结构**: - scripts/ 顶层运维/工具脚本(20 个) - scripts/deploy/ 一键部署脚本(deploy_*.py / upload_*.py / redeploy.py 等 8 个) - scripts/fix/ 一次性修复脚本(fix_*.py / fix_*.cypher / fix_*.sql 等 9 个) - scripts/debug/ 调试脚本集合(check_*.py/sql、test_*.py、debug_*.py 等 42 个) **ops-tools/jms_ops.py**:jumpserver-ops skill 默认路径修复 - 从 'jumpserver-automation-shareable' 改为 'jumpserver-ops' - 同步更新注释(优先 JP_SKILL_DIR 环境变量) **典型脚本用途**: - scripts/deploy-v1.2.ps1 / -staging.ps1:一键部署 v1.2 到生产 / staging - scripts/init_quick_rules.sql:quick_rules 表初始数据 - scripts/gen_admin_token.py:生成 admin JWT token(调试用) - scripts/build-and-verify.sh:v1.1 实施验证脚本 - scripts/verify_*.sh / .py:API/quick_rules 验证 - scripts/fix/*.py:环境修复(compose、env_key、itsm_bridge 等) 合计 81 文件 + 3317 行 / - 1 行
49 lines
1.5 KiB
Python
49 lines
1.5 KiB
Python
import asyncio
|
|
import sys
|
|
sys.path.insert(0, '/app')
|
|
|
|
async def test():
|
|
from app.services.graph_query_service import get_graph_query_service
|
|
from app.services.neo4j_client import get_neo4j_client
|
|
|
|
neo4j_client = await get_neo4j_client()
|
|
graph_service = await get_graph_query_service(neo4j_client)
|
|
|
|
keyword = "打印机驱动安装"
|
|
print(f"=== Full test for keyword: {keyword} ===")
|
|
|
|
# Step 1: find_issues_by_keyword
|
|
issues = await neo4j_client.find_issues_by_keyword(keyword, limit=5)
|
|
print(f"1. find_issues_by_keyword: {len(issues)} issues")
|
|
if not issues:
|
|
print("No issues found!")
|
|
return
|
|
|
|
issue = issues[0]
|
|
print(f" Issue: uuid={issue.uuid}, name={issue.name}")
|
|
|
|
# Step 2: find_actions_by_issue
|
|
print(f"2. Calling find_actions_by_issue with uuid={issue.uuid}")
|
|
actions = await neo4j_client.find_actions_by_issue(issue.uuid)
|
|
print(f" find_actions_by_issue: {len(actions)} actions")
|
|
|
|
if not actions:
|
|
print("No actions found!")
|
|
return
|
|
|
|
action = actions[0]
|
|
print(f" Action: name={action.name}, description={action.description[:30]}...")
|
|
|
|
# Step 3: Build result
|
|
from app.services.graph_query_service import SolutionResult
|
|
result = SolutionResult(
|
|
issue_name=issue.name,
|
|
issue_uuid=issue.uuid,
|
|
solution=action.description or action.name,
|
|
action_name=action.name,
|
|
confidence=0.8
|
|
)
|
|
print(f"3. SolutionResult: {result}")
|
|
|
|
asyncio.run(test())
|