class DpbSshInterface:
- """ Communicate with the DPB via SSH """
+ """Communicate with the DPB via SSH"""
__LOGGER_NAME_EXT = ".ssh"
__FUNCTION_MAP_POS = 1
class DpbRestInterface:
- """ Communicate with the DPB via the REST API """
+ """Communicate with the DPB via the REST API"""
__LOGGER_NAME_EXT = ".rest"
__FUNCTION_MAP_POS = 0
class DpbConnector(SdnConnectorBase):
- """ Use the DPB to establish multipoint connections """
+ """Use the DPB to establish multipoint connections"""
__LOGGER_NAME = "ro.sdn.dpb"
__SUPPORTED_SERV_TYPES = ["ELAN (L2)", "ELINE (L2)"]
if len(connection_points) < 2:
raise SdnConnectorError("Connections must be of at least 2 endpoints")
- """ First step, create the vpn service """
+ """First step, create the vpn service"""
uuid_l2vpn = str(uuid.uuid4())
vpn_service = {}
vpn_service["vpn-id"] = uuid_l2vpn
http_code=response_service_creation.status_code,
)
- """ Second step, create the connections and vpn attachments """
+ """Second step, create the connections and vpn attachments"""
for connection_point in connection_points:
connection_point_wan_info = self.search_mapp(connection_point)
site_network_access = {}
connection_point["service_endpoint_encapsulation_type"]
== "dot1q"
):
- """ The connection is a VLAN """
+ """The connection is a VLAN"""
connection["encapsulation-type"] = "dot1q-vlan-tagged"
tagged = {}
tagged_interf = {}
if connection_point["service_endpoint_encapsulation_type"] != "none":
if connection_point["service_endpoint_encapsulation_type"] == "dot1q":
- """ The connection is a VLAN """
+ """The connection is a VLAN"""
connection["encapsulation-type"] = "dot1q-vlan-tagged"
tagged = {}
tagged_interf = {}
class UnderlayApi:
- """ Class with CRUD operations for the underlay API """
+ """Class with CRUD operations for the underlay API"""
def __init__(self, url, config=None, user=None, password=None, logger=None):
self.logger = logger or logging.getLogger("ro.sdn.junipercontrail.sdnapi")
self._format_request_exception(e)
def new_image(self, image_dict):
- """ Adds a tenant image to VIM, returns image_id"""
+ """Adds a tenant image to VIM, returns image_id"""
try:
self._get_my_tenant()
new_image_dict = {"name": image_dict["name"][:64]}