deploy模式下自动开通服务器3000/4000端口

This commit is contained in:
jingrow 2025-08-11 19:32:26 +08:00
parent b870d6a0d8
commit 4b635041a5

View File

@ -1899,6 +1899,10 @@ def execute_jsite_task(instance_id, mode='deploy', command_content=None, **kwarg
if not command_content: if not command_content:
return {"success": False, "message": "缺少command_content参数"} return {"success": False, "message": "缺少command_content参数"}
# 如果mode为deploy开通3000/4000端口
if mode == 'deploy':
create_aliyun_firewall_rule(instance_id, 'TCP', '3000/4000', 'Jsite', region_id)
# 执行命令,不传入参数字典 # 执行命令,不传入参数字典
manager = _get_manager() manager = _get_manager()
result = manager.run_command(instance_id, command_content, parameters=None, command_name=mode, region_id=region_id, timeout=3600) result = manager.run_command(instance_id, command_content, parameters=None, command_name=mode, region_id=region_id, timeout=3600)