summaryrefslogtreecommitdiff
path: root/src/mailman/rest/root.py
diff options
context:
space:
mode:
authorBarry Warsaw2014-12-29 17:38:16 -0500
committerBarry Warsaw2014-12-29 17:38:16 -0500
commit477ac216b4abbd1f96ff4fa3a9583a76ca993dc3 (patch)
treea703c59e326bc9b8c2705f3052ca413dc9047f62 /src/mailman/rest/root.py
parente86d49d01963640aeac7e27e6c7a49e298e3980f (diff)
downloadmailman-477ac216b4abbd1f96ff4fa3a9583a76ca993dc3.tar.gz
mailman-477ac216b4abbd1f96ff4fa3a9583a76ca993dc3.tar.zst
mailman-477ac216b4abbd1f96ff4fa3a9583a76ca993dc3.zip
Diffstat (limited to 'src/mailman/rest/root.py')
-rw-r--r--src/mailman/rest/root.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mailman/rest/root.py b/src/mailman/rest/root.py
index 93a8f0086..f29f2ba1d 100644
--- a/src/mailman/rest/root.py
+++ b/src/mailman/rest/root.py
@@ -80,13 +80,13 @@ class Root:
return TopLevel()
-class System:
+class Versions:
def on_get(self, request, response):
- """/<api>/system"""
+ """/<api>/system/versions"""
resource = dict(
mailman_version=system.mailman_version,
python_version=system.python_version,
- self_link=path_to('system'),
+ self_link=path_to('system/versions'),
)
okay(response, etag(resource))
@@ -98,11 +98,14 @@ class TopLevel:
def system(self, request, segments):
"""/<api>/system"""
if len(segments) == 0:
- return System()
+ # This provides backward compatibility; see /system/versions.
+ return Versions()
elif len(segments) > 1:
return BadRequest(), []
elif segments[0] == 'preferences':
return ReadOnlyPreferences(system_preferences, 'system'), []
+ elif segments[0] == 'versions':
+ return Versions(), []
else:
return NotFound(), []