From d332a7bb38022239a8626c3fec989de0854ba799 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Sat, 16 Apr 2022 12:55:41 -0700 Subject: [PATCH] Comments about dump's directory and copy --- octodns/manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/octodns/manager.py b/octodns/manager.py index 07224fc..9a532eb 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -570,11 +570,19 @@ class Manager(object): target = self.providers[output_provider] except KeyError as e: 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'): msg = f'output_provider={output_provider}, does not support ' \ 'directory property' raise ManagerException(msg) 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'): msg = f'output_provider={output_provider}, does not ' \ 'support copy method'