|
|
|
|
@ -2260,6 +2260,13 @@ class VMService:
|
|
|
|
|
and (not isinstance(public_pool_key, str)
|
|
|
|
|
or not PUBLIC_POOL_KEY_RE.fullmatch(public_pool_key))):
|
|
|
|
|
raise VMError("公网地址池标识无效", 422)
|
|
|
|
|
# _validate_common_create intentionally returns a narrow, validated
|
|
|
|
|
# create spec. Carry the already-validated pool identity forward to
|
|
|
|
|
# the XML builder; dropping it here leaves the guest without
|
|
|
|
|
# public-pool-key metadata and makes PHP reject the successful create
|
|
|
|
|
# during its reservation reconciliation.
|
|
|
|
|
if isinstance(public_pool_key, str) and public_pool_key:
|
|
|
|
|
validated["public_pool_key"] = public_pool_key
|
|
|
|
|
|
|
|
|
|
with _CREATE_LOCK, self._connect() as conn:
|
|
|
|
|
self._require_clean_traffic_filter(conn)
|
|
|
|
|
|