Skip to content
Snippets Groups Projects
Commit 57fa1503 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Pre-merge code cleanup and addition of headers

parent b38dd2fa
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!104OpenConfig driver multivendor & ACLs
......@@ -20,7 +20,7 @@ def setup_config_rules(
service_uuid : str, connection_uuid : str, device_uuid : str, endpoint_uuid : str, endpoint_name : str,
service_settings : TreeNode, endpoint_settings : TreeNode, endpoint_acls : List [Tuple]
) -> List[Dict]:
if service_settings is None: return []
if endpoint_settings is None: return []
......@@ -112,7 +112,7 @@ def teardown_config_rules(
json_config_rules = [
json_config_rule_delete(
'/network_instance[{:s}]/connection_point[{:s}]'.format(network_instance_name, connection_point_id),
'/network_instance[{:s}]/connection_point[{:s}]'.format(network_instance_name, connection_point_id),
{'name': network_instance_name, 'connection_point': connection_point_id}),
json_config_rule_delete(
......
......@@ -43,7 +43,7 @@ def setup_config_rules(
vlan_id = json_endpoint_settings.get('vlan_id', 1 ) # 400
address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1'
address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30
if_subif_name = '{:s}.{:s}'.format(endpoint_name, str(vlan_id))
if_subif_name = '{:s}.{:d}'.format(endpoint_name, vlan_id)
json_config_rules = [
json_config_rule_set(
......@@ -163,7 +163,7 @@ def teardown_config_rules(
#address_ip = json_endpoint_settings.get('address_ip', '0.0.0.0') # '2.2.2.1'
#address_prefix = json_endpoint_settings.get('address_prefix', 24 ) # 30
if_subif_name = '{:s}.{:s}'.format(endpoint_name, vlan_id)
if_subif_name = '{:s}.{:d}'.format(endpoint_name, vlan_id)
service_short_uuid = service_uuid.split('-')[-1]
network_instance_name = '{:s}-NetInst'.format(service_short_uuid)
#network_interface_desc = '{:s}-NetIf'.format(service_uuid)
......
......@@ -12,17 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
from typing import Dict, List, Tuple
from common.tools.object_factory.ConfigRule import json_config_rule_delete, json_config_rule_set
from service.service.service_handler_api.AnyTreeTools import TreeNode
LOGGER = logging.getLogger(__name__)
def setup_config_rules(
service_uuid : str, connection_uuid : str, device_uuid : str, endpoint_uuid : str, endpoint_name : str,
service_settings : TreeNode, endpoint_settings : TreeNode, endpoint_acls : List [Tuple]
) -> List[Dict]:
if service_settings is None: return []
if endpoint_settings is None: return []
......@@ -50,7 +48,7 @@ def setup_config_rules(
#network_instance_name = '{:s}-NetInst'.format(service_short_uuid)
network_instance_name = json_endpoint_settings.get('ni_name', service_uuid.split('-')[-1]) #ELAN-AC:1
if_subif_name = '{:s}.{:s}'.format(endpoint_name, vlan_id)
if_subif_name = '{:s}.{:d}'.format(endpoint_name, vlan_id)
json_config_rules = [
# Configure Interface (not used)
......@@ -219,7 +217,7 @@ def teardown_config_rules(
policy_import = json_endpoint_settings.get('policy_AZ', '2' ) # 2
policy_export = json_endpoint_settings.get('policy_ZA', '7' ) # 30
if_subif_name = '{:s}.{:s}'.format(endpoint_name, vlan_id)
if_subif_name = '{:s}.{:d}'.format(endpoint_name, vlan_id)
json_config_rules = [
#Delete table connections
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment