1
0
Fork 0

net: Fix rollback

Starting with commit 0d28f9e63e, values that have been applied
were stored instead of the original values, which broke rollback. Fix it
by storing the actual original values.

Fixes #135

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
This commit is contained in:
Ondřej Lysoněk 2019-03-12 13:04:19 +01:00
parent 2317e28654
commit 59c1282c0e

View file

@ -385,9 +385,13 @@ class NetTuningPlugin(base.Plugin):
# failed
if len(params_set) == 0:
return False
relevant_params_current = [(param, value) for param, value
in params_current.items()
if param in params_set]
relevant_params_current = dict(relevant_params_current)
# saved are only those parameters which passed checks
self._storage.set(storage_key, " ".join(
self._cmd.dict2list(params_set)))
self._cmd.dict2list(relevant_params_current)))
else:
original_value = self._storage.get(storage_key)
# in storage are only those parameters which were already tested