Rename backends from None to none

All other backend names are lower case.
This commit is contained in:
Unrud 2017-05-31 12:01:39 +02:00
parent edaf21561d
commit eba6621f17
4 changed files with 16 additions and 16 deletions

6
config
View File

@ -66,8 +66,8 @@
[auth] [auth]
# Authentication method # Authentication method
# Value: None | htpasswd | remote_user | http_x_remote_user # Value: none | htpasswd | remote_user | http_x_remote_user
#type = None #type = none
# Htpasswd filename # Htpasswd filename
#htpasswd_filename = /etc/radicale/users #htpasswd_filename = /etc/radicale/users
@ -85,7 +85,7 @@
[rights] [rights]
# Rights backend # Rights backend
# Value: None | authenticated | owner_only | owner_write | from_file # Value: none | authenticated | owner_only | owner_write | from_file
#type = owner_only #type = owner_only
# File for rights management from_file # File for rights management from_file

View File

@ -64,7 +64,7 @@ from importlib import import_module
def load(configuration, logger): def load(configuration, logger):
"""Load the authentication manager chosen in configuration.""" """Load the authentication manager chosen in configuration."""
auth_type = configuration.get("auth", "type") auth_type = configuration.get("auth", "type")
if auth_type == "None": if auth_type in ("None", "none"): # DEPRECATED: use "none"
class_ = NoneAuth class_ = NoneAuth
elif auth_type == "remote_user": elif auth_type == "remote_user":
class_ = RemoteUserAuth class_ = RemoteUserAuth

View File

@ -48,9 +48,9 @@ from . import storage
def load(configuration, logger): def load(configuration, logger):
"""Load the rights manager chosen in configuration.""" """Load the rights manager chosen in configuration."""
rights_type = configuration.get("rights", "type") rights_type = configuration.get("rights", "type")
if configuration.get("auth", "type") == "None": if configuration.get("auth", "type") in ("None", "none"): # DEPRECATED
rights_type = "None" rights_type = "None"
if rights_type == "None": if rights_type in ("None", "none"): # DEPRECATED: use "none"
rights_class = NoneRights rights_class = NoneRights
elif rights_type == "authenticated": elif rights_type == "authenticated":
rights_class = AuthenticatedRights rights_class = AuthenticatedRights

View File

@ -102,16 +102,16 @@ class TestBaseAuthRequests(BaseTest):
self._test_rights("authenticated", "tmp", "/other", "w", 207) self._test_rights("authenticated", "tmp", "/other", "w", 207)
def test_none(self): def test_none(self):
self._test_rights("None", "", "/", "r", 207) self._test_rights("none", "", "/", "r", 207)
self._test_rights("None", "", "/", "w", 207) self._test_rights("none", "", "/", "w", 207)
self._test_rights("None", "", "/tmp", "r", 207) self._test_rights("none", "", "/tmp", "r", 207)
self._test_rights("None", "", "/tmp", "w", 207) self._test_rights("none", "", "/tmp", "w", 207)
self._test_rights("None", "tmp", "/", "r", 207) self._test_rights("none", "tmp", "/", "r", 207)
self._test_rights("None", "tmp", "/", "w", 207) self._test_rights("none", "tmp", "/", "w", 207)
self._test_rights("None", "tmp", "/tmp", "r", 207) self._test_rights("none", "tmp", "/tmp", "r", 207)
self._test_rights("None", "tmp", "/tmp", "w", 207) self._test_rights("none", "tmp", "/tmp", "w", 207)
self._test_rights("None", "tmp", "/other", "r", 207) self._test_rights("none", "tmp", "/other", "r", 207)
self._test_rights("None", "tmp", "/other", "w", 207) self._test_rights("none", "tmp", "/other", "w", 207)
def test_from_file(self): def test_from_file(self):
rights_file_path = os.path.join(self.colpath, "rights") rights_file_path = os.path.join(self.colpath, "rights")