From 914117c18e349e24719a3bbdb3b3239e40bbbfdd Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Fri, 29 Jul 2011 14:38:26 -0700 Subject: [PATCH] Updating to fix some SSL issues --- quantum/cli.py | 4 ++-- quantum/client.py | 6 +++--- tests/unit/api.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/quantum/cli.py b/quantum/cli.py index cce6f52a0..89edb1921 100644 --- a/quantum/cli.py +++ b/quantum/cli.py @@ -64,7 +64,7 @@ def create_net(manager, *args): def api_create_net(client, *args): tid, name = args - data = {'network': {'network-name': '%s' % name}} + data = {'network': {'net-name': '%s' % name}} res = client.create_network(data) LOG.debug(res) nid = None @@ -133,7 +133,7 @@ def rename_net(manager, *args): def api_rename_net(client, *args): tid, nid, name = args - data = {'network': {'network-name': '%s' % name}} + data = {'network': {'net-name': '%s' % name}} try: res = client.update_network(nid, data) except Exception, e: diff --git a/quantum/client.py b/quantum/client.py index a9d57e9c9..a8b70f8cd 100644 --- a/quantum/client.py +++ b/quantum/client.py @@ -122,9 +122,9 @@ class Client(object): # Open connection and send request, handling SSL certs certs = {'key_file':self.key_file, 'cert_file':self.cert_file} - - # Only use ssl certs if the cert dict has 1 or more file strings - if len([x for x in certs if x != None]): + certs = {x:certs[x] for x in certs if x != None} + print connection_type + if self.use_ssl and len(certs): c = connection_type(self.host, self.port, **certs) else: c = connection_type(self.host, self.port) diff --git a/tests/unit/api.py b/tests/unit/api.py index 663870bfa..551d0672e 100644 --- a/tests/unit/api.py +++ b/tests/unit/api.py @@ -45,7 +45,7 @@ class ServerStub(): return status # To test error codes, set the host to 10.0.0.1, and the port to the code - def __init__(self, host, port, key_file, cert_file): + def __init__(self, host, port=9696, key_file="", cert_file=""): self.host = host self.port = port self.key_file = key_file -- 2.45.2