Expected behaviour
When a Replicator location is disabled, Storage Service should not create new package replicas in that location.
Current behaviour
If an AIP Storage location has a configured Replicator location and that Replicator is later disabled, new replicas are still created in the disabled location.
The replication path in Package.create_replicas() currently uses:
replicator_locs = self.current_location.replicators.all()
This returns all related Replicator locations, including disabled ones. Since the Location model has an enabled field and an active manager for enabled locations, this should instead filter the related locations to:
replicator_locs = self.current_location.replicators.filter(enabled=True)
Steps to reproduce
- Create or select an AIP Storage location.
- Configure a Replicator location for that AIP Storage location.
- Store an AIP and confirm a replica is created.
- Disable the Replicator location.
- Store another AIP, or run replica creation for an existing AIP.
- Observe that Storage Service still creates a package replica in the disabled Replicator location.
Your environment (version of Archivematica, operating system, other relevant details)
artefactual/archivematica@988d1ff
artefactual/archivematica-storage-service@6808a7a
For Artefactual use:
Before you close this issue, you must check off the following:
Expected behaviour
When a Replicator location is disabled, Storage Service should not create new package replicas in that location.
Current behaviour
If an AIP Storage location has a configured Replicator location and that Replicator is later disabled, new replicas are still created in the disabled location.
The replication path in
Package.create_replicas()currently uses:This returns all related Replicator locations, including disabled ones. Since the
Locationmodel has anenabledfield and anactivemanager for enabled locations, this should instead filter the related locations to:Steps to reproduce
Your environment (version of Archivematica, operating system, other relevant details)
artefactual/archivematica@988d1ff
artefactual/archivematica-storage-service@6808a7a
For Artefactual use:
Before you close this issue, you must check off the following: