mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
ddclient: Cloudflare - update DNS record instead of overwriting (#3837)
Updating the record preserves proxied status, TTL, comment, and such.
This commit is contained in:
parent
79100ac003
commit
a19de553aa
1 changed files with 1 additions and 3 deletions
|
|
@ -142,7 +142,6 @@ class Cloudflare(BaseAccount):
|
|||
return False
|
||||
|
||||
record_id = payload['result'][0]['id']
|
||||
proxied = payload['result'][0]['proxied']
|
||||
if self.is_verbose:
|
||||
syslog.syslog(
|
||||
syslog.LOG_NOTICE,
|
||||
|
|
@ -156,11 +155,10 @@ class Cloudflare(BaseAccount):
|
|||
'type': recordType,
|
||||
'name': self.settings.get('hostnames'),
|
||||
'content': str(self.current_address),
|
||||
'proxied': proxied
|
||||
},
|
||||
'headers': req_opts['headers']
|
||||
}
|
||||
response = requests.put(**req_opts)
|
||||
response = requests.patch(**req_opts)
|
||||
try:
|
||||
payload = response.json()
|
||||
except requests.exceptions.JSONDecodeError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue