Skip to content

Commit 719820e

Browse files
committed
correct management of cached iRODS ADMIN_KW option
1 parent c571627 commit 719820e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

irods/manager/metadata_manager.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,20 @@ def get_api_keywords(self):
5353
return self.__kw.copy()
5454

5555
def __call__(self, **flags):
56-
# Make a new shallow copy of the manager object, but update options from parameter list.
56+
# Make a new shallow copy of the manager object, but duplicate options from parameter list as well as iRODS API
57+
# flags (stored in the instance's private __kw member) to be applied in each call.
5758
new_self = copy.copy(self)
5859
new_self._opts = copy.copy(self._opts)
60+
new_self.__kw = copy.copy(self.__kw)
5961

6062
# Update the flags that do bookkeeping in the returned(new) manager object.
6163
new_self._opts.update((key, val) for key, val in flags.items() if val is not None)
6264

63-
# Update the ADMIN_KW flag in the returned(new) object.
65+
# For the new object, make ADMIN_KW flag or absence thereof reflect the admin option in _opts.
6466
if new_self._opts.get('admin'):
65-
self.__kw[kw.ADMIN_KW] = ""
67+
new_self.__kw[kw.ADMIN_KW] = ""
6668
else:
67-
self.__kw.pop(kw.ADMIN_KW, None)
69+
new_self.__kw.pop(kw.ADMIN_KW, None)
6870

6971
return new_self
7072

0 commit comments

Comments
 (0)