Browse Source

Encode special characters in CVX username and password

Change-Id: I2f147ab44e7124675dd31a1a5b780ac00f51dc54
(cherry picked from commit 58eadd002e)
changes/83/745983/1
Mitchell Jameson 1 year ago
parent
commit
6822a43d60
  1. 5
      networking_arista/ml2/rpc/arista_eapi.py
  2. 4
      networking_arista/ml2/rpc/arista_json.py

5
networking_arista/ml2/rpc/arista_eapi.py

@ -18,6 +18,7 @@ import json
from oslo_log import log as logging
import requests
import six
from six.moves.urllib.parse import quote
from neutron_lib.api.definitions import portbindings
@ -281,8 +282,8 @@ class AristaRPCWrapperEapi(AristaRPCWrapperBase):
def _api_host_url(self, host=""):
return ('https://%s:%s@%s/command-api' %
(self._api_username(),
self._api_password(),
(quote(self._api_username()),
quote(self._api_password()),
host))
def get_baremetal_physnet(self, context):

4
networking_arista/ml2/rpc/arista_json.py

@ -20,6 +20,7 @@ from oslo_log import log as logging
from oslo_utils import excutils
import requests
import six
from six.moves.urllib.parse import quote
from networking_arista._i18n import _, _LI, _LW
from networking_arista.common import exceptions as arista_exc
@ -38,7 +39,8 @@ class AristaRPCWrapperJSON(AristaRPCWrapperBase):
(user, password, host))
def _api_host_url(self, host=""):
return self._get_url(host, self._api_username(), self._api_password())
return self._get_url(host, quote(self._api_username()),
quote(self._api_password()))
def _send_request(self, host, path, method, data=None,
sanitized_data=None):

Loading…
Cancel
Save