Skip to content

Commit 53d8044

Browse files
committed
[cleanup] Remove deprecated code marked for 1.2.0 release
1 parent 828dfb3 commit 53d8044

File tree

4 files changed

+2
-31
lines changed

4 files changed

+2
-31
lines changed

openwisp_controller/config/base/config.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +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-
4133

4234
class TemplatesThrough(object):
4335
"""

openwisp_controller/config/controller/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ 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
254+
# (Deleted the 'running' append line here)
255255
required_params = [("key", device.key), ("status", allowed_status)]
256256
for key, value in required_params:
257257
bad_response = forbid_unallowed(request, "POST", key, value)
@@ -260,7 +260,7 @@ def post(self, request, *args, **kwargs):
260260
status = request.POST.get("status")
261261
# mantain backward compatibility with old agents
262262
# ("running" was changed to "applied")
263-
status = status if status != "running" else "applied"
263+
# (Deleted the 'if status != running' block here)
264264
# If the Config.status is "deactivating", then set the
265265
# status to "deactivated". This will stop the device
266266
# from receiving new configurations.

openwisp_controller/config/tasks.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,3 @@ def invalidate_controller_views_cache(organization_id):
201201

202202

203203
@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)