From eab9cd75b86d6964b5ec3202f9d363b6afe61dff Mon Sep 17 00:00:00 2001 From: David Barroso Date: Fri, 13 Mar 2015 12:51:56 +0100 Subject: [PATCH] Renamed replace_config method for clarity and added discard_config method --- drivers/base.py | 8 +++++++- drivers/eos.py | 5 ++++- drivers/junos.py | 0 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 drivers/junos.py diff --git a/drivers/base.py b/drivers/base.py index 0e651a6..334b379 100644 --- a/drivers/base.py +++ b/drivers/base.py @@ -49,13 +49,19 @@ class NetworkDriver: """ raise NotImplementedError - def replace_config(self): + def commit_config(self): """ Applies the configuration loaded with the method load_candidate_config on the device. Note that the current configuration of the device is replaced with the new configuration. """ raise NotImplementedError + def discard_config(self): + """ + Discards the configuration loaded into the candidate. + """ + raise NotImplementedError + def rollback(self): """ If changes have been made, revert changes to the original state. diff --git a/drivers/eos.py b/drivers/eos.py index 53a64b3..8df19a5 100644 --- a/drivers/eos.py +++ b/drivers/eos.py @@ -59,9 +59,12 @@ class EOSDriver(NetworkDriver): def compare_config(self): return self.device.compare_config() - def replace_config(self): + def commit_config(self): self.device.replace_config() + def discard_config(self): + pass + def rollback(self): self.device.rollback() diff --git a/drivers/junos.py b/drivers/junos.py new file mode 100644 index 0000000..e69de29