← Back to team overview

openupgrade-drivers team mailing list archive

Re: [Question #226718]: Openupgrade Comparions Config: problem with connection

 

Question #226718 on OpenUpgrade Server changed:
https://answers.launchpad.net/openupgrade-server/+question/226718

    Status: Answered => Open

Jeroen_monkeytail is still having a problem:
This is the code, where the connection is tested:

[comparison_config.py]
    def get_connection(self, cr, uid, ids, context=None):
        if not ids:
            raise osv.except_osv(
                _("Cannot connect"), _("Invalid id passed."))
        conf = self.read(cr, uid, ids[0], context=None)

        print "dir(openerplib): ", dir(openerplib)
        #dir(openerplib):  
        #  ['AuthenticationError', 'Connection', 'Connector', 'JsonRPCConnector', 'JsonRPCException', 'JsonRPCSConnector', 'Model', 'Service', 
        #  'XmlRPCConnector', 'XmlRPCSConnector', '__builtins__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', 
        #  'get_connection', 'get_connector', 'json', 'json_rpc', 'logging', 'main', 'random', 'urllib2', 'xmlrpclib']
        return openerplib.get_connection(
           hostname=conf['server'],
           database=conf['database'],
           login   =conf['username'],
           password=conf['password'],
           port    =conf['port'],
           )

    def test_connection(self, cr, uid, ids, context=None):
        try:
            connection = self.get_connection(cr, uid, [ids[0]], context)

            print 'connection', connection
            print 'dir(connection): ', dir(connection)
            #connection:  <openerplib.main.Connection object at 0x3075b90>
            #dir(connection)
            #dir(connection):  ['_Connection__logger', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', 
            #'__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', 
            #'__subclasshook__', '__weakref__', 'check_login', 'connector', 'database', 'get_model', 'get_service', 'get_user_context', 'login', 
            #'password', 'set_login_info', 'user_context', 'user_id']


so you are trying to say that it goes wrong on this line:
connection = self.get_connection(cr, uid, [ids[0]], context)
?

if we analyse 'connection':
            #dir(connection):  ['_Connection__logger', '__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', 
            #'__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', 
            #'__subclasshook__', '__weakref__', 'check_login', 'connector', 'database', 'get_model', 'get_service', 'get_user_context', 'login', 
            #'password', 'set_login_info', 'user_context', 'user_id']

we see it does not contain the standard openerp class function, like create, write, search etc.
This is not good?

Apparently, something goes wrong here:
        return openerplib.get_connection(
           hostname=conf['server'],
           database=conf['database'],
           login   =conf['username'],
           password=conf['password'],
           port    =conf['port'],
           )


I now want to look up the function 'get_connection' in openerplib:

jeroen@probook-jeroen:/usr/local/lib/python2.7/dist-packages$ ls -l
total 424
drwxr-sr-x  4 root staff   4096 2011-12-02 13:41 aeroolib-1.0.0.RC4-py2.7.egg
drwxr-sr-x  2 root staff   4096 2013-03-28 13:44 Asterisk
-rw-r--r--  1 root staff   3687 2012-10-29 11:59 bzr-2.5.1.egg-info
drwxr-sr-x 17 root staff  16384 2012-10-29 11:59 bzrlib
drwxr-sr-x 17 root staff   4096 2012-04-05 16:39 django
-rw-r--r--  1 root staff   1179 2012-04-05 16:39 Django-1.4.egg-info
-rw-r--r--  1 root staff    393 2013-04-15 12:30 easy-install.pth
drwxr-sr-x  4 root staff   4096 2013-01-04 15:52 Jinja2-2.6-py2.7.egg
drwxr-sr-x  5 root staff   4096 2011-11-30 13:55 openerp_client-6.0.3-py2.7.egg
-rw-r--r--  1 root root   14983 2013-04-15 12:30 openerp_client_lib-1.1.1-py2.7.egg
drwxr-sr-x  4 root staff   4096 2013-03-28 13:29 phonenumbers
drwxr-sr-x  2 root staff   4096 2013-03-28 13:29 phonenumbers-5.4b1-py2.7.egg-info
-rw-r--r--  1 root staff    256 2013-03-28 13:44 py_Asterisk-0.5.1.egg-info
drwxr-sr-x  2 root staff   4096 2013-03-28 13:29 py_Asterisk-0.5.1-py2.7.egg-info
-rw-rw-r--  1 root staff 332005 2011-11-30 13:45 setuptools-0.6c11-py2.7.egg
-rw-r--r--  1 root staff     30 2011-11-30 13:51 setuptools.pth
drwxr-sr-x  4 root staff   4096 2013-01-04 15:52 Sphinx-1.1.3-py2.7.egg
drwxr-sr-x  5 root staff   4096 2012-03-28 11:54 werkzeug
drwxr-sr-x  2 root staff   4096 2012-03-28 11:54 Werkzeug-0.8.3-py2.7.egg-info

I try to read the file: openerp_client_lib-1.1.1-py2.7.egg
jeroen@probook-jeroen:/usr/local/lib/python2.7/dist-packages$ less openerp_client_lib-1.1.1-py2.7.egg 
"openerp_client_lib-1.1.1-py2.7.egg" may be a binary file.  See it anyway?

openerp_client_lib-1.1.1-py2.7.egg appears to be a binary file, there is not a directory with the same name,
like django has:

drwxr-sr-x 17 root staff   4096 2012-04-05 16:39 django
-rw-r--r--  1 root staff   1179 2012-04-05 16:39 Django-1.4.egg-info

Is openerplib not correctly installed?

-- 
You received this question notification because you are a member of
OpenUpgrade Drivers, which is an answer contact for OpenUpgrade Server.