Parcourir la source

Remove legacy pairtree splitting option.

Stefano Cossu il y a 5 ans
Parent
commit
29736a30a8

+ 0 - 6
lakesuperior/etc.defaults/application.yml

@@ -77,12 +77,6 @@ store:
         #   Changes to this parameter require a full migration.
         referential_integrity: lenient
 
-        ###
-        #   Split newly minted URIs into pairtrees.
-        #
-        #   This mimics Fedora4 behavior which segments an identifier on POST.
-        legacy_ptree_split: False
-
     ###
     #   The path used to persist LDP-NR (bitstreams).
     #

+ 2 - 7
lakesuperior/model/ldp/ldp_factory.py

@@ -171,16 +171,11 @@ class LdpFactory:
         :return: The confirmed resource UID. This may be different from
             what has been indicated.
         """
-        def split_if_legacy(uid):
-            if config['application']['store']['ldp_rs']['legacy_ptree_split']:
-                uid = tbox.split_uuid(uid)
-            return uid
-
         if path and path.startswith('/'):
             raise ValueError('Slug cannot start with a slash.')
         # Shortcut!
         if not path and parent_uid == '/':
-            return '/' + split_if_legacy(str(uuid4()))
+            return f'/{uuid4()}'
 
         if not parent_uid.startswith('/'):
             raise ValueError('Invalid parent UID: {}'.format(parent_uid))
@@ -196,6 +191,6 @@ class LdpFactory:
             if not rdfly.ask_rsrc_exists(cnd_uid):
                 return cnd_uid
 
-        return pfx + split_if_legacy(str(uuid4()))
+        return f'{pfx}{uuid4()}'