-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
[controller] Device name changed by a template is not updated in the device model instance #293
[controller] Device name changed by a template is not updated in the device model instance #293
Comments
@okraits the flow is unusual, you set the name of the device on openwisp which is then modified by the device itself after it downloads the configuration specified in a template on OpenWISP. It's a bit strange. Where is |
The flow only uses core functionality of OpenWISP, I wouldn't call that unusual:
IMO the device info on the controller should be updated if any device information present on the controller is outdated, be it the hostname, the firmware version or one of the IPs. Device info on the controller is of no use if it is outdated. The hostname can change if a device is migrated from one location to another one.
It's a context variable in the device config on the controller.
Why would I want to do that? AFAIK configuration management should be the job of OpenWISP. |
@nemesisdesign How can we solve this? I think the implementation wouldn't take much effort - the client needs to send the hostname together with the other infos and the controller needs to take that data and update the device object. |
@nemesisdesign I can't wait because I need this to be fixed, so I implemented a fix. |
@okraits at the moment I don't feel confident in proceeding with this until I have analyzed it well, the reason is the same as for the feature that allows openwisp-config to collect the full configuration of the controller: many flows change and the impact of these kind of changes can be assessed only with usage, so I suggest you to use your own modifications for now, we can keep this open and collect more feedback. Maybe the change will not impact the system at all, but I have to dedicate time to testing it and at the moment I am very busy on other fronts which I announced before so I want to focus on those now. Thank you for your patience. |
@nemesisdesign Did you have a chance to test or think about this? |
I am still focused on delivering the next major release of OpenWISP. |
We have a template to change the device hostname based on the location where it's in use:
There's one issue with this, though:
The device name in the device model instance is not updated because:
openwisp-config
, for example byupdate_info
: https://github.com/openwisp/openwisp-config/blob/master/openwisp-config/files/openwisp.agent#L353UPDATABLE_FIELDS
:openwisp-controller/openwisp_controller/config/controller/views.py
Line 129 in 64598a7
I think it's a valid usecase to update the device hostname with a template and thus have this change reflected in the device model instance.
@nemesisdesign What do you think?
The text was updated successfully, but these errors were encountered: