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

Comments about dump's directory and copy

This commit is contained in:
Ross McFarland
2022-04-16 12:55:41 -07:00
parent 0d606e0728
commit d332a7bb38

View File

@@ -570,11 +570,19 @@ class Manager(object):
target = self.providers[output_provider] target = self.providers[output_provider]
except KeyError as e: except KeyError as e:
raise ManagerException(f'Unknown output_provider: {e.args[0]}') raise ManagerException(f'Unknown output_provider: {e.args[0]}')
# The chosen output provider has to support a directory property so
# that we can tell it where the user has requested the dumped files
# to reside.
if not hasattr(target, 'directory'): if not hasattr(target, 'directory'):
msg = f'output_provider={output_provider}, does not support ' \ msg = f'output_provider={output_provider}, does not support ' \
'directory property' 'directory property'
raise ManagerException(msg) raise ManagerException(msg)
if target.directory != output_dir: if target.directory != output_dir:
# If the requested target doesn't match what's configured in
# the chosen provider then we'll need to set it. Before doing
# that we make a copy of the provider so that it can remain
# unchanged and potentially be used as a source, e.g. copying
# from one yaml to another
if not hasattr(target, 'copy'): if not hasattr(target, 'copy'):
msg = f'output_provider={output_provider}, does not ' \ msg = f'output_provider={output_provider}, does not ' \
'support copy method' 'support copy method'