fix: adapt autotest to updated service APIs
This commit is contained in:
@@ -31,7 +31,7 @@ import json
|
||||
import fcntl
|
||||
|
||||
from api.http_client import HttpClient, detect_endpoint, stand_name
|
||||
from api.auth import get_token, get_client, get_client_id, get_stand, get_token_info
|
||||
from api.auth import get_token, get_client, get_client_id, get_stand, get_token_info, get_mode
|
||||
from api.utils import find_uid, uid_from_location
|
||||
from operations.get_services import get_services, get_service_detail
|
||||
from operations.get_instances import get_instances
|
||||
@@ -217,7 +217,7 @@ def api_test():
|
||||
if not instance_uid:
|
||||
return jsonify({"status": "FAIL", "error": "Нет instanceUid"}), 400
|
||||
|
||||
if op_name == "delete":
|
||||
if op_name == "delete" and get_mode() == "cloud":
|
||||
# Жёсткое удаление через CMDB (без авторизации) — для недосозданных инстансов
|
||||
cmdb_url = f"https://cmdb-api.deck.nubes.ru/instances/{instance_uid}"
|
||||
cmdb_ok, cmdb_code = client.raw_delete(cmdb_url)
|
||||
|
||||
Reference in New Issue
Block a user