[ome-devel] Group switching problem
Niko Ehrenfeuchter
nikolaus.ehrenfeuchter at unibas.ch
Wed Jun 17 15:00:32 BST 2015
Hi everybody,
I'm not 100% sure, but I might have found a regression on #2951 [1]
trying to specify a particular group when using the CLI, see this
transcript:
-----------------------------------
> $ OM_USER=demo01
> $ OM_PASS=some_thing
> $ OM_SERV=vbox.omero
> $ OM_GROUPID=84
>
> $ /opt/OMERO/OMERO.server/bin/omero logout
>
> $ /opt/OMERO/OMERO.server/bin/omero login --server $OM_SERV --user $OM_USER --password $OM_PASS --group $OM_GROUPID
>
>> Previously logged in to vbox.omero:4064 as demo01
>> InternalException: Failed to connect: exception ::Glacier2::CannotCreateSessionException
>> {
>> reason = No info in database for demo01
>> }
>
> $ /opt/OMERO/OMERO.server/bin/omero login --server $OM_SERV --user $OM_USER --password $OM_PASS
>
>> Previously logged in to vbox.omero:4064 as demo01
>> Created session 880e0d11-d303-4f89-8a90-1b7f905880e5 (demo01 at vbox.omero:4064). Idle timeout: 10.0 min. Current group: Demo Group
>
> $ /opt/OMERO/OMERO.server/bin/omero sessions list
>
>> Server | User | Group | Session | Active | Started
>> ------------+--------+------------+--------------------------------------+-----------+--------------------------
>> vbox.omero | demo01 | Demo Group | a54eb0dc-1dd1-4f81-b0b1-8c98b35752aa | Logged in | Wed Jun 17 15:42:02 2015
>
> $ /opt/OMERO/OMERO.server/bin/omero sessions group $OM_GROUPID
>
>> Using session 880e0d11-d303-4f89-8a90-1b7f905880e5 (demo01 at vbox.omero:4064). Idle timeout: 10.0 min. Current group: Demo Group
>> Group 'Demo Group' (id=34) switched to 'Another Test Group' (id=84)
>
> $ /opt/OMERO/OMERO.server/bin/omero sessions list
>
>> Server | User | Group | Session | Active | Started
>> ------------+--------+--------------------+--------------------------------------+-----------+--------------------------
>> vbox.omero | demo01 | Another Test Group | 880e0d11-d303-4f89-8a90-1b7f905880e5 | Logged in | Wed Jun 17 15:42:02 2015
---------------
Now my actual question is related, although not identical: as you might
remember from my last email, I'm using the CLI class from the Python
module omero.cli to trigger the import of an image into OMERO.
Initially, I thought something like this would do:
> from omero.cli import CLI
> conn.SERVICE_OPTS.setOmeroGroup(gid)
> cli = CLI()
> cli.loadplugins()
> cli._client = conn.c # or "cli.set_client(conn.c)" for 5.1
> import_args = ["import", '-d', '101', '/path/to/file.tif']
> cli.invoke(import_args)
Unfortunately, this doesn't work - I'm getting an
"ome.conditions.SecurityViolation" error.
What's the appropriate way of switching to the non-default group before
running cli.invoke()?
Thanks a lot!
~Niko
[1] http://trac.openmicroscopy.org.uk/ome/ticket/2951
--
Niko Ehrenfeuchter | Image Analysis Specialist | Biozentrum, University
of Basel | Klingelbergstr. 50/70 | CH-4056 Basel
Phone: +41 (61) 26 72673 | nikolaus.ehrenfeuchter at unibas.ch |
www.biozentrum.unibas.ch | www.microscopynetwork.unibas.ch
More information about the ome-devel
mailing list