diff --git a/alpenhorn/update.py b/alpenhorn/update.py index 5d6847167..396e0aad8 100644 --- a/alpenhorn/update.py +++ b/alpenhorn/update.py @@ -274,15 +274,9 @@ def update_active(self) -> bool: if self.io.check_active(): return True else: - # Mark the node as inactive in the database - self.db.active = False - self.db.save(only=[StorageNode.active]) - log.info( - f'Correcting the database: node "{self.name}" is now set to ' - "inactive." - ) + log.warning(f'Ignoring node "{self.name}": not ready for I/O.') else: - log.warning(f'Attempted to update inactive node "{self.name}"') + log.warning(f'Ignoring node "{self.name}": deactivated during update.') return False diff --git a/tests/test_update_node.py b/tests/test_update_node.py index dc939369c..8587c5d2d 100644 --- a/tests/test_update_node.py +++ b/tests/test_update_node.py @@ -135,8 +135,8 @@ def test_update_active(unode): # Pretend node is actually not active with patch.object(unode.io, "check_active", lambda: False): assert not unode.update_active() - assert not unode.db.active - assert not StorageNode.select(StorageNode.active).limit(1).scalar() + assert unode.db.active + assert StorageNode.select(StorageNode.active).limit(1).scalar() def test_update_free_space(unode):