(self)
| 272 | |
| 273 | @cached_property |
| 274 | def partial_sync(self): |
| 275 | partial_sync = self._partial_sync |
| 276 | # We need to use UserError here because ValueError is not |
| 277 | # caught at the time this is expanded. |
| 278 | |
| 279 | if partial_sync is not None: |
| 280 | cls_a, _ = storage_class_from_config(self.config_a) |
| 281 | cls_b, _ = storage_class_from_config(self.config_b) |
| 282 | |
| 283 | if not cls_a.read_only and \ |
| 284 | not self.config_a.get('read_only', False) and \ |
| 285 | not cls_b.read_only and \ |
| 286 | not self.config_b.get('read_only', False): |
| 287 | raise exceptions.UserError( |
| 288 | '`partial_sync` is only effective if one storage is ' |
| 289 | 'read-only. Use `read_only = true` in exactly one storage ' |
| 290 | 'section.' |
| 291 | ) |
| 292 | |
| 293 | if partial_sync is None: |
| 294 | partial_sync = 'revert' |
| 295 | |
| 296 | if partial_sync not in ('ignore', 'revert', 'error'): |
| 297 | raise exceptions.UserError('Invalid value for `partial_sync`.') |
| 298 | |
| 299 | return partial_sync |
| 300 | |
| 301 | |
| 302 | class CollectionConfig: |
nothing calls this directly
no test coverage detected