Replace jsonrpclib with jsonrpc_requests module

The jsonrpclib library module is not python 3 compatible and not
actively maintained. jsonrpc-requests is newer, python compatible and
based upon the underlying requests library already in use.

Change-Id: I04878c7a56c4afea595bd85e65b54ce6193f3fb4
changes/49/443949/1
Mark McClain 6 years ago
parent 3dc3d51740
commit c22dd944bc

@ -16,7 +16,7 @@ import hashlib
import socket
import struct
import jsonrpclib
import jsonrpc_requests
from oslo_config import cfg
from oslo_log import log as logging
@ -100,13 +100,23 @@ class AristaL3Driver(object):
self._validate_config()
host = cfg.CONF.l3_arista.primary_l3_host
self._hosts.append(host)
self._servers.append(jsonrpclib.Server(self._eapi_host_url(host)))
self._servers.append(
jsonrpc_requests.Server(
self._eapi_host_url(host),
verify=False
)
)
self._mlag_configured = cfg.CONF.l3_arista.mlag_config
self._use_vrf = cfg.CONF.l3_arista.use_vrf
if self._mlag_configured:
host = cfg.CONF.l3_arista.secondary_l3_host
self._hosts.append(host)
self._servers.append(jsonrpclib.Server(self._eapi_host_url(host)))
self._servers.append(
jsonrpc_requests.Server(
self._eapi_host_url(host),
verify=False
)
)
self._additionalRouterCmdsDict = additional_cmds_for_mlag['router']
self._additionalInterfaceCmdsDict = (
additional_cmds_for_mlag['interface'])

@ -14,7 +14,7 @@
import json
import jsonrpclib
import jsonrpc_requests
from oslo_config import cfg
from oslo_log import log as logging
@ -91,8 +91,12 @@ class AristaSecGroupSwitchDriver(object):
switch_pass = ''
self._hosts[switch_ip] = (
{'user': switch_user, 'password': switch_pass})
self._servers.append(jsonrpclib.Server(
self._eapi_host_url(switch_ip)))
self._servers.append(
jsonrpc_requests.Server(
self._eapi_host_url(switch_ip),
verify=False
)
)
self.aclCreateDict = acl_cmd['acl']
self.aclApplyDict = acl_cmd['apply']
@ -458,7 +462,10 @@ class AristaSecGroupSwitchDriver(object):
# Ingress ACL, egress ACL or both
direction = ['ingress', 'egress']
server = jsonrpclib.Server(self._eapi_host_url(switch_info))
server = jsonrpc_requests.Server(
self._eapi_host_url(switch_info),
verify=False
)
for d in range(len(direction)):
name = self._arista_acl_name(sg['id'], direction[d])
try:
@ -504,7 +511,10 @@ class AristaSecGroupSwitchDriver(object):
# THIS IS TOTAL HACK NOW - just for testing
# Assumes the credential of all switches are same as specified
# in the condig file
server = jsonrpclib.Server(self._eapi_host_url(switch_info))
server = jsonrpc_requests.Server(
self._eapi_host_url(switch_info),
verify=False
)
for d in range(len(direction)):
name = self._arista_acl_name(sg['id'], direction[d])
try:

@ -3,7 +3,7 @@
# process, which may cause wedges in the gate later.
Babel>=1.3
jsonrpclib
jsonrpc-requests
neutron-lib>=1.1.0 # Apache-2.0
oslo.log>=3.11.0 # Apache-2.0
pbr>=1.8

Loading…
Cancel
Save