Juan Hernandez has uploaded a new change for review. Change subject: codegen, sdk: Fix propagation of context ......................................................................
codegen, sdk: Fix propagation of context The patch that replaced the Python HTTP library with pycurl introduced a bug in the propagation of the context key from the entry point to the connections pool. This patch fixes it. Change-Id: I71c4fc009b629195a9e154b8ecd3db741e7e89d5 Signed-off-by: Juan Hernandez <juan.hernan...@redhat.com> --- M generator/src/main/java/org/ovirt/engine/sdk/generator/rsdl/templates/EntryPointTemplate M src/ovirtsdk/api.py M src/ovirtsdk/infrastructure/connectionspool.py 3 files changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-sdk refs/changes/93/34893/1 diff --git a/generator/src/main/java/org/ovirt/engine/sdk/generator/rsdl/templates/EntryPointTemplate b/generator/src/main/java/org/ovirt/engine/sdk/generator/rsdl/templates/EntryPointTemplate index 4acadf0..30408bd 100644 --- a/generator/src/main/java/org/ovirt/engine/sdk/generator/rsdl/templates/EntryPointTemplate +++ b/generator/src/main/java/org/ovirt/engine/sdk/generator/rsdl/templates/EntryPointTemplate @@ -83,7 +83,7 @@ url=url, username=username, password=password, - context=context, + context_key=self.id, key_file=key_file, cert_file=cert_file, ca_file=ca_file, diff --git a/src/ovirtsdk/api.py b/src/ovirtsdk/api.py index 0111cdd..be2ea4f 100644 --- a/src/ovirtsdk/api.py +++ b/src/ovirtsdk/api.py @@ -149,7 +149,7 @@ url=url, username=username, password=password, - context=context, + context_key=self.id, key_file=key_file, cert_file=cert_file, ca_file=ca_file, diff --git a/src/ovirtsdk/infrastructure/connectionspool.py b/src/ovirtsdk/infrastructure/connectionspool.py index 0883a9e..16b2b0e 100644 --- a/src/ovirtsdk/infrastructure/connectionspool.py +++ b/src/ovirtsdk/infrastructure/connectionspool.py @@ -19,17 +19,18 @@ import threading from ovirtsdk.infrastructure import errors +from ovirtsdk.infrastructure.context import context class ConnectionsPool(object): """Object used to manage pool of HTTP connections""" def __init__(self, url, key_file, cert_file, ca_file, timeout, username, - password, context, insecure, validate_cert_chain, debug, + password, context_key, insecure, validate_cert_chain, debug, kerberos): - # Save the URL and the context: + # Save the URL and the context key: self.__url = url - self.__context = context + self.__context_key = context_key # Save the credentials: self.__username = username @@ -103,12 +104,12 @@ header_lines.append("Accept: application/xml") # Set the filter header: - fltr = self.__context.manager[self.__context].get("filter") + fltr = context.manager[self.__context_key].get("filter") if fltr is not None: header_lines.append("Filter: %s" % fltr) # Set the session TTL header: - ttl = self.__context.manager[self.__context].get("session_timeout") + ttl = context.manager[self.__context_key].get("session_timeout") if ttl is not None: header_lines.append("Session-TTL: %s" % ttl) -- To view, visit http://gerrit.ovirt.org/34893 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I71c4fc009b629195a9e154b8ecd3db741e7e89d5 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine-sdk Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <juan.hernan...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches