mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
When you filter is important
This commit is contained in:
@@ -324,7 +324,10 @@ class CloudflareProvider(BaseProvider):
|
|||||||
|
|
||||||
path = '/zones/{}/pagerules'.format(zone_id)
|
path = '/zones/{}/pagerules'.format(zone_id)
|
||||||
resp = self._try_request('GET', path, params={'status': 'active'})
|
resp = self._try_request('GET', path, params={'status': 'active'})
|
||||||
records += resp['result']
|
for r in resp['result']:
|
||||||
|
# assumption, base on API guide, will only contain 1 action
|
||||||
|
if r['actions'][0]['id'] == 'forwarding_url':
|
||||||
|
records += [r]
|
||||||
|
|
||||||
self._zone_records[zone.name] = records
|
self._zone_records[zone.name] = records
|
||||||
|
|
||||||
@@ -373,7 +376,6 @@ class CloudflareProvider(BaseProvider):
|
|||||||
_path = parsed_uri.path
|
_path = parsed_uri.path
|
||||||
_type = 'URLFWD'
|
_type = 'URLFWD'
|
||||||
# assumption, actions will always contain 1 action
|
# assumption, actions will always contain 1 action
|
||||||
if record['actions'][0]['id'] == 'forwarding_url':
|
|
||||||
_values = record['actions'][0]['value']
|
_values = record['actions'][0]['value']
|
||||||
_values['path'] = _path
|
_values['path'] = _path
|
||||||
# no ttl set by pagerule, creating one
|
# no ttl set by pagerule, creating one
|
||||||
@@ -655,8 +657,7 @@ class CloudflareProvider(BaseProvider):
|
|||||||
parsed_uri = urlsplit(uri)
|
parsed_uri = urlsplit(uri)
|
||||||
name = zone.hostname_from_fqdn(parsed_uri.netloc)
|
name = zone.hostname_from_fqdn(parsed_uri.netloc)
|
||||||
_path = parsed_uri.path
|
_path = parsed_uri.path
|
||||||
# assumption, populate will catch this contition
|
# assumption, actions will always contain 1 action
|
||||||
# if record['actions'][0]['id'] == 'forwarding_url':
|
|
||||||
_values = record['actions'][0]['value']
|
_values = record['actions'][0]['value']
|
||||||
_values['path'] = _path
|
_values['path'] = _path
|
||||||
_values['ttl'] = 3600
|
_values['ttl'] = 3600
|
||||||
|
Reference in New Issue
Block a user