Skip to content
This repository has been archived by the owner on Jul 9, 2020. It is now read-only.

[controller] Add views to update general device information #164

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

okraits
Copy link
Member

@okraits okraits commented Mar 13, 2020

No description provided.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for now, looking forward to see the test, see below for a minor improvement

@@ -132,6 +135,9 @@ def get_controller_urls(views_module):
url(r'^controller/download-config/(?P<pk>[^/]+)/$',
views_module.device_download_config,
name='download_config_legacy'),
url(r'^controller/update-info/(?P<pk>[^/]+)/$',
views_module.device_update_info,
name='update_info_legacy'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can avoid the legacy URL since this is a new URL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little bit irritated because here it only works with the legacy URL ^controller/update-info/(?P<pk>[^/]+)/$. And in openwisp-config the URL is also $BASEURL/update-info/$UUID/ with $BASEURL being $URL/controller.

What am I missing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, we haven't updated openwisp-config to use the new URLs yet, so please go ahead and put the legacy URL back since it seems we need it right now (the patch in openwisp-config is also using that one right?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, openwisp-config uses only URLs like ^controller/<api-endpoint>/ and not URLs like ^controller/device/<api-endpoint>/.

See:
https://github.com/openwisp/openwisp-config/blob/master/openwisp-config/files/openwisp.agent#L73
https://github.com/openwisp/openwisp-config/blob/master/openwisp-config/files/openwisp.agent#L585

So we will need to keep the legacy URLs for quite some time, otherwise older clients won't be able to connect to an updated server anymore.

I re-added the legacy URL.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: build is failing for an isort warning.

@okraits okraits force-pushed the tdt-update-device-info branch 2 times, most recently from c1470f2 to f0012d6 Compare March 16, 2020 06:56
@coveralls
Copy link

coveralls commented Mar 16, 2020

Coverage Status

Coverage increased (+0.002%) to 99.911% when pulling cdef54a on TDT-AG:tdt-update-device-info into ce410f8 on openwisp:master.

@okraits
Copy link
Member Author

okraits commented Mar 16, 2020

PS: build is failing for an isort warning.

Fixed that and added tests. This is done from my side.

@okraits okraits changed the title WIP [controller] Add views to update general device information [controller] Add views to update general device information Mar 16, 2020
@okraits
Copy link
Member Author

okraits commented Mar 21, 2020

@nemesisdesign Please review this PR and the related ones for openwisp-controller and openwisp-config when you have the time.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okraits on the code side It looks good, please give me some more time to test the changes in the 3 different modules (including openwisp-config) in my test env. This feature will go in the next release.

@okraits
Copy link
Member Author

okraits commented Mar 23, 2020

@nemesisdesign No problem, I have a week off from work now anyway.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@okraits first tests successful 👍

OpenWISP Priorities for next releases automation moved this from In progress to Reviewer approved Mar 25, 2020
@nemesifier nemesifier merged commit c098269 into openwisp:master Mar 25, 2020
OpenWISP Priorities for next releases automation moved this from Reviewer approved to Done Mar 25, 2020
@okraits okraits deleted the tdt-update-device-info branch April 6, 2020 05:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

3 participants