Example #1
0
    def setUp (self):
        c = omero.client(pmap=['--Ice.Config='+(os.environ.get("ICE_CONFIG"))])
        try:
            self.root_password = c.ic.getProperties().getProperty('omero.rootpass')
            omero_host = c.ic.getProperties().getProperty('omero.host')
        finally:
            c.__del__()

        blitz = Server.find(host=omero_host)
        if blitz is None:
            Server.reset()
            for s in settings.SERVER_LIST:
                server = (len(s) > 2) and unicode(s[2]) or None
                Server(host=unicode(s[0]), port=int(s[1]), server=server)
            Server.freeze()
            blitz = Server.find(server=omero_host)
        
        if blitz is not None:
            self.server_id = blitz.id
            connector = Connector(self.server_id, True)
            self.rootconn = connector.create_connection('TEST.webadmin', 'root', self.root_password)

            if self.rootconn is None or not self.rootconn.isConnected() or not self.rootconn.keepAlive():
                raise exceptions.Exception("Cannot connect")
        else:
            raise exceptions.Exception("'%s' is not on omero.web.server_list" % omero_host)
Example #2
0
 def setUp(self):
     Server.reset()