1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Cleaner impl for _plan_keyer

This commit is contained in:
Ross McFarland
2018-05-30 13:35:19 -07:00
parent c54904fa68
commit b4176382b5

View File

@@ -67,10 +67,8 @@ class Manager(object):
@classmethod
def _plan_keyer(cls, p):
try:
return len(p[1].changes[0].record.zone.name)
except (AttributeError, IndexError):
return 0
plan = p[1]
return len(plan.changes[0].record.zone.name) if plan.changes else 0
def __init__(self, config_file, max_workers=None, include_meta=False):
self.log.info('__init__: config_file=%s', config_file)