Skip to content

Commit c033a07

Browse files
authored
[chores] Removed old, deprecated code
1 parent d1569ab commit c033a07

4 files changed

Lines changed: 0 additions & 37 deletions

File tree

openwisp_controller/config/base/config.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,6 @@
3030
logger = logging.getLogger(__name__)
3131

3232

33-
def get_cached_checksum_args_rewrite(config):
34-
"""
35-
DEPRECATED: Use get_cached_args_rewrite instead.
36-
37-
TODO: Remove this in 1.2.0 release.
38-
"""
39-
return get_cached_args_rewrite(config)
40-
41-
4233
class TemplatesThrough(object):
4334
"""
4435
Improves string representation of m2m relationship objects

openwisp_controller/config/controller/views.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,12 @@ def post(self, request, *args, **kwargs):
251251
config = device.config
252252
# ensure request is well formed and authorized
253253
allowed_status = [choices[0] for choices in config.STATUS]
254-
allowed_status.append("running") # backward compatibility
255254
required_params = [("key", device.key), ("status", allowed_status)]
256255
for key, value in required_params:
257256
bad_response = forbid_unallowed(request, "POST", key, value)
258257
if bad_response:
259258
return bad_response
260259
status = request.POST.get("status")
261-
# mantain backward compatibility with old agents
262-
# ("running" was changed to "applied")
263-
status = status if status != "running" else "applied"
264260
# If the Config.status is "deactivating", then set the
265261
# status to "deactivated". This will stop the device
266262
# from receiving new configurations.

openwisp_controller/config/tasks.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,3 @@ def invalidate_controller_views_cache(organization_id):
198198
Vpn.objects.filter(organization_id=organization_id).only("id").iterator()
199199
):
200200
GetVpnView.invalidate_get_vpn_cache(vpn)
201-
202-
203-
@shared_task(base=OpenwispCeleryTask)
204-
def invalidate_device_checksum_view_cache(organization_id):
205-
"""
206-
DEPRECATED: Use invalidate_controller_views_cache instead.
207-
208-
TODO: Remove this in 1.2.0 release.
209-
"""
210-
return invalidate_controller_views_cache(organization_id)

openwisp_controller/config/tests/test_controller.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -913,20 +913,6 @@ def test_device_registration_hostname_comparison_case_insensitive(
913913
self.assertEqual(device.name, name)
914914
mocked_method.assert_not_called()
915915

916-
def test_device_report_status_running(self):
917-
"""
918-
maintained for backward compatibility
919-
# TODO: remove in stable version 1.0
920-
"""
921-
d = self._create_device_config()
922-
response = self.client.post(
923-
reverse("controller:device_report_status", args=[d.pk]),
924-
{"key": d.key, "status": "running"},
925-
)
926-
self._check_header(response)
927-
d.config.refresh_from_db()
928-
self.assertEqual(d.config.status, "applied")
929-
930916
def test_device_report_status_applied(self):
931917
d = self._create_device_config()
932918
with catch_signal(config_status_changed) as handler:

0 commit comments

Comments
 (0)