修复setup server时DNSPod新建a记录的问题
This commit is contained in:
parent
f49dbd27a1
commit
2c20d4eec6
@ -248,6 +248,9 @@ class BaseServer(Document, TagHelpers):
|
|||||||
# 分离子域名
|
# 分离子域名
|
||||||
if self.name.endswith("." + domain.name):
|
if self.name.endswith("." + domain.name):
|
||||||
sub_domain = self.name[:-len(domain.name)-1]
|
sub_domain = self.name[:-len(domain.name)-1]
|
||||||
|
if not sub_domain:
|
||||||
|
log_error("主机记录为空,拒绝将主域名作为A记录", domain=domain.name, server=self.name)
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
log_error("域名配置错误", domain=domain.name, server=self.name)
|
log_error("域名配置错误", domain=domain.name, server=self.name)
|
||||||
return
|
return
|
||||||
@ -314,6 +317,7 @@ class BaseServer(Document, TagHelpers):
|
|||||||
"RecordType": "A",
|
"RecordType": "A",
|
||||||
"RecordLine": "默认",
|
"RecordLine": "默认",
|
||||||
"Value": self.ip,
|
"Value": self.ip,
|
||||||
|
"SubDomain": sub_domain, # 添加子域名参数,修复主机记录变为@的问题
|
||||||
"TTL": ttl_value
|
"TTL": ttl_value
|
||||||
}
|
}
|
||||||
req.from_json_string(json.dumps(params))
|
req.from_json_string(json.dumps(params))
|
||||||
@ -348,6 +352,7 @@ class BaseServer(Document, TagHelpers):
|
|||||||
"RecordType": "A",
|
"RecordType": "A",
|
||||||
"RecordLine": "默认",
|
"RecordLine": "默认",
|
||||||
"Value": self.ip,
|
"Value": self.ip,
|
||||||
|
"SubDomain": sub_domain, # 同样在这里也添加子域名参数
|
||||||
"TTL": ttl_value
|
"TTL": ttl_value
|
||||||
}
|
}
|
||||||
req.from_json_string(json.dumps(params))
|
req.from_json_string(json.dumps(params))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user