Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a09e82470f | ||
|
|
33ae5ad4e1 | ||
| e4bad046de | |||
| 4d50713d54 | |||
|
|
115f60f005 | ||
|
|
1c634ed2c1 | ||
|
|
e35b3c160b | ||
|
|
62f4868e6e | ||
|
|
ab426a791a |
@@ -2,3 +2,4 @@
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=openstack/python-neutronclient.git
|
||||
defaultbranch=stable/train
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -183,9 +183,9 @@ def http_log_req(_logger, args, kwargs):
|
||||
for (key, value) in six.iteritems(kwargs['headers']):
|
||||
if key in SENSITIVE_HEADERS:
|
||||
v = value.encode('utf-8')
|
||||
h = hashlib.sha1(v)
|
||||
h = hashlib.sha256(v)
|
||||
d = h.hexdigest()
|
||||
value = "{SHA1}%s" % d
|
||||
value = "{SHA256}%s" % d
|
||||
header = ' -H "%s: %s"' % (key, value)
|
||||
string_parts.append(header)
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ class NeutronShell(app.App):
|
||||
type=check_non_negative_int,
|
||||
default=0,
|
||||
help=_("How many times the request to the Neutron server should "
|
||||
"be retried if it fails."))
|
||||
"be retried if it fails. Defaults to 0."))
|
||||
# FIXME(bklei): this method should come from keystoneauth1
|
||||
self._append_global_identity_args(parser)
|
||||
|
||||
@@ -241,12 +241,12 @@ class NeutronShell(app.App):
|
||||
parser.add_argument(
|
||||
'--os-service-type', metavar='<os-service-type>',
|
||||
default=env('OS_NETWORK_SERVICE_TYPE', default='network'),
|
||||
help=_('Defaults to env[OS_NETWORK_SERVICE_TYPE] or network.'))
|
||||
help=_('Defaults to env[OS_NETWORK_SERVICE_TYPE] or "network".'))
|
||||
|
||||
parser.add_argument(
|
||||
'--os-endpoint-type', metavar='<os-endpoint-type>',
|
||||
default=env('OS_ENDPOINT_TYPE', default='public'),
|
||||
help=_('Defaults to env[OS_ENDPOINT_TYPE] or public.'))
|
||||
help=_('Defaults to env[OS_ENDPOINT_TYPE] or "public".'))
|
||||
|
||||
# FIXME(bklei): --service-type is deprecated but kept in for
|
||||
# backward compatibility.
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -934,6 +934,16 @@ class Client(ClientBase):
|
||||
return self.put((self.router_path % router) +
|
||||
"/remove_router_interface", body=body)
|
||||
|
||||
def add_extra_routes_to_router(self, router, body=None):
|
||||
"""Adds extra routes to the specified router."""
|
||||
return self.put((self.router_path % router) + "/add_extraroutes",
|
||||
body=body)
|
||||
|
||||
def remove_extra_routes_from_router(self, router, body=None):
|
||||
"""Removes extra routes from the specified router."""
|
||||
return self.put((self.router_path % router) + "/remove_extraroutes",
|
||||
body=body)
|
||||
|
||||
def add_gateway_router(self, router, body=None):
|
||||
"""Adds an external network gateway to the specified router."""
|
||||
return self.put((self.router_path % router),
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
New client methods: ``add_extra_routes_to_router`` and
|
||||
``remove_extra_routes_from_router``.
|
||||
2
tox.ini
2
tox.ini
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user