Browse Source

Encode special characters in CVX username and password

Change-Id: I2f147ab44e7124675dd31a1a5b780ac00f51dc54
changes/75/745975/1
Mitchell Jameson 9 months ago
parent
commit
58eadd002e
2 changed files with 6 additions and 3 deletions
  1. +3
    -2
      networking_arista/ml2/rpc/arista_eapi.py
  2. +3
    -1
      networking_arista/ml2/rpc/arista_json.py

+ 3
- 2
networking_arista/ml2/rpc/arista_eapi.py View File

@ -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):


+ 3
- 1
networking_arista/ml2/rpc/arista_json.py View File

@ -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