Skip to content

fix sticky ADMIN_KW - #834

Open
d-w-moore wants to merge 5 commits into
irods:mainfrom
d-w-moore:833.m
Open

fix sticky ADMIN_KW#834
d-w-moore wants to merge 5 commits into
irods:mainfrom
d-w-moore:833.m

Conversation

@d-w-moore

@d-w-moore d-w-moore commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Use of ADMIN_KW carried over into subsequent metadata calls even if unwanted.

Comment thread irods/manager/metadata_manager.py Outdated
def __init__(self, *_):
self._opts = _MetadataManager_opts_initializer.copy()
super().__init__(*_)
self.__kw = self.__default_kw.copy()

@korydraughn korydraughn Sep 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this require a named variable (i.e. self.__default_kw)?
Isn't this equivalent to self.__kw = {}?

I'm not requesting anything change. Just curious.

Comment thread irods/test/meta_test.py
d.metadata.set('a','b')
else:
d.metadata(admin=True)
sessions.append(ses)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is ses still active beyond the with-block?
Wouldn't the cleanup logic run at the end of the with-block?

Comment thread irods/test/meta_test.py
Comment on lines +808 to +824
sessions = []
for _ in range(2):
with iRODSSession(
port=adm.port,
zone=adm.zone,
host=adm.host,
user=user.name,
password="bpass",
) as ses:
# Create a data object owned by the rodsuser. Set AVUs in various ways and guarantee each attempt
# has the desired effect.
d = ses.data_objects.create("/{adm.zone}/home/{user.name}/testfile".format(**locals()))
if sessions:
d.metadata.set('a','b')
else:
d.metadata(admin=True)
sessions.append(ses)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simplify this by dropping the for-loop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants