Description of problem: ovirtsdk-api does not support instantiating multiple proxy/API connections. Version-Release number of selected component (if applicable): ovirt-engine-sdk-1.3-1.el6.noarch, and git master How reproducible: 100% Steps to Reproduce: from ovirtsdk import api a = api.API(url='http://localhost/', username='one', password='two') b = api.API(url='http://remotehost/', username='one', password='two') Actual results: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "ovirtsdk/api.py", line 84, in __init__ contextmanager.add('proxy', proxy, Mode.R) File "ovirtsdk/infrastructure/contextmanager.py", line 63, in add raise ImmutableError(key) ovirtsdk.infrastructure.errors.ImmutableError: [ERROR]::'proxy' is immutable. Expected results: No traceback; can ping/operate on both connections. Additional info: The "contextmanager" seems little more than sugar-coated global variables, and it only allows one 'proxy' to be cached. Furthermore, there seems to be no public method to access the cached connection without the original API() instance. On top of supporting multiple connections, I'd expect the existing connection pool to be reused when attempting a second login with the same credentials.
> Actual results: > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "ovirtsdk/api.py", line 84, in __init__ > contextmanager.add('proxy', proxy, Mode.R) > File "ovirtsdk/infrastructure/contextmanager.py", line 63, in add > raise ImmutableError(key) > ovirtsdk.infrastructure.errors.ImmutableError: [ERROR]::'proxy' is immutable. this is planned feature, see sdk section of todo list http://www.ovirt.org/wiki/SDK#TODO_list > The "contextmanager" seems little more than sugar-coated global variables, and > it only allows one 'proxy' to be cached. Furthermore, there seems to be no > public method to access the cached connection without the original API() > instance. by-design, sdk is abstracting transport layer, therefore user have no access to connection itself, which is managed by infrastructure, please review sdk wiki: http://www.ovirt.org/wiki/SDK#IDE_Examples > > On top of supporting multiple connections, I'd expect the existing connection > pool to be reused when attempting a second login with the same credentials. based on told above, sdk does not expose any login method, credentials specified only in proxy constructor - API(url, username, password ...)
http://gerrit.ovirt.org/#/c/8645/ *** This bug has been marked as a duplicate of bug 853947 ***