-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Removal of configurations was affected negatively by recent change #153
Comments
Store only when configuration is not in remote Close #153
We cannot solve this completely. We can check wether a specific section is coming from the controller (by looking at the config in the remote directory) but if it is coming from the controller then we don't know its previous state - wether it has been added or just modified by the controller, because there's no backup of the previous state. That is the original problem I wanted to solve with #76!
I did reuse this directory, that change probably was introduced by @devkapilbansal as stated in #154 (comment) |
After #144 has been merged I started to notice a new bug which took me some time to track down.
In short, when the new version of the agent is installed on devices which are already regsitered to OpenWISP, the code thinks that the very same configuration which is downloaded from OpenWISP is the original configuration to backup and later restore, with the result that trying to remove a configuration (eg: removing a template from the device) will not yield the desired result: the configuration is not removed (because it's restored by the new logic added in #144).
Here's how I can replicate this bug:
Expected outcome: the configuration is removed
Actual outcome: the configuration is restored by the logic added to #144.
Proposed solution:
I believe the logic added in #144 should first check whether the piece of config it wants to store is coming from OpenWISP or not, to do that we can check whether the same configuration is present in the remote configuration (
/etc/openwisp/remote/etc/config
).Then, while investigating on this bug I found out another aspect which can be improved.
The new logic creates a new dir in
/etc/openwisp
, eg:/etc/openwisp/etc/config/...
, but we already have a directory which keeps a backup:/etc/openwisp/stored
, it is used only to store plain files from the initial state (not UCI files), I wonder, was it intentional to not reuse this directory @okraits?Unless there are issues, I would reuse this directory, so the original UCI files should be stored in
/etc/openwisp/stored
but only if not already present in/etc/openwisp/remote/
(because in that case the UCI config is coming from OpenWISP and should not be restored after it's removed).The text was updated successfully, but these errors were encountered: