Commit 3de6e881 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[1843] don't revert local config on execute failure

instead, just print some advice
parent 4cfab0d8
......@@ -782,10 +782,6 @@ class BindCmdInterpreter(Cmd):
The execution is stopped if there are any errors.
'''
verbose = False
# Keep a copy of the original local changes, in case the
# given command set changes things but fails later
local_changes_backup =\
copy.deepcopy(self.config_data.get_local_changes())
try:
for line in commands:
line = line.strip()
......@@ -813,8 +809,11 @@ class BindCmdInterpreter(Cmd):
isc.cc.data.DataAlreadyPresentError,
KeyError) as err:
print('Error: ', err)
# revert changes
self.config_data.set_local_changes(local_changes_backup)
print()
print('Depending on the contents of the script, and which')
print('commands it has called, there can be committed and')
print('local changes. It is advised to check your settings,')
print('and revert local changes with "config revert".')
def apply_cmd(self, cmd):
'''Handles a general module command'''
......
......@@ -101,26 +101,6 @@ Feature: control with bindctl
send bind10 the command config show Boss/components
last bindctl output should not contain b10-auth
# the bad command should also keep existing changes intact,
# i.e. if we add something, then run a failing script, our
# addition should still be there, but those from the script
# should not
When I send bind10 the following commands:
"""
config add Boss/components b10-resolver
config set Boss/components/b10-resolver/kind dispensable
config set Boss/components/b10-resolver/special resolver
execute file data/commands/bad_command
config commit
"""
last bindctl output should contain shouldshow
last bindctl output should contain Error
last bindctl output should not contain shouldnotshow
# This would fail if the entire list was passed, or the configuratio
send bind10 the command config show Boss/components
last bindctl output should not contain b10-auth
last bindctl output should contain b10-resolver
# nested_command contains another execute script
When I send bind10 the command execute file data/commands/nested
last bindctl output should contain shouldshow
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment