summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
72d35a3)
Fixes bug 1572 by reading the neutron-availability-zone-hint from VIM
plugin configuration, which is then applied at network-creation time.
Note: this patch also fixes some formatting issues that black showed.
Change-Id: Iaf152657ae31748ea6b4a123e8b0a0d9513cb692
Signed-off-by: sousaedu <eduardo.sousa@canonical.com>
- """ Communicate with the DPB via SSH """
+ """Communicate with the DPB via SSH"""
__LOGGER_NAME_EXT = ".ssh"
__FUNCTION_MAP_POS = 1
__LOGGER_NAME_EXT = ".ssh"
__FUNCTION_MAP_POS = 1
- """ Communicate with the DPB via the REST API """
+ """Communicate with the DPB via the REST API"""
__LOGGER_NAME_EXT = ".rest"
__FUNCTION_MAP_POS = 0
__LOGGER_NAME_EXT = ".rest"
__FUNCTION_MAP_POS = 0
class DpbConnector(SdnConnectorBase):
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)"]
__LOGGER_NAME = "ro.sdn.dpb"
__SUPPORTED_SERV_TYPES = ["ELAN (L2)", "ELINE (L2)"]
connection_point["service_endpoint_encapsulation_type"]
== "dot1q"
):
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 = {}
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":
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 = {}
connection["encapsulation-type"] = "dot1q-vlan-tagged"
tagged = {}
tagged_interf = {}
- """ 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")
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("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
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):
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]}
try:
self._get_my_tenant()
new_image_dict = {"name": image_dict["name"][:64]}