Closed sbesson closed 1 year ago
but I can't immediately think of a case where I would use it.
Agreed and this is likely why I didn't go and implement this solution at first. The omero sessions login --retry
logic was introduced for a fairly specific use case. I'd be fine with waiting until someone comes with a concrete scenario before adding an optional argument to almost all CLI plugins
We had some users stumbling across the InternalException: Failed to connect: 'Namespace' object has no attribute 'retry'
error and I just realised this has been merged but not released yet.
@joshmoore @jburel is there a roadmap/timeline for the next OMERO.py release? I realise there are a few ongoing investigations including https://github.com/ome/omero-py/pull/371 and https://github.com/ome/omero-py/pull/370 but looking at https://github.com/ome/omero-py/compare/v5.13.1...d5ca72f930d85ee1f147f9f8e3cfd1c95c8089ae, we could certainly cut a patch release with the integrated changes.
It will make sense to cut a patch release. Do you want to take care of it?
Sure, I'll open a changelog PR shortly
Some logic was introduced in https://github.com/ome/omero-py/pull/283 to allow auto-retries in the CLI sessions plugin. This new functionality is disabled by default. As can be seen in the original PR, most of the testing has been done using
omero sessions login
where the functionality was introduced.Most CLI plugins can inherit the login mechanism: the addition of
add_login_arguments()
in the CLI plugin sub-parser means theself.ctx.conn(args)
can then useself.controls["sessions"].login(args)
.As the
--retry
argument was only added to the sessions plugin, a misleading error message can be printed under some scenarios. The most typical ones and the easiest to reproduce is to enter an incorrect password. Thelogin
command produces the expected behavior with 3 tries by defaut:But any other command will fail immediately with a cryptic
InternalException
e5ac9c67d1e6b39913c840af05da6c7a73adcf1a proposes one way to fix this issue by adding an additional check for the existence of the
retry
in thevar(args)
dictionary and would make the two examples above behave identically. An alternate strategy would be to add--retry
toParser. add_login_arguments
and allow all sub-commands to set the value.