add "config" to names of commands that save/restore config. Add "clearconfig" that just clears everything, useful for system shutdown, etc. Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> --- targetcli/ui_root.py | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/targetcli/ui_root.py b/targetcli/ui_root.py index 4f9c37d..9d8f1ca 100644 --- a/targetcli/ui_root.py +++ b/targetcli/ui_root.py @@ -71,7 +71,7 @@ class UIRoot(UINode): self.shell.log.debug("Loading %s." % fabric_module.name) UIFabricModule(fabric_module, self) - def ui_command_save(self, savefile=default_save_file): + def ui_command_saveconfig(self, savefile=default_save_file): ''' Saves the current configuration to a file so that it can be restored on next boot. @@ -96,7 +96,7 @@ class UIRoot(UINode): self.shell.log.info("Configuration saved to %s" % savefile) - def ui_command_restore(self, savefile=default_save_file, clear_existing=False): + def ui_command_restoreconfig(self, savefile=default_save_file, clear_existing=False): ''' Restores configuration from a file. ''' @@ -112,6 +112,18 @@ class UIRoot(UINode): self.refresh() + def ui_command_clearconfig(self, confirm=False): + ''' + Attempts to remove entire configuration of backstores and targets + ''' + self.assert_root() + + RTSRoot().clear_existing(confirm=confirm) + + self.shell.log.info("All configuration cleared") + + self.refresh() + def ui_command_version(self): ''' Displays the targetcli and support libraries versions. -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html