Compare commits

...

4 Commits

Author SHA1 Message Date
Jenkins
8d1219d6d5 Merge "bug 963155: add some missing test files to the sdist tarball." into milestone-proposed 2012-04-03 05:38:14 +00:00
Dan Wendlandt
2836995c74 bug 963155: add some missing test files to the sdist tarball.
Change-Id: I78cb561776254e4224eb46e1c06e80e0f2c65d54
2012-04-02 22:19:21 -07:00
Dan Wendlandt
1a1bd5c21a Fix quantum client exception when server returns 500 error.
bug 963494

Also, make sure that exceptions within the client are accompanied with
a full stack trace, otherwise it is hard to track down where it happened.

Change-Id: Ic134ed27523b2c321dcb8e35e6ab0eb144a699f3
2012-04-02 22:19:00 -07:00
Thierry Carrez
c927d1c3f5 Final versioning
Change-Id: I4bcba110e23b50e4d1855bf7fad707925bebe8e7
2012-03-19 10:27:08 +01:00
4 changed files with 7 additions and 6 deletions

View File

@@ -2,3 +2,5 @@ include tox.ini
include LICENSE README
include version.py
include tools/*
include quantum/client/tests/*
include quantum/client/tests/unit/*

View File

@@ -115,7 +115,8 @@ def exception_handler_v11(status_code, error_content):
message=error_message)],)
raise ex
# If we end up here the exception was not a quantum error
raise exceptions.QuantumClientException(status_code + "-" + error_content)
msg = "%s-%s" % (status_code, error_content)
raise exceptions.QuantumClientException(message=msg)
EXCEPTION_HANDLERS = {

View File

@@ -23,6 +23,7 @@
import logging
import os
import sys
import traceback
FORMAT = "json"
LOG = logging.getLogger('quantum.client.cli_lib')
@@ -192,7 +193,6 @@ class CmdOutputTemplate(OutputTemplate):
def _handle_exception(ex):
LOG.exception(sys.exc_info())
status_code = None
message = None
# Retrieve dict at 1st element of tuple at last argument
@@ -202,12 +202,10 @@ def _handle_exception(ex):
msg_1 = "Command failed with error code: %s" \
% (status_code or '<missing>')
msg_2 = "Error message:%s" % (message or '<missing>')
LOG.exception(msg_1 + "-" + msg_2)
print msg_1
print msg_2
else:
print "An unexpected exception occured:%s (%s)" % (sys.exc_info()[1],
sys.exc_info()[0])
traceback.print_exc()
def prepare_output(cmd, tenant_id, response, version):

View File

@@ -24,7 +24,7 @@ except ImportError:
QUANTUM_VERSION = ['2012', '1', None]
YEAR, COUNT, REVSISION = QUANTUM_VERSION
FINAL = False # This becomes true at Release Candidate time
FINAL = True # This becomes true at Release Candidate time
def canonical_version_string():