Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Fix sort(lambda) under Python 3 #264

Merged
merged 2 commits into from
Oct 19, 2020
Merged

Conversation

joshmoore
Copy link
Member

Discovered while testing for https://forum.image.sc/t/omero-cli-exit-status/44110

Without this PR:

(z) /opt/omero-py $omero errors
Traceback (most recent call last):
  File "/usr/local/anaconda3/envs/z/bin/omero", line 33, in <module>
    sys.exit(load_entry_point('omero-py', 'console_scripts', 'omero')())
  File "/opt/omero-py/target/omero/main.py", line 125, in main
    rv = omero.cli.argv()
  File "/opt/omero-py/target/omero/cli.py", line 1784, in argv
    cli.invoke(args[1:])
  File "/opt/omero-py/target/omero/cli.py", line 1222, in invoke
    stop = self.onecmd(line, previous_args)
  File "/opt/omero-py/target/omero/cli.py", line 1299, in onecmd
    self.execute(line, previous_args)
  File "/opt/omero-py/target/omero/cli.py", line 1381, in execute
    args.func(args)
  File "/opt/omero-py/target/omero/plugins/basics.py", line 296, in __call__
    combined.sort(lambda a, b: cmp(a[1].rcode, b[1].rcode))
TypeError: sort() takes no positional arguments

With this PR:

(z) /opt/omero-py $omero errors
   52	       hql	 BAD_QUERY	'Bad query: %s'
   52	    search	 BAD_QUERY	'Bad query: %s'
   53	       hql	 NOT_ADMIN	'SecurityViolation: Current user is not an admin an...'
   53	    search	 NOT_ADMIN	'SecurityViolation: Current user is not an admin an...'
   67	       hql	  NO_QUIET	'Can't ask for query with --quiet option'
   67	    search	  NO_QUIET	'Can't ask for query with --quiet option'
  123	     admin	NOT_WINDOWS	'Not Windows'
  200	     admin	     SETUP	'Error during service user set up:  (%s) %s'
  201	     admin	   RUNNING	'%s is already running. Use stop first'
  202	     admin	NO_SERVICE	'%s service deleted.'
  300	     admin	BAD_CONFIG	'Bad configuration: No IceGrid.Node.Data property'
  400	     admin	WIN_CONFIG	'%s is not in this directory. Abortin...'
  666	     admin	  NO_WIN32	'Could not import win32service and/or win32evtlogut...'

@imagesc-bot
Copy link

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/omero-cli-exit-status/44110/2

@manics
Copy link
Member

manics commented Oct 19, 2020

Is it worth adding a basic test to check it runs?

@joshmoore
Copy link
Member Author

Green. Propose for patch release.

Copy link
Member

@sbesson sbesson left a comment

Choose a reason for hiding this comment

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

👍 for releasing immediately

@joshmoore joshmoore merged commit 3f68db6 into ome:master Oct 19, 2020
@joshmoore joshmoore deleted the err-code-fix branch October 19, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants