Compare commits

...

4 Commits

Author SHA1 Message Date
Jay Faulkner
a09e82470f Convert exception to string before passing it in
Before this change, neutronclient was passing in a raw exception
as a kwarg to the ConnectionFailed exception. This caused an
exception to be raised in _safe_decode_dict() due to the exception
not being a text type.

Now, we explicitly convert the raw exception to a string before
passing it as a kwarg.

Closes-bug: 1859068
Change-Id: I323b3aceec0a937874eabf770fbc82995202f6d6
(cherry picked from commit 946ac3ed2e)
2020-02-03 14:44:51 +00:00
Akihiro Motoki
33ae5ad4e1 Fix pep8 errors with hacking 2.0.0
Change-Id: I4737d4bc4fa116f45e2361eba93f48feae0161a4
(cherry picked from commit 91fb009706)
2020-01-29 16:34:58 +00:00
e4bad046de Update TOX/UPPER_CONSTRAINTS_FILE for stable/train
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/train branch, tests will
continue to use the upper-constraints list on master.

Change-Id: Ieffc1b87a0f899801f8084ecd01c99c40d3991a9
2019-09-20 17:41:46 +00:00
4d50713d54 Update .gitreview for stable/train
Change-Id: I581a3f0f977f1eb9d2eabbfe109ebd13ecb4cb4f
2019-09-20 17:41:44 +00:00
5 changed files with 9 additions and 8 deletions

View File

@@ -2,3 +2,4 @@
host=review.opendev.org
port=29418
project=openstack/python-neutronclient.git
defaultbranch=stable/train

View File

@@ -104,13 +104,13 @@ class HTTPClient(object):
try:
resp, body = self.request(*args, **kargs)
except requests.exceptions.SSLError as e:
raise exceptions.SslCertificateValidationError(reason=e)
raise exceptions.SslCertificateValidationError(reason=str(e))
except Exception as e:
# Wrap the low-level connection error (socket timeout, redirect
# limit, decompression error, etc) into our custom high-level
# connection exception (it is excepted in the upper layers of code)
_logger.debug("throwing ConnectionFailed : %s", e)
raise exceptions.ConnectionFailed(reason=e)
raise exceptions.ConnectionFailed(reason=str(e))
utils.http_log_resp(_logger, resp, body)
# log request-id for each api call

View File

@@ -139,8 +139,8 @@ class TestCreateNetworkLog(TestNetworkLog):
self.mocked = self.neutronclient.create_network_log
self.cmd = network_log.CreateNetworkLog(self.app, self.namespace)
loggables = {
"loggable_resources": [{"type": RES_TYPE_SG,
"type": RES_TYPE_FWG}]
"loggable_resources": [{"type": RES_TYPE_SG},
{"type": RES_TYPE_FWG}]
}
self.neutronclient.list_network_loggable_resources = mock.Mock(
return_value=loggables)

View File

@@ -33,9 +33,9 @@ class CLITestV20QoSRuleJSON(test_cli20.CLITestV20Base):
# qos_rule_types.
resources = 'rule_types'
cmd_resources = 'qos_rule_types'
response_contents = [{'type': 'bandwidth_limit',
'type': 'dscp_marking',
'type': 'minimum_bandwidth'}]
response_contents = [{'type': 'bandwidth_limit'},
{'type': 'dscp_marking'},
{'type': 'minimum_bandwidth'}]
cmd = qos_rule.ListQoSRuleTypes(test_cli20.MyApp(sys.stdout),
None)

View File

@@ -12,7 +12,7 @@ setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
install_command = pip install {opts} {packages}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/train}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# Delete bytecodes from normal directories before running tests.