|
10 | 10 | import os |
11 | 11 | import sys |
12 | 12 | import threading |
| 13 | +from types import SimpleNamespace |
13 | 14 |
|
14 | 15 | from bson.objectid import ObjectId, InvalidId |
15 | 16 | import cachetools |
@@ -244,6 +245,7 @@ def __init__( |
244 | 245 | self._clear_from_cache = clear_from_cache |
245 | 246 | self._filler_creation_lock = threading.RLock() |
246 | 247 | self.authz_shim = authz_shim |
| 248 | + self.node = SimpleNamespace(key=self.key) |
247 | 249 |
|
248 | 250 | @functools.cached_property |
249 | 251 | def access_blob(self): |
@@ -298,7 +300,7 @@ def metadata(self): |
298 | 300 | return metadata |
299 | 301 |
|
300 | 302 | async def replace_metadata(self, metadata=None, specs=None, access_blob=None, drop_revision=False): |
301 | | - if access_blob: |
| 303 | + if access_blob and (access_blob != self.access_blob): |
302 | 304 | raise NotImplementedError("Updating access_blob on MongoDB-backed data is not supported.") |
303 | 305 | if drop_revision: |
304 | 306 | raise NotImplementedError("Must use drop_revision=False with databroker.mongo_normalized") |
@@ -477,6 +479,7 @@ def __init__( |
477 | 479 | self._event_collection = event_collection |
478 | 480 | self._cutoff_seq_num = cutoff_seq_num |
479 | 481 | self._run = run |
| 482 | + self.node = SimpleNamespace(key=self.key) |
480 | 483 |
|
481 | 484 | @property |
482 | 485 | def access_blob(self): |
@@ -522,7 +525,7 @@ def key(self): |
522 | 525 | return self._metadata["descriptors"][0]["name"] |
523 | 526 |
|
524 | 527 | async def replace_metadata(self, metadata=None, specs=None, access_blob=None, drop_revision=False): |
525 | | - if access_blob: |
| 528 | + if access_blob and (access_blob != self.access_blob): |
526 | 529 | raise NotImplementedError("Updating access_blob on MongoDB-backed data is not supported.") |
527 | 530 | if drop_revision: |
528 | 531 | raise NotImplementedError("Must use drop_revision=False with databroker.mongo_normalized") |
|
0 commit comments