Browse Source

Encode special characters in CVX username and password

Change-Id: I2f147ab44e7124675dd31a1a5b780ac00f51dc54
(cherry picked from commit 58eadd002e)
changes/85/745985/1 2017.2.10
Mitchell Jameson 1 year ago
parent
commit
e03d1a1c14
  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

@ -22,6 +22,7 @@ from oslo_config import cfg
from oslo_log import log as logging
import requests
import six
from six.moves.urllib.parse import quote
from networking_arista._i18n import _, _LI, _LW, _LE
from networking_arista.common import constants as const
@ -913,8 +914,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_physical_network(self, host_id):

4
networking_arista/ml2/rpc/arista_json.py

@ -21,6 +21,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, _LE
from networking_arista.common import constants as const
@ -41,7 +42,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