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

f-strings for BaseProvider

This commit is contained in:
Ross McFarland
2021-09-04 08:18:57 -07:00
parent d49af6ee31
commit de3b4a5836

View File

@@ -57,10 +57,9 @@ class BaseProvider(BaseSource):
for record in desired.records:
if record._type == 'PTR' and len(record.values) > 1:
# replace with a single-value copy
msg = 'multi-value PTR records not supported for {}' \
.format(record.fqdn)
fallback = 'falling back to single value, {}' \
.format(record.value)
msg = \
f'multi-value PTR records not supported for {record.fqdn}'
fallback = f'falling back to single value, {record.value}'
self.supports_warn_or_except(msg, fallback)
record = record.copy()
record.values = [record.value]
@@ -85,8 +84,8 @@ class BaseProvider(BaseSource):
def supports_warn_or_except(self, msg, fallback):
if self.strict_supports:
raise SupportsException('{}: {}'.format(self.id, msg))
self.log.warning('{}; {}'.format(msg, fallback))
raise SupportsException(f'{self.id}: {msg}')
self.log.warning('%s; %s', msg, fallback)
def plan(self, desired, processors=[]):
self.log.info('plan: desired=%s', desired.name)