This task replaces the legacy package vyatta-config-mgmt with a Python module, conf_mode script, op_mode script, and XML interface-definitions and op-mode-definitions. The task is listed as 'feature request' as one motivation was the desire to have a 'commit-confirm' function available via API; this in turn motivated a rewrite which serves to help in the goal of dropping legacy Vyatta code.
The legacy package in question is (1) a collection of tools for managing and viewing the history of config files (2) annoyingly self-referential. To address the matter a Python module 'config_mgmt.py' is added with a console-script entry point 'config-mgmt' to call various subcommands; commit hooks and conf-mode/op-mode support functions are defined within the module. Consequently, calling operations 'commit-confirm'; 'confirm'; 'rollback'; 'compare' is straightforward; conf-mode and op-mode scripts are simple.
Behavioral changes: the legacy behavior of 'commit-confirm' adds a log entry and archives config files //even// when the commit is 'canceled', in the sense that 'confirm' is not issued and the system reboots to the saved config. That is no longer the case: the log entry is cached and only added if 'confirm' is issued, in which case the config file is archived. Secondly, a warning is given at a prompt if 'commit-confirm' is issued with unsaved commits, so one can save commits first before proceeding. Finally, the Python library difflib.unified_diff is used for diff output instead of the legacy vyatta-cfg hand-crafted diff formatting; I contend this is cleaner, and allows is to avoid further calls to cli-shell-api functions.