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)"]
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")
if self.config.get("disable_network_port_security"):
network_dict["port_security_enabled"] = False
+ if self.config.get("neutron_availability_zone_hints"):
+ hints = self.config.get("neutron_availability_zone_hints")
+
+ if isinstance(hints, str):
+ hints = [hints]
+
+ network_dict["availability_zone_hints"] = hints
+
new_net = self.neutron.create_network({"network": network_dict})
# print new_net
# create subnetwork, even if there is no profile
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]}