mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Implement suggested changes
This commit is contained in:
@@ -231,6 +231,8 @@ class Manager(object):
|
||||
sub_zones=self.configured_sub_zones(zone_name))
|
||||
|
||||
if desired:
|
||||
# This is an alias zone, rather than populate it we'll copy the
|
||||
# records over from `desired`.
|
||||
for _, records in desired._records.items():
|
||||
for record in records:
|
||||
zone.add_record(record.copy(zone=zone), lenient=lenient)
|
||||
|
@@ -151,7 +151,6 @@ class Record(EqualityTupleMixin):
|
||||
# force everything lower-case just to be safe
|
||||
self.name = text_type(name).lower() if name else name
|
||||
self.source = source
|
||||
self._raw_data = data
|
||||
self.ttl = int(data['ttl'])
|
||||
|
||||
self._octodns = data.get('octodns', {})
|
||||
@@ -221,15 +220,15 @@ class Record(EqualityTupleMixin):
|
||||
return Update(self, other)
|
||||
|
||||
def copy(self, zone=None):
|
||||
_type = getattr(self, '_type')
|
||||
if not self._raw_data.get('type'):
|
||||
self._raw_data['type'] = _type
|
||||
data = self.data
|
||||
data['type'] = self._type
|
||||
|
||||
return Record.new(
|
||||
zone if zone else self.zone,
|
||||
self.name,
|
||||
self._raw_data,
|
||||
self.source
|
||||
data,
|
||||
self.source,
|
||||
lenient=True
|
||||
)
|
||||
|
||||
# NOTE: we're using __hash__ and ordering methods that consider Records
|
||||
|
Reference in New Issue
Block a user