diff --git a/.gitignore b/.gitignore index 38f7f9742f32..88a4174168ca 100644 --- a/.gitignore +++ b/.gitignore @@ -28,20 +28,6 @@ platform/*/docker-*/Dockerfile # Installer-related files and directories installer/x86_64/platforms/ -# Config engine -src/sonic-config-engine/**/*.pyc -src/sonic-config-engine/build -src/sonic-config-engine/sonic_config_engine.egg-info - -src/sonic-daemon-base/**/*.pyc -src/sonic-daemon-base/build -src/sonic-daemon-base/sonic_daemon_base.egg-info - -src/sonic-py-common/**/*.pyc -src/sonic-py-common/build -src/sonic-py-common/dist -src/sonic-py-common/sonic_py_common.egg-info - # Misc. files asic_config_checksum files/Aboot/boot0 @@ -74,3 +60,5 @@ platform/broadcom/sonic-platform-modules-dell/s6100/modules/dell_s6100_lpc.c platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_ich.c platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_mailbox.c platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/ipmihelper.py +platform/vs/docker-sonic-vs/init_cfg.json +platform/p4/docker-sonic-p4/init_cfg.json diff --git a/Makefile.work b/Makefile.work index 253d2039a9a4..99e8d85d1b24 100644 --- a/Makefile.work +++ b/Makefile.work @@ -38,6 +38,7 @@ # * SONIC_DPKG_CACHE_METHOD: Specifying method of obtaining the Debian packages from cache: none or cache # * SONIC_DPKG_CACHE_SOURCE: Debian package cache location when cache enabled for debian packages # * BUILD_LOG_TIMESTAMP: Set timestamp in the build log (simple/none) +# * ENABLE_SYNCHRONOUS_MODE: Enable synchronous mode between orchagent and syncd # ############################################################################### @@ -192,7 +193,6 @@ SONIC_BUILD_INSTRUCTION := make \ KUBERNETES_VERSION=$(KUBERNETES_VERSION) \ KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \ K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \ - K8s_CNI_FLANNEL_VERSION=$(K8s_CNI_FLANNEL_VERSION) \ SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \ SONIC_ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \ SONIC_INSTALL_DEBUG_TOOLS=$(INSTALL_DEBUG_TOOLS) \ @@ -213,6 +213,7 @@ SONIC_BUILD_INSTRUCTION := make \ EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \ BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \ + ENABLE_SYNCHRONOUS_MODE=$(ENABLE_SYNCHRONOUS_MODE) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset diff --git a/README.buildsystem.md b/README.buildsystem.md index f2d804d7e90f..44fa7e5ffffe 100644 --- a/README.buildsystem.md +++ b/README.buildsystem.md @@ -243,7 +243,7 @@ _Recommend: Rename image built using INSTALL_DEBUG_TOOLS=y to mark it explicit. * To debug a core file in non-SONiC environment that supports docker * `docker load -i docker--dbg.gz` * copy your unzipped core file into ~/debug - * `docker run -it -entrypoint=/bin/bash -v ~/debug:/debug ` + * `docker run -it --entrypoint=/bin/bash -v ~/debug:/debug ` * `gdb /usr/bin/ -c /debug/` ### Debug SONiC image diff --git a/README.md b/README.md index 6b943ff1dc39..9c80a3b2055c 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,11 @@ *master builds*: -[![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-all/badge/icon?subject=Innovium)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-all) + [![Barefoot](https://sonic-jenkins.westus2.cloudapp.azure.com/job/barefoot/job/buildimage-bf-all/badge/icon?subject=Barefoot)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/barefoot/job/buildimage-bf-all) [![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-all/badge/icon?subject=Broadcom)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-all) +[![Centec](https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-all/badge/icon?subject=Centec)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/centec/job/buildimage-centec-all) +[![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-all/badge/icon?subject=Innovium)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-all) [![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all/badge/icon?subject=Mellanox)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-all) [![Nephos](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-all/badge/icon?subject=Nephos)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-all) [![P4](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all/badge/icon?subject=P4)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/p4/job/buildimage-p4-all) @@ -14,18 +16,19 @@ *201911 builds*: -[![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201911/badge/icon?subject=Innovium)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201911/) [![Barefoot](https://sonic-jenkins.westus2.cloudapp.azure.com/job/barefoot/job/buildimage-bf-201911/badge/icon?subject=Barefoot)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/barefoot/job/buildimage-bf-201911/) [![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201911/badge/icon?subject=Broadcom)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201911/) +[![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201911/badge/icon?subject=Innovium)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201911/) [![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201911/badge/icon?subject=Mellanox)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201911/) [![Nephos](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-201911/badge/icon?subject=Nephos)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-201911) [![VS](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-201911/badge/icon?subject=VS)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-201911) *201811 builds*: -[![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201811/badge/icon?subject=Innovium)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201811/) + [![Broadcom](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201811/badge/icon?subject=Broadcom)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/broadcom/job/buildimage-brcm-201811/) [![Mellanox](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201811/badge/icon?subject=Mellanox)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/mellanox/job/buildimage-mlnx-201811/) +[![Innovium](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201811/badge/icon?subject=Innovium)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/innovium/job/buildimage-invm-201811/) [![Nephos](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-201811/badge/icon?subject=Nephos)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/nephos/job/buildimage-nephos-201811) [![VS](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-201811/badge/icon?subject=VS)](https://sonic-jenkins.westus2.cloudapp.azure.com/job/vs/job/buildimage-vs-201811) diff --git a/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py old mode 100644 new mode 100755 index 9cec97c44fb1..ea356bc9a328 --- a/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py +++ b/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py @@ -7,6 +7,7 @@ import time import os import sys, getopt + from ctypes import create_string_buffer from sonic_sfp.sfputilbase import SfpUtilBase except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -115,10 +116,65 @@ def get_presence(self, port_num): return False def get_low_power_mode(self, port_num): - raise NotImplementedError + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + eeprom = None + + if not self.get_presence(port_num): + return False + + eeprom = open(self.port_to_eeprom_mapping[port_num], "rb") + eeprom.seek(93) + lpmode = ord(eeprom.read(1)) + + if ((lpmode & 0x3) == 0x3): + return True # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 + else: + return False # High Power Mode if one of the following conditions is matched: + # 1. "Power override" bit is 0 + # 2. "Power override" bit is 1 and "Power set" bit is 0 + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) def set_low_power_mode(self, port_num, lpmode): - raise NotImplementedError + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + eeprom = None + + if not self.get_presence(port_num): + return False # Port is not present, unable to set the eeprom + + # Fill in write buffer + # 0x3:Low Power Mode. "Power override" bit is 1 and "Power set" bit is 1 + # 0x9:High Power Mode. "Power override" bit is 1 ,"Power set" bit is 0 and "High Power Class Enable" bit is 1 + regval = 0x3 if lpmode else 0x9 + + buffer = create_string_buffer(1) + buffer[0] = chr(regval) + + # Write to eeprom + eeprom = open(self.port_to_eeprom_mapping[port_num], "r+b") + eeprom.seek(93) + eeprom.write(buffer[0]) + return True + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) def reset(self, port_num): if port_num < self.port_start or port_num > self.port_end: diff --git a/device/barefoot/x86_64-accton_as9516bf_32d-r0/pmon_daemon_control.json b/device/barefoot/x86_64-accton_as9516bf_32d-r0/pmon_daemon_control.json index bee6a60418cf..c4573af5e93d 100644 --- a/device/barefoot/x86_64-accton_as9516bf_32d-r0/pmon_daemon_control.json +++ b/device/barefoot/x86_64-accton_as9516bf_32d-r0/pmon_daemon_control.json @@ -1,5 +1,5 @@ { - "skip_pcied": true, + "skip_pcied": false, "skip_fancontrol": true, "skip_thermalctld": true, "skip_ledd": true, diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json index f94fa8370273..70bce43bbf67 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json @@ -1,5 +1,5 @@ { - "skip_pcied": true, + "skip_pcied": false, "skip_fancontrol": true, "skip_thermalctld": true, "skip_ledd": true, diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700 deleted file mode 120000 index 9f12504c7c5a..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700 +++ /dev/null @@ -1 +0,0 @@ -ACS-MSN2700 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t0.j2 index a722094938f8..a1d24c418b3e 120000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t0.j2 @@ -1 +1 @@ -../ACS-MSN2700/buffers_defaults_t0.j2 \ No newline at end of file +../Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t1.j2 index b02d5e0194ac..bef0c9d9531c 120000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_t1.j2 @@ -1 +1 @@ -../ACS-MSN2700/buffers_defaults_t1.j2 \ No newline at end of file +../Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/pg_profile_lookup.ini index 229a556f88a8..40ad66c7356a 120000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/pg_profile_lookup.ini +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/pg_profile_lookup.ini @@ -1 +1 @@ -../ACS-MSN2700/pg_profile_lookup.ini \ No newline at end of file +../Mellanox-SN2700-D48C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 deleted file mode 120000 index a722094938f8..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN2700/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..f52b369bbbdf --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 @@ -0,0 +1,100 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '6687744' %} +{% set egress_lossless_pool_size = '13945824' %} +{% set egress_lossy_pool_size = '6687744' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + + diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 deleted file mode 120000 index b02d5e0194ac..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN2700/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..cd9e4aed3011 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 @@ -0,0 +1,100 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '8506368' %} +{% set egress_lossless_pool_size = '13945824' %} +{% set egress_lossy_pool_size = '8506368' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + + diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini deleted file mode 120000 index 229a556f88a8..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN2700/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini new file mode 100644 index 000000000000..15c12c1637e6 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 41984 19456 22528 0 + 25000 5m 41984 19456 22528 0 + 40000 5m 41984 19456 22528 0 + 50000 5m 41984 19456 22528 0 + 100000 5m 43008 19456 23552 0 + 10000 40m 41984 19456 22528 0 + 25000 40m 44032 19456 24576 0 + 40000 40m 45056 19456 25600 0 + 50000 40m 45056 19456 25600 0 + 100000 40m 49152 19456 29696 0 + 10000 300m 47104 19456 27648 0 + 25000 300m 56320 19456 36864 0 + 40000 300m 64512 19456 45056 0 + 50000 300m 69632 19456 50176 0 + 100000 300m 98304 19456 78848 0 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers.json.j2 new file mode 120000 index 000000000000..30c4e1d5bfdd --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers.json.j2 @@ -0,0 +1 @@ +../ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..012d77dbe479 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t0.j2 @@ -0,0 +1,100 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '9489408' %} +{% set egress_lossless_pool_size = '13945824' %} +{% set egress_lossy_pool_size = '9489408' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + + diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..de8c3a561919 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t1.j2 @@ -0,0 +1,100 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '7719936' %} +{% set egress_lossless_pool_size = '13945824' %} +{% set egress_lossy_pool_size = '7719936' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + + diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/pg_profile_lookup.ini new file mode 120000 index 000000000000..40ad66c7356a --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN2700-D48C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/port_config.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/port_config.ini new file mode 120000 index 000000000000..75904c159253 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/port_config.ini @@ -0,0 +1 @@ +../ACS-MSN2700/port_config.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/qos.json.j2 new file mode 120000 index 000000000000..8bd2d26567b8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/qos.json.j2 @@ -0,0 +1 @@ +../ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile new file mode 120000 index 000000000000..5d2c55d8bb44 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai.profile @@ -0,0 +1 @@ +../ACS-MSN2700/sai.profile \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai_2700.xml b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai_2700.xml new file mode 120000 index 000000000000..7f7b65fc6a21 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/sai_2700.xml @@ -0,0 +1 @@ +../ACS-MSN2700/sai_2700.xml \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64 deleted file mode 120000 index 65b8f3c8ec9d..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64 +++ /dev/null @@ -1 +0,0 @@ -ACS-MSN3800/ \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..53fa14be9027 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +../Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..ad442959ddca --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +../Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/pg_profile_lookup.ini new file mode 120000 index 000000000000..ccbbfa44cd9c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN3800-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/port_config.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/port_config.ini new file mode 120000 index 000000000000..3302c4ce12d8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/port_config.ini @@ -0,0 +1 @@ +../ACS-MSN3800/port_config.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile new file mode 120000 index 000000000000..f6fb0ccbfc97 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile @@ -0,0 +1 @@ +../ACS-MSN3800/sai.profile \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai_3800.xml b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai_3800.xml new file mode 120000 index 000000000000..686d6298865c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai_3800.xml @@ -0,0 +1 @@ +../ACS-MSN3800/sai_3800.xml \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 deleted file mode 120000 index 0987f6724863..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN3800/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..5296eb8ede88 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 @@ -0,0 +1,98 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '28856320' %} +{% set egress_lossless_pool_size = '34287552' %} +{% set egress_lossy_pool_size = '28856320' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 deleted file mode 120000 index 119460bfa556..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN3800/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..95b119a59f97 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 @@ -0,0 +1,98 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '27586560' %} +{% set egress_lossless_pool_size = '34287552' %} +{% set egress_lossy_pool_size = '27586560' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0, 32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} + } +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini deleted file mode 120000 index db2f74508aad..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN3800/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini new file mode 100644 index 000000000000..ea772d0823a1 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 45056 19456 25600 0 + 25000 5m 48128 19456 28672 0 + 40000 5m 50176 19456 30720 0 + 50000 5m 52224 19456 32768 0 + 100000 5m 60416 19456 40960 0 + 10000 40m 46080 19456 26624 0 + 25000 40m 50176 19456 30720 0 + 40000 40m 53248 19456 33792 0 + 50000 40m 56320 19456 36864 0 + 100000 40m 67584 19456 48128 0 + 10000 300m 51200 19456 31744 0 + 25000 300m 63488 19456 44032 0 + 40000 300m 74752 19456 55296 0 + 50000 300m 82944 19456 63488 0 + 100000 300m 121856 19456 102400 0 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 index 0987f6724863..53fa14be9027 120000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 @@ -1 +1 @@ -../ACS-MSN3800/buffers_defaults_t0.j2 \ No newline at end of file +../Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 index 119460bfa556..ad442959ddca 120000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 @@ -1 +1 @@ -../ACS-MSN3800/buffers_defaults_t1.j2 \ No newline at end of file +../Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/pg_profile_lookup.ini index db2f74508aad..ccbbfa44cd9c 120000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/pg_profile_lookup.ini +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/pg_profile_lookup.ini @@ -1 +1 @@ -../ACS-MSN3800/pg_profile_lookup.ini \ No newline at end of file +../Mellanox-SN3800-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 index 0987f6724863..53fa14be9027 120000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 @@ -1 +1 @@ -../ACS-MSN3800/buffers_defaults_t0.j2 \ No newline at end of file +../Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 index 119460bfa556..ad442959ddca 120000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 @@ -1 +1 @@ -../ACS-MSN3800/buffers_defaults_t1.j2 \ No newline at end of file +../Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/pg_profile_lookup.ini index db2f74508aad..ccbbfa44cd9c 120000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/pg_profile_lookup.ini +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/pg_profile_lookup.ini @@ -1 +1 @@ -../ACS-MSN3800/pg_profile_lookup.ini \ No newline at end of file +../Mellanox-SN3800-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 index ab9cdd8c00c3..5622c0cbef29 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 @@ -1,7 +1,7 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '57499648' %} +{% set ingress_lossless_pool_size = '56369152' %} {% set egress_lossless_pool_size = '60817392' %} -{% set egress_lossy_pool_size = '57499648' %} +{% set egress_lossy_pool_size = '56369152' %} {%- macro generate_port_lists(PORT_ALL) %} {# Generate list of ports #} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 index d47117501be1..186b965f1ee4 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 @@ -1,7 +1,7 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '52363264' %} +{% set ingress_lossless_pool_size = '55115776' %} {% set egress_lossless_pool_size = '60817392' %} -{% set egress_lossy_pool_size = '52363264' %} +{% set egress_lossy_pool_size = '55115776' %} {%- macro generate_port_lists(PORT_ALL) %} {# Generate list of ports #} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini deleted file mode 120000 index dc307e1020f5..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN4600C/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini new file mode 100644 index 000000000000..ab397d98de54 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 44032 19456 24576 0 + 25000 5m 44032 19456 24576 0 + 40000 5m 44032 19456 24576 0 + 50000 5m 44032 19456 24576 0 + 100000 5m 45056 19456 25600 0 + 10000 40m 44032 19456 24576 0 + 25000 40m 46080 19456 26624 0 + 40000 40m 47104 19456 27648 0 + 50000 40m 48128 19456 28672 0 + 100000 40m 52224 19456 32768 0 + 10000 300m 50176 19456 30720 0 + 25000 300m 59392 19456 39936 0 + 40000 300m 68608 19456 49152 0 + 50000 300m 74752 19456 55296 0 + 100000 300m 105472 19456 86016 0 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/0/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/0/port_config.ini index 95cf5eec9e4e..3ec90708cc05 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/0/port_config.ini +++ b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/0/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias index speed -Ethernet0 25,26,27,28 fortyGigE0/0 0 40000 -Ethernet4 29,30,31,32 fortyGigE0/4 1 40000 -Ethernet8 33,34,35,36 fortyGigE0/8 2 40000 -Ethernet12 37,38,39,40 fortyGigE0/12 3 40000 -Ethernet16 45,46,47,48 fortyGigE0/16 4 40000 -Ethernet20 41,42,43,44 fortyGigE0/20 5 40000 -Ethernet24 1,2,3,4 fortyGigE0/24 6 40000 -Ethernet28 5,6,7,8 fortyGigE0/28 7 40000 -Ethernet32 13,14,15,16 fortyGigE0/32 8 40000 -Ethernet36 9,10,11,12 fortyGigE0/36 9 40000 -Ethernet40 17,18,19,20 fortyGigE0/40 10 40000 -Ethernet44 21,22,23,24 fortyGigE0/44 11 40000 -Ethernet48 53,54,55,56 fortyGigE0/48 12 40000 -Ethernet52 49,50,51,52 fortyGigE0/52 13 40000 -Ethernet56 57,58,59,60 fortyGigE0/56 14 40000 -Ethernet60 61,62,63,64 fortyGigE0/60 15 40000 -Ethernet64 69,70,71,72 fortyGigE0/64 16 40000 -Ethernet68 65,66,67,68 fortyGigE0/68 17 40000 -Ethernet72 73,74,75,76 fortyGigE0/72 18 40000 -Ethernet76 77,78,79,80 fortyGigE0/76 19 40000 -Ethernet80 109,110,111,112 fortyGigE0/80 20 40000 -Ethernet84 105,106,107,108 fortyGigE0/84 21 40000 -Ethernet88 113,114,115,116 fortyGigE0/88 22 40000 -Ethernet92 117,118,119,120 fortyGigE0/92 23 40000 -Ethernet96 125,126,127,128 fortyGigE0/96 24 40000 -Ethernet100 121,122,123,124 fortyGigE0/100 25 40000 -Ethernet104 81,82,83,84 fortyGigE0/104 26 40000 -Ethernet108 85,86,87,88 fortyGigE0/108 27 40000 -Ethernet112 93,94,95,96 fortyGigE0/112 28 40000 -Ethernet116 89,90,91,92 fortyGigE0/116 29 40000 -Ethernet120 101,102,103,104 fortyGigE0/120 30 40000 -Ethernet124 97,98,99,100 fortyGigE0/124 31 40000 +# name lanes alias index asic_port_name role speed +Ethernet0 25,26,27,28 Ethernet1/1 0 Eth0-ASIC0 Ext 40000 +Ethernet4 29,30,31,32 Ethernet1/2 1 Eth1-ASIC0 Ext 40000 +Ethernet8 33,34,35,36 Ethernet1/3 2 Eth2-ASIC0 Ext 40000 +Ethernet12 37,38,39,40 Ethernet1/4 3 Eth3-ASIC0 Ext 40000 +Ethernet16 45,46,47,48 Ethernet1/5 4 Eth4-ASIC0 Ext 40000 +Ethernet20 41,42,43,44 Ethernet1/6 5 Eth5-ASIC0 Ext 40000 +Ethernet24 1,2,3,4 Ethernet1/7 6 Eth6-ASIC0 Ext 40000 +Ethernet28 5,6,7,8 Ethernet1/8 7 Eth7-ASIC0 Ext 40000 +Ethernet32 13,14,15,16 Ethernet1/9 8 Eth8-ASIC0 Ext 40000 +Ethernet36 9,10,11,12 Ethernet1/10 9 Eth9-ASIC0 Ext 40000 +Ethernet40 17,18,19,20 Ethernet1/11 10 Eth10-ASIC0 Ext 40000 +Ethernet44 21,22,23,24 Ethernet1/12 11 Eth11-ASIC0 Ext 40000 +Ethernet48 53,54,55,56 Ethernet1/13 12 Eth12-ASIC0 Ext 40000 +Ethernet52 49,50,51,52 Ethernet1/14 13 Eth13-ASIC0 Ext 40000 +Ethernet56 57,58,59,60 Ethernet1/15 14 Eth14-ASIC0 Ext 40000 +Ethernet60 61,62,63,64 Ethernet1/16 15 Eth15-ASIC0 Ext 40000 +Ethernet-BP0 69,70,71,72 Eth16-ASIC0 0 Eth16-ASIC0 Int 40000 +Ethernet-BP4 65,66,67,68 Eth17-ASIC0 1 Eth17-ASIC0 Int 40000 +Ethernet-BP8 73,74,75,76 Eth18-ASIC0 2 Eth18-ASIC0 Int 40000 +Ethernet-BP12 77,78,79,80 Eth19-ASIC0 3 Eth19-ASIC0 Int 40000 +Ethernet-BP16 109,110,111,112 Eth20-ASIC0 4 Eth20-ASIC0 Int 40000 +Ethernet-BP20 105,106,107,108 Eth21-ASIC0 5 Eth21-ASIC0 Int 40000 +Ethernet-BP24 113,114,115,116 Eth22-ASIC0 6 Eth22-ASIC0 Int 40000 +Ethernet-BP28 117,118,119,120 Eth23-ASIC0 7 Eth23-ASIC0 Int 40000 +Ethernet-BP32 125,126,127,128 Eth24-ASIC0 8 Eth24-ASIC0 Int 40000 +Ethernet-BP36 121,122,123,124 Eth25-ASIC0 9 Eth25-ASIC0 Int 40000 +Ethernet-BP40 81,82,83,84 Eth26-ASIC0 10 Eth26-ASIC0 Int 40000 +Ethernet-BP44 85,86,87,88 Eth27-ASIC0 11 Eth27-ASIC0 Int 40000 +Ethernet-BP48 93,94,95,96 Eth28-ASIC0 12 Eth28-ASIC0 Int 40000 +Ethernet-BP52 89,90,91,92 Eth29-ASIC0 13 Eth29-ASIC0 Int 40000 +Ethernet-BP56 101,102,103,104 Eth30-ASIC0 14 Eth30-ASIC0 Int 40000 +Ethernet-BP60 97,98,99,100 Eth31-ASIC0 15 Eth31-ASIC0 Int 40000 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/1/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/1/port_config.ini index 95cf5eec9e4e..61d38693526e 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/1/port_config.ini +++ b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/1/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias index speed -Ethernet0 25,26,27,28 fortyGigE0/0 0 40000 -Ethernet4 29,30,31,32 fortyGigE0/4 1 40000 -Ethernet8 33,34,35,36 fortyGigE0/8 2 40000 -Ethernet12 37,38,39,40 fortyGigE0/12 3 40000 -Ethernet16 45,46,47,48 fortyGigE0/16 4 40000 -Ethernet20 41,42,43,44 fortyGigE0/20 5 40000 -Ethernet24 1,2,3,4 fortyGigE0/24 6 40000 -Ethernet28 5,6,7,8 fortyGigE0/28 7 40000 -Ethernet32 13,14,15,16 fortyGigE0/32 8 40000 -Ethernet36 9,10,11,12 fortyGigE0/36 9 40000 -Ethernet40 17,18,19,20 fortyGigE0/40 10 40000 -Ethernet44 21,22,23,24 fortyGigE0/44 11 40000 -Ethernet48 53,54,55,56 fortyGigE0/48 12 40000 -Ethernet52 49,50,51,52 fortyGigE0/52 13 40000 -Ethernet56 57,58,59,60 fortyGigE0/56 14 40000 -Ethernet60 61,62,63,64 fortyGigE0/60 15 40000 -Ethernet64 69,70,71,72 fortyGigE0/64 16 40000 -Ethernet68 65,66,67,68 fortyGigE0/68 17 40000 -Ethernet72 73,74,75,76 fortyGigE0/72 18 40000 -Ethernet76 77,78,79,80 fortyGigE0/76 19 40000 -Ethernet80 109,110,111,112 fortyGigE0/80 20 40000 -Ethernet84 105,106,107,108 fortyGigE0/84 21 40000 -Ethernet88 113,114,115,116 fortyGigE0/88 22 40000 -Ethernet92 117,118,119,120 fortyGigE0/92 23 40000 -Ethernet96 125,126,127,128 fortyGigE0/96 24 40000 -Ethernet100 121,122,123,124 fortyGigE0/100 25 40000 -Ethernet104 81,82,83,84 fortyGigE0/104 26 40000 -Ethernet108 85,86,87,88 fortyGigE0/108 27 40000 -Ethernet112 93,94,95,96 fortyGigE0/112 28 40000 -Ethernet116 89,90,91,92 fortyGigE0/116 29 40000 -Ethernet120 101,102,103,104 fortyGigE0/120 30 40000 -Ethernet124 97,98,99,100 fortyGigE0/124 31 40000 +# name lanes alias index asic_port_name role speed +Ethernet64 25,26,27,28 Ethernet1/17 16 Eth0-ASIC1 Ext 40000 +Ethernet68 29,30,31,32 Ethernet1/18 17 Eth1-ASIC1 Ext 40000 +Ethernet72 33,34,35,36 Ethernet1/19 18 Eth2-ASIC1 Ext 40000 +Ethernet76 37,38,39,40 Ethernet1/20 19 Eth3-ASIC1 Ext 40000 +Ethernet80 45,46,47,48 Ethernet1/21 20 Eth4-ASIC1 Ext 40000 +Ethernet84 41,42,43,44 Ethernet1/22 21 Eth5-ASIC1 Ext 40000 +Ethernet88 1,2,3,4 Ethernet1/23 22 Eth6-ASIC1 Ext 40000 +Ethernet92 5,6,7,8 Ethernet1/24 23 Eth7-ASIC1 Ext 40000 +Ethernet96 13,14,15,16 Ethernet1/25 24 Eth8-ASIC1 Ext 40000 +Ethernet100 9,10,11,12 Ethernet1/26 25 Eth9-ASIC1 Ext 40000 +Ethernet104 17,18,19,20 Ethernet1/27 26 Eth10-ASIC1 Ext 40000 +Ethernet108 21,22,23,24 Ethernet1/28 27 Eth11-ASIC1 Ext 40000 +Ethernet112 53,54,55,56 Ethernet1/29 28 Eth12-ASIC1 Ext 40000 +Ethernet116 49,50,51,52 Ethernet1/30 29 Eth13-ASIC1 Ext 40000 +Ethernet120 57,58,59,60 Ethernet1/31 30 Eth14-ASIC1 Ext 40000 +Ethernet124 61,62,63,64 Ethernet1/32 31 Eth15-ASIC1 Ext 40000 +Ethernet-BP64 69,70,71,72 Eth16-ASIC1 16 Eth16-ASIC1 Int 40000 +Ethernet-BP68 65,66,67,68 Eth17-ASIC1 17 Eth17-ASIC1 Int 40000 +Ethernet-BP72 73,74,75,76 Eth18-ASIC1 18 Eth18-ASIC1 Int 40000 +Ethernet-BP76 77,78,79,80 Eth19-ASIC1 19 Eth19-ASIC1 Int 40000 +Ethernet-BP80 109,110,111,112 Eth20-ASIC1 20 Eth20-ASIC1 Int 40000 +Ethernet-BP84 105,106,107,108 Eth21-ASIC1 21 Eth21-ASIC1 Int 40000 +Ethernet-BP88 113,114,115,116 Eth22-ASIC1 22 Eth22-ASIC1 Int 40000 +Ethernet-BP92 117,118,119,120 Eth23-ASIC1 23 Eth23-ASIC1 Int 40000 +Ethernet-BP96 125,126,127,128 Eth24-ASIC1 24 Eth24-ASIC1 Int 40000 +Ethernet-BP100 121,122,123,124 Eth25-ASIC1 25 Eth25-ASIC1 Int 40000 +Ethernet-BP104 81,82,83,84 Eth26-ASIC1 26 Eth26-ASIC1 Int 40000 +Ethernet-BP108 85,86,87,88 Eth27-ASIC1 27 Eth27-ASIC1 Int 40000 +Ethernet-BP112 93,94,95,96 Eth28-ASIC1 28 Eth28-ASIC1 Int 40000 +Ethernet-BP116 89,90,91,92 Eth29-ASIC1 29 Eth29-ASIC1 Int 40000 +Ethernet-BP120 101,102,103,104 Eth30-ASIC1 30 Eth30-ASIC1 Int 40000 +Ethernet-BP124 97,98,99,100 Eth31-ASIC1 31 Eth31-ASIC1 Int 40000 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/2/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/2/port_config.ini index 95cf5eec9e4e..af8a37f09549 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/2/port_config.ini +++ b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/2/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias index speed -Ethernet0 25,26,27,28 fortyGigE0/0 0 40000 -Ethernet4 29,30,31,32 fortyGigE0/4 1 40000 -Ethernet8 33,34,35,36 fortyGigE0/8 2 40000 -Ethernet12 37,38,39,40 fortyGigE0/12 3 40000 -Ethernet16 45,46,47,48 fortyGigE0/16 4 40000 -Ethernet20 41,42,43,44 fortyGigE0/20 5 40000 -Ethernet24 1,2,3,4 fortyGigE0/24 6 40000 -Ethernet28 5,6,7,8 fortyGigE0/28 7 40000 -Ethernet32 13,14,15,16 fortyGigE0/32 8 40000 -Ethernet36 9,10,11,12 fortyGigE0/36 9 40000 -Ethernet40 17,18,19,20 fortyGigE0/40 10 40000 -Ethernet44 21,22,23,24 fortyGigE0/44 11 40000 -Ethernet48 53,54,55,56 fortyGigE0/48 12 40000 -Ethernet52 49,50,51,52 fortyGigE0/52 13 40000 -Ethernet56 57,58,59,60 fortyGigE0/56 14 40000 -Ethernet60 61,62,63,64 fortyGigE0/60 15 40000 -Ethernet64 69,70,71,72 fortyGigE0/64 16 40000 -Ethernet68 65,66,67,68 fortyGigE0/68 17 40000 -Ethernet72 73,74,75,76 fortyGigE0/72 18 40000 -Ethernet76 77,78,79,80 fortyGigE0/76 19 40000 -Ethernet80 109,110,111,112 fortyGigE0/80 20 40000 -Ethernet84 105,106,107,108 fortyGigE0/84 21 40000 -Ethernet88 113,114,115,116 fortyGigE0/88 22 40000 -Ethernet92 117,118,119,120 fortyGigE0/92 23 40000 -Ethernet96 125,126,127,128 fortyGigE0/96 24 40000 -Ethernet100 121,122,123,124 fortyGigE0/100 25 40000 -Ethernet104 81,82,83,84 fortyGigE0/104 26 40000 -Ethernet108 85,86,87,88 fortyGigE0/108 27 40000 -Ethernet112 93,94,95,96 fortyGigE0/112 28 40000 -Ethernet116 89,90,91,92 fortyGigE0/116 29 40000 -Ethernet120 101,102,103,104 fortyGigE0/120 30 40000 -Ethernet124 97,98,99,100 fortyGigE0/124 31 40000 +# name lanes alias index asic_port_name role speed +Ethernet128 25,26,27,28 Ethernet1/33 32 Eth0-ASIC2 Ext 40000 +Ethernet132 29,30,31,32 Ethernet1/34 33 Eth1-ASIC2 Ext 40000 +Ethernet136 33,34,35,36 Ethernet1/35 34 Eth2-ASIC2 Ext 40000 +Ethernet140 37,38,39,40 Ethernet1/36 35 Eth3-ASIC2 Ext 40000 +Ethernet144 45,46,47,48 Ethernet1/37 36 Eth4-ASIC2 Ext 40000 +Ethernet148 41,42,43,44 Ethernet1/38 37 Eth5-ASIC2 Ext 40000 +Ethernet152 1,2,3,4 Ethernet1/39 38 Eth6-ASIC2 Ext 40000 +Ethernet156 5,6,7,8 Ethernet1/40 39 Eth7-ASIC2 Ext 40000 +Ethernet160 13,14,15,16 Ethernet1/41 40 Eth8-ASIC2 Ext 40000 +Ethernet164 9,10,11,12 Ethernet1/42 41 Eth9-ASIC2 Ext 40000 +Ethernet168 17,18,19,20 Ethernet1/43 42 Eth10-ASIC2 Ext 40000 +Ethernet172 21,22,23,24 Ethernet1/44 43 Eth11-ASIC2 Ext 40000 +Ethernet176 53,54,55,56 Ethernet1/45 44 Eth12-ASIC2 Ext 40000 +Ethernet180 49,50,51,52 Ethernet1/46 45 Eth13-ASIC2 Ext 40000 +Ethernet184 57,58,59,60 Ethernet1/47 46 Eth14-ASIC2 Ext 40000 +Ethernet188 61,62,63,64 Ethernet1/48 47 Eth15-ASIC2 Ext 40000 +Ethernet-BP128 69,70,71,72 Eth16-ASIC2 32 Eth16-ASIC2 Int 40000 +Ethernet-BP132 65,66,67,68 Eth17-ASIC2 33 Eth17-ASIC2 Int 40000 +Ethernet-BP136 73,74,75,76 Eth18-ASIC2 34 Eth18-ASIC2 Int 40000 +Ethernet-BP140 77,78,79,80 Eth19-ASIC2 35 Eth19-ASIC2 Int 40000 +Ethernet-BP144 109,110,111,112 Eth20-ASIC2 36 Eth20-ASIC2 Int 40000 +Ethernet-BP148 105,106,107,108 Eth21-ASIC2 37 Eth21-ASIC2 Int 40000 +Ethernet-BP152 113,114,115,116 Eth22-ASIC2 38 Eth22-ASIC2 Int 40000 +Ethernet-BP156 117,118,119,120 Eth23-ASIC2 39 Eth23-ASIC2 Int 40000 +Ethernet-BP160 125,126,127,128 Eth24-ASIC2 40 Eth24-ASIC2 Int 40000 +Ethernet-BP164 121,122,123,124 Eth25-ASIC2 41 Eth25-ASIC2 Int 40000 +Ethernet-BP168 81,82,83,84 Eth26-ASIC2 42 Eth26-ASIC2 Int 40000 +Ethernet-BP172 85,86,87,88 Eth27-ASIC2 43 Eth27-ASIC2 Int 40000 +Ethernet-BP176 93,94,95,96 Eth28-ASIC2 44 Eth28-ASIC2 Int 40000 +Ethernet-BP180 89,90,91,92 Eth29-ASIC2 45 Eth29-ASIC2 Int 40000 +Ethernet-BP184 101,102,103,104 Eth30-ASIC2 46 Eth30-ASIC2 Int 40000 +Ethernet-BP188 97,98,99,100 Eth31-ASIC2 47 Eth31-ASIC2 Int 40000 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/3/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/3/port_config.ini index 95cf5eec9e4e..6e10b45cbc4c 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/3/port_config.ini +++ b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/3/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias index speed -Ethernet0 25,26,27,28 fortyGigE0/0 0 40000 -Ethernet4 29,30,31,32 fortyGigE0/4 1 40000 -Ethernet8 33,34,35,36 fortyGigE0/8 2 40000 -Ethernet12 37,38,39,40 fortyGigE0/12 3 40000 -Ethernet16 45,46,47,48 fortyGigE0/16 4 40000 -Ethernet20 41,42,43,44 fortyGigE0/20 5 40000 -Ethernet24 1,2,3,4 fortyGigE0/24 6 40000 -Ethernet28 5,6,7,8 fortyGigE0/28 7 40000 -Ethernet32 13,14,15,16 fortyGigE0/32 8 40000 -Ethernet36 9,10,11,12 fortyGigE0/36 9 40000 -Ethernet40 17,18,19,20 fortyGigE0/40 10 40000 -Ethernet44 21,22,23,24 fortyGigE0/44 11 40000 -Ethernet48 53,54,55,56 fortyGigE0/48 12 40000 -Ethernet52 49,50,51,52 fortyGigE0/52 13 40000 -Ethernet56 57,58,59,60 fortyGigE0/56 14 40000 -Ethernet60 61,62,63,64 fortyGigE0/60 15 40000 -Ethernet64 69,70,71,72 fortyGigE0/64 16 40000 -Ethernet68 65,66,67,68 fortyGigE0/68 17 40000 -Ethernet72 73,74,75,76 fortyGigE0/72 18 40000 -Ethernet76 77,78,79,80 fortyGigE0/76 19 40000 -Ethernet80 109,110,111,112 fortyGigE0/80 20 40000 -Ethernet84 105,106,107,108 fortyGigE0/84 21 40000 -Ethernet88 113,114,115,116 fortyGigE0/88 22 40000 -Ethernet92 117,118,119,120 fortyGigE0/92 23 40000 -Ethernet96 125,126,127,128 fortyGigE0/96 24 40000 -Ethernet100 121,122,123,124 fortyGigE0/100 25 40000 -Ethernet104 81,82,83,84 fortyGigE0/104 26 40000 -Ethernet108 85,86,87,88 fortyGigE0/108 27 40000 -Ethernet112 93,94,95,96 fortyGigE0/112 28 40000 -Ethernet116 89,90,91,92 fortyGigE0/116 29 40000 -Ethernet120 101,102,103,104 fortyGigE0/120 30 40000 -Ethernet124 97,98,99,100 fortyGigE0/124 31 40000 +# name lanes alias index asic_port_name role speed +Ethernet192 25,26,27,28 Ethernet1/49 48 Eth0-ASIC3 Ext 40000 +Ethernet196 29,30,31,32 Ethernet1/50 49 Eth1-ASIC3 Ext 40000 +Ethernet200 33,34,35,36 Ethernet1/51 50 Eth2-ASIC3 Ext 40000 +Ethernet204 37,38,39,40 Ethernet1/52 51 Eth3-ASIC3 Ext 40000 +Ethernet208 45,46,47,48 Ethernet1/53 52 Eth4-ASIC3 Ext 40000 +Ethernet212 41,42,43,44 Ethernet1/54 53 Eth5-ASIC3 Ext 40000 +Ethernet216 1,2,3,4 Ethernet1/55 54 Eth6-ASIC3 Ext 40000 +Ethernet220 5,6,7,8 Ethernet1/56 55 Eth7-ASIC3 Ext 40000 +Ethernet224 13,14,15,16 Ethernet1/57 56 Eth8-ASIC3 Ext 40000 +Ethernet228 9,10,11,12 Ethernet1/58 57 Eth9-ASIC3 Ext 40000 +Ethernet232 17,18,19,20 Ethernet1/59 58 Eth10-ASIC3 Ext 40000 +Ethernet236 21,22,23,24 Ethernet1/60 59 Eth11-ASIC3 Ext 40000 +Ethernet240 53,54,55,56 Ethernet1/61 60 Eth12-ASIC3 Ext 40000 +Ethernet244 49,50,51,52 Ethernet1/62 61 Eth13-ASIC3 Ext 40000 +Ethernet248 57,58,59,60 Ethernet1/63 62 Eth14-ASIC3 Ext 40000 +Ethernet252 61,62,63,64 Ethernet1/64 63 Eth15-ASIC3 Ext 40000 +Ethernet-BP192 69,70,71,72 Eth16-ASIC3 48 Eth16-ASIC3 Int 40000 +Ethernet-BP196 65,66,67,68 Eth17-ASIC3 49 Eth17-ASIC3 Int 40000 +Ethernet-BP200 73,74,75,76 Eth18-ASIC3 50 Eth18-ASIC3 Int 40000 +Ethernet-BP204 77,78,79,80 Eth19-ASIC3 51 Eth19-ASIC3 Int 40000 +Ethernet-BP208 109,110,111,112 Eth20-ASIC3 52 Eth20-ASIC3 Int 40000 +Ethernet-BP212 105,106,107,108 Eth21-ASIC3 53 Eth21-ASIC3 Int 40000 +Ethernet-BP216 113,114,115,116 Eth22-ASIC3 54 Eth22-ASIC3 Int 40000 +Ethernet-BP220 117,118,119,120 Eth23-ASIC3 55 Eth23-ASIC3 Int 40000 +Ethernet-BP224 125,126,127,128 Eth24-ASIC3 56 Eth24-ASIC3 Int 40000 +Ethernet-BP228 121,122,123,124 Eth25-ASIC3 57 Eth25-ASIC3 Int 40000 +Ethernet-BP232 81,82,83,84 Eth26-ASIC3 58 Eth26-ASIC3 Int 40000 +Ethernet-BP236 85,86,87,88 Eth27-ASIC3 59 Eth27-ASIC3 Int 40000 +Ethernet-BP240 93,94,95,96 Eth28-ASIC3 60 Eth28-ASIC3 Int 40000 +Ethernet-BP244 89,90,91,92 Eth29-ASIC3 61 Eth29-ASIC3 Int 40000 +Ethernet-BP248 101,102,103,104 Eth30-ASIC3 62 Eth30-ASIC3 Int 40000 +Ethernet-BP252 97,98,99,100 Eth31-ASIC3 63 Eth31-ASIC3 Int 40000 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/4/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/4/port_config.ini index 95cf5eec9e4e..f6b9ccf3da98 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/4/port_config.ini +++ b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/4/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias index speed -Ethernet0 25,26,27,28 fortyGigE0/0 0 40000 -Ethernet4 29,30,31,32 fortyGigE0/4 1 40000 -Ethernet8 33,34,35,36 fortyGigE0/8 2 40000 -Ethernet12 37,38,39,40 fortyGigE0/12 3 40000 -Ethernet16 45,46,47,48 fortyGigE0/16 4 40000 -Ethernet20 41,42,43,44 fortyGigE0/20 5 40000 -Ethernet24 1,2,3,4 fortyGigE0/24 6 40000 -Ethernet28 5,6,7,8 fortyGigE0/28 7 40000 -Ethernet32 13,14,15,16 fortyGigE0/32 8 40000 -Ethernet36 9,10,11,12 fortyGigE0/36 9 40000 -Ethernet40 17,18,19,20 fortyGigE0/40 10 40000 -Ethernet44 21,22,23,24 fortyGigE0/44 11 40000 -Ethernet48 53,54,55,56 fortyGigE0/48 12 40000 -Ethernet52 49,50,51,52 fortyGigE0/52 13 40000 -Ethernet56 57,58,59,60 fortyGigE0/56 14 40000 -Ethernet60 61,62,63,64 fortyGigE0/60 15 40000 -Ethernet64 69,70,71,72 fortyGigE0/64 16 40000 -Ethernet68 65,66,67,68 fortyGigE0/68 17 40000 -Ethernet72 73,74,75,76 fortyGigE0/72 18 40000 -Ethernet76 77,78,79,80 fortyGigE0/76 19 40000 -Ethernet80 109,110,111,112 fortyGigE0/80 20 40000 -Ethernet84 105,106,107,108 fortyGigE0/84 21 40000 -Ethernet88 113,114,115,116 fortyGigE0/88 22 40000 -Ethernet92 117,118,119,120 fortyGigE0/92 23 40000 -Ethernet96 125,126,127,128 fortyGigE0/96 24 40000 -Ethernet100 121,122,123,124 fortyGigE0/100 25 40000 -Ethernet104 81,82,83,84 fortyGigE0/104 26 40000 -Ethernet108 85,86,87,88 fortyGigE0/108 27 40000 -Ethernet112 93,94,95,96 fortyGigE0/112 28 40000 -Ethernet116 89,90,91,92 fortyGigE0/116 29 40000 -Ethernet120 101,102,103,104 fortyGigE0/120 30 40000 -Ethernet124 97,98,99,100 fortyGigE0/124 31 40000 +# name lanes alias index asic_port_name role speed +Ethernet-BP256 25,26,27,28 Eth0-ASIC4 64 Eth0-ASIC4 Int 40000 +Ethernet-BP260 29,30,31,32 Eth1-ASIC4 65 Eth1-ASIC4 Int 40000 +Ethernet-BP264 33,34,35,36 Eth2-ASIC4 66 Eth2-ASIC4 Int 40000 +Ethernet-BP268 37,38,39,40 Eth3-ASIC4 67 Eth3-ASIC4 Int 40000 +Ethernet-BP272 45,46,47,48 Eth4-ASIC4 68 Eth4-ASIC4 Int 40000 +Ethernet-BP276 41,42,43,44 Eth5-ASIC4 69 Eth5-ASIC4 Int 40000 +Ethernet-BP280 1,2,3,4 Eth6-ASIC4 70 Eth6-ASIC4 Int 40000 +Ethernet-BP284 5,6,7,8 Eth7-ASIC4 71 Eth7-ASIC4 Int 40000 +Ethernet-BP288 13,14,15,16 Eth8-ASIC4 72 Eth8-ASIC4 Int 40000 +Ethernet-BP292 9,10,11,12 Eth9-ASIC4 73 Eth9-ASIC4 Int 40000 +Ethernet-BP296 17,18,19,20 Eth10-ASIC4 74 Eth10-ASIC4 Int 40000 +Ethernet-BP300 21,22,23,24 Eth11-ASIC4 75 Eth11-ASIC4 Int 40000 +Ethernet-BP304 53,54,55,56 Eth12-ASIC4 76 Eth12-ASIC4 Int 40000 +Ethernet-BP308 49,50,51,52 Eth13-ASIC4 77 Eth13-ASIC4 Int 40000 +Ethernet-BP312 57,58,59,60 Eth14-ASIC4 78 Eth14-ASIC4 Int 40000 +Ethernet-BP316 61,62,63,64 Eth15-ASIC4 79 Eth15-ASIC4 Int 40000 +Ethernet-BP320 69,70,71,72 Eth16-ASIC4 80 Eth16-ASIC4 Int 40000 +Ethernet-BP324 65,66,67,68 Eth17-ASIC4 81 Eth17-ASIC4 Int 40000 +Ethernet-BP328 73,74,75,76 Eth18-ASIC4 82 Eth18-ASIC4 Int 40000 +Ethernet-BP332 77,78,79,80 Eth19-ASIC4 83 Eth19-ASIC4 Int 40000 +Ethernet-BP336 109,110,111,112 Eth20-ASIC4 84 Eth20-ASIC4 Int 40000 +Ethernet-BP340 105,106,107,108 Eth21-ASIC4 85 Eth21-ASIC4 Int 40000 +Ethernet-BP344 113,114,115,116 Eth22-ASIC4 86 Eth22-ASIC4 Int 40000 +Ethernet-BP348 117,118,119,120 Eth23-ASIC4 87 Eth23-ASIC4 Int 40000 +Ethernet-BP352 125,126,127,128 Eth24-ASIC4 88 Eth24-ASIC4 Int 40000 +Ethernet-BP356 121,122,123,124 Eth25-ASIC4 89 Eth25-ASIC4 Int 40000 +Ethernet-BP360 81,82,83,84 Eth26-ASIC4 90 Eth26-ASIC4 Int 40000 +Ethernet-BP364 85,86,87,88 Eth27-ASIC4 91 Eth27-ASIC4 Int 40000 +Ethernet-BP368 93,94,95,96 Eth28-ASIC4 92 Eth28-ASIC4 Int 40000 +Ethernet-BP372 89,90,91,92 Eth29-ASIC4 93 Eth29-ASIC4 Int 40000 +Ethernet-BP376 101,102,103,104 Eth30-ASIC4 94 Eth30-ASIC4 Int 40000 +Ethernet-BP380 97,98,99,100 Eth31-ASIC4 95 Eth31-ASIC4 Int 40000 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/5/port_config.ini b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/5/port_config.ini index 95cf5eec9e4e..96e863b87349 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/5/port_config.ini +++ b/device/virtual/x86_64-kvm_x86_64-r0/msft_multi_asic_vs/5/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias index speed -Ethernet0 25,26,27,28 fortyGigE0/0 0 40000 -Ethernet4 29,30,31,32 fortyGigE0/4 1 40000 -Ethernet8 33,34,35,36 fortyGigE0/8 2 40000 -Ethernet12 37,38,39,40 fortyGigE0/12 3 40000 -Ethernet16 45,46,47,48 fortyGigE0/16 4 40000 -Ethernet20 41,42,43,44 fortyGigE0/20 5 40000 -Ethernet24 1,2,3,4 fortyGigE0/24 6 40000 -Ethernet28 5,6,7,8 fortyGigE0/28 7 40000 -Ethernet32 13,14,15,16 fortyGigE0/32 8 40000 -Ethernet36 9,10,11,12 fortyGigE0/36 9 40000 -Ethernet40 17,18,19,20 fortyGigE0/40 10 40000 -Ethernet44 21,22,23,24 fortyGigE0/44 11 40000 -Ethernet48 53,54,55,56 fortyGigE0/48 12 40000 -Ethernet52 49,50,51,52 fortyGigE0/52 13 40000 -Ethernet56 57,58,59,60 fortyGigE0/56 14 40000 -Ethernet60 61,62,63,64 fortyGigE0/60 15 40000 -Ethernet64 69,70,71,72 fortyGigE0/64 16 40000 -Ethernet68 65,66,67,68 fortyGigE0/68 17 40000 -Ethernet72 73,74,75,76 fortyGigE0/72 18 40000 -Ethernet76 77,78,79,80 fortyGigE0/76 19 40000 -Ethernet80 109,110,111,112 fortyGigE0/80 20 40000 -Ethernet84 105,106,107,108 fortyGigE0/84 21 40000 -Ethernet88 113,114,115,116 fortyGigE0/88 22 40000 -Ethernet92 117,118,119,120 fortyGigE0/92 23 40000 -Ethernet96 125,126,127,128 fortyGigE0/96 24 40000 -Ethernet100 121,122,123,124 fortyGigE0/100 25 40000 -Ethernet104 81,82,83,84 fortyGigE0/104 26 40000 -Ethernet108 85,86,87,88 fortyGigE0/108 27 40000 -Ethernet112 93,94,95,96 fortyGigE0/112 28 40000 -Ethernet116 89,90,91,92 fortyGigE0/116 29 40000 -Ethernet120 101,102,103,104 fortyGigE0/120 30 40000 -Ethernet124 97,98,99,100 fortyGigE0/124 31 40000 +# name lanes alias index asic_port_name role speed +Ethernet-BP384 25,26,27,28 Eth0-ASIC5 96 Eth0-ASIC5 Int 40000 +Ethernet-BP388 29,30,31,32 Eth1-ASIC5 97 Eth1-ASIC5 Int 40000 +Ethernet-BP392 33,34,35,36 Eth2-ASIC5 98 Eth2-ASIC5 Int 40000 +Ethernet-BP396 37,38,39,40 Eth3-ASIC5 99 Eth3-ASIC5 Int 40000 +Ethernet-BP400 45,46,47,48 Eth4-ASIC5 100 Eth4-ASIC5 Int 40000 +Ethernet-BP404 41,42,43,44 Eth5-ASIC5 101 Eth5-ASIC5 Int 40000 +Ethernet-BP408 1,2,3,4 Eth6-ASIC5 102 Eth6-ASIC5 Int 40000 +Ethernet-BP412 5,6,7,8 Eth7-ASIC5 103 Eth7-ASIC5 Int 40000 +Ethernet-BP416 13,14,15,16 Eth8-ASIC5 104 Eth8-ASIC5 Int 40000 +Ethernet-BP420 9,10,11,12 Eth9-ASIC5 105 Eth9-ASIC5 Int 40000 +Ethernet-BP424 17,18,19,20 Eth10-ASIC5 106 Eth10-ASIC5 Int 40000 +Ethernet-BP428 21,22,23,24 Eth11-ASIC5 107 Eth11-ASIC5 Int 40000 +Ethernet-BP432 53,54,55,56 Eth12-ASIC5 108 Eth12-ASIC5 Int 40000 +Ethernet-BP436 49,50,51,52 Eth13-ASIC5 109 Eth13-ASIC5 Int 40000 +Ethernet-BP440 57,58,59,60 Eth14-ASIC5 110 Eth14-ASIC5 Int 40000 +Ethernet-BP444 61,62,63,64 Eth15-ASIC5 111 Eth15-ASIC5 Int 40000 +Ethernet-BP448 69,70,71,72 Eth16-ASIC5 112 Eth16-ASIC5 Int 40000 +Ethernet-BP452 65,66,67,68 Eth17-ASIC5 113 Eth17-ASIC5 Int 40000 +Ethernet-BP456 73,74,75,76 Eth18-ASIC5 114 Eth18-ASIC5 Int 40000 +Ethernet-BP460 77,78,79,80 Eth19-ASIC5 115 Eth19-ASIC5 Int 40000 +Ethernet-BP464 109,110,111,112 Eth20-ASIC5 116 Eth20-ASIC5 Int 40000 +Ethernet-BP468 105,106,107,108 Eth21-ASIC5 117 Eth21-ASIC5 Int 40000 +Ethernet-BP472 113,114,115,116 Eth22-ASIC5 118 Eth22-ASIC5 Int 40000 +Ethernet-BP476 117,118,119,120 Eth23-ASIC5 119 Eth23-ASIC5 Int 40000 +Ethernet-BP480 125,126,127,128 Eth24-ASIC5 120 Eth24-ASIC5 Int 40000 +Ethernet-BP484 121,122,123,124 Eth25-ASIC5 121 Eth25-ASIC5 Int 40000 +Ethernet-BP488 81,82,83,84 Eth26-ASIC5 122 Eth26-ASIC5 Int 40000 +Ethernet-BP492 85,86,87,88 Eth27-ASIC5 123 Eth27-ASIC5 Int 40000 +Ethernet-BP496 93,94,95,96 Eth28-ASIC5 124 Eth28-ASIC5 Int 40000 +Ethernet-BP500 89,90,91,92 Eth29-ASIC5 125 Eth29-ASIC5 Int 40000 +Ethernet-BP504 101,102,103,104 Eth30-ASIC5 126 Eth30-ASIC5 Int 40000 +Ethernet-BP508 97,98,99,100 Eth31-ASIC5 127 Eth31-ASIC5 Int 40000 diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index 49361e97ba18..58796ca79e25 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -25,7 +25,7 @@ RUN apt-get clean -y && \ rm -rf /debs COPY ["docker_init.sh", "start.sh", "/usr/bin/"] -COPY ["docker-dhcp-relay.supervisord.conf.j2", "wait_for_intf.sh.j2", "/usr/share/sonic/templates/"] +COPY ["docker-dhcp-relay.supervisord.conf.j2", "port-name-alias-map.txt.j2", "wait_for_intf.sh.j2", "/usr/share/sonic/templates/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] diff --git a/dockers/docker-dhcp-relay/docker_init.sh b/dockers/docker-dhcp-relay/docker_init.sh index f6d402e6f780..9fc7a93e9958 100755 --- a/dockers/docker-dhcp-relay/docker_init.sh +++ b/dockers/docker-dhcp-relay/docker_init.sh @@ -2,15 +2,21 @@ # Generate supervisord config file mkdir -p /etc/supervisor/conf.d/ -sonic-cfggen -d -t /usr/share/sonic/templates/docker-dhcp-relay.supervisord.conf.j2 > /etc/supervisor/conf.d/docker-dhcp-relay.supervisord.conf -# Generate the script that waits for all interfaces to come up and make it executable -sonic-cfggen -d -t /usr/share/sonic/templates/wait_for_intf.sh.j2 > /usr/bin/wait_for_intf.sh -chmod +x /usr/bin/wait_for_intf.sh +# Generate the following files from templates: +# 1. supervisord configuration +# 2. wait_for_intf.sh, which waits for all interfaces to come up +# 3. port-to-alias name map +CFGGEN_PARAMS=" \ + -d \ + -t /usr/share/sonic/templates/docker-dhcp-relay.supervisord.conf.j2,/etc/supervisor/conf.d/docker-dhcp-relay.supervisord.conf \ + -t /usr/share/sonic/templates/wait_for_intf.sh.j2,/usr/bin/wait_for_intf.sh \ + -t /usr/share/sonic/templates/port-name-alias-map.txt.j2,/tmp/port-name-alias-map.txt \ +" +sonic-cfggen $CFGGEN_PARAMS -# Generate port name-alias map for isc-dhcp-relay to parse. Each line contains one -# name-alias pair of the form " " -sonic-cfggen -d --var-json "PORT" | python -c "import sys, json, os; [sys.stdout.write('%s %s\n' % (k, v['alias'] if 'alias' in v else k)) for (k, v) in json.load(sys.stdin).iteritems()]" > /tmp/port-name-alias-map.txt +# Make the script that waits for all interfaces to come up executable +chmod +x /usr/bin/wait_for_intf.sh # The docker container should start this script as PID 1, so now that supervisord is # properly configured, we exec supervisord so that it runs as PID 1 for the diff --git a/dockers/docker-dhcp-relay/port-name-alias-map.txt.j2 b/dockers/docker-dhcp-relay/port-name-alias-map.txt.j2 new file mode 100644 index 000000000000..b2290a9ffbf2 --- /dev/null +++ b/dockers/docker-dhcp-relay/port-name-alias-map.txt.j2 @@ -0,0 +1,5 @@ +{# Generate port name-alias map for isc-dhcp-relay to parse. Each line contains one #} +{# name-alias pair of the form " " #} +{% for port, config in PORT.items() %} + {{- port }} {% if "alias" in config %}{{ config["alias"] }}{% else %}{{ port }}{% endif %} {{- "\n" -}} +{% endfor -%} diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index 640eecd884ac..072b17391089 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -3,10 +3,26 @@ mkdir -p /etc/frr mkdir -p /etc/supervisor/conf.d -sonic-cfggen -d -t /usr/share/sonic/templates/supervisord/supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf - -CONFIG_TYPE=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["docker_routing_config_mode"]'` TEMPL_CONFIG=`sonic-cfggen -d -v 'DEVICE_METADATA["localhost"]["bgp_template_config"]'` +CFGGEN_PARAMS=" \ + -d \ + -y /etc/sonic/constants.yml \ + -t /usr/share/sonic/templates/supervisord/frr_vars.j2 \ + -t /usr/share/sonic/templates/supervisord/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \ + -t /usr/share/sonic/templates/bgpd/bgpd.conf.j2,/etc/frr/bgpd.conf \ + -t /usr/share/sonic/templates/zebra/zebra.conf.j2,/etc/frr/zebra.conf \ + -t /usr/share/sonic/templates/staticd/staticd.conf.j2,/etc/frr/staticd.conf \ + -t /usr/share/sonic/templates/frr.conf.j2,/etc/frr/frr.conf \ + -t /usr/share/sonic/templates/isolate.j2,/usr/sbin/bgp-isolate \ + -t /usr/share/sonic/templates/unisolate.j2,/usr/sbin/bgp-unisolate \ +" +if [ -n "$TEMPL_CONFIG" ] && [ "$TEMPL_CONFIG" == "false" ]; then + CFGGEN_PARAMS+=" \ + -t /usr/share/sonic/templates/bgdd/bfdd.conf.j2,/etc/frr/bfdd.conf \ + -t /usr/share/sonic/templates/ospfd/ospfd.conf.j2,/etc/frr/ospfd.conf \ + " +fi +CONFIG_TYPE=$(sonic-cfggen $CFGGEN_PARAMS) if [[ ! -z "$NAMESPACE_ID" ]]; then # FRR is not running in host namespace so we need to delete @@ -32,17 +48,9 @@ if [[ ! -z "$NAMESPACE_ID" ]]; then fi if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then - sonic-cfggen -d -t /usr/share/sonic/templates/bgpd/bgpd.conf.j2 -y /etc/sonic/constants.yml > /etc/frr/bgpd.conf - sonic-cfggen -d -t /usr/share/sonic/templates/zebra/zebra.conf.j2 > /etc/frr/zebra.conf - sonic-cfggen -d -t /usr/share/sonic/templates/staticd/staticd.conf.j2 > /etc/frr/staticd.conf - if [ -n "$TEMPL_CONFIG" ] && [ "$TEMPL_CONFIG" == "false" ]; then - sonic-cfggen -d -t /usr/share/sonic/templates/bgdd/bfdd.conf.j2 > /etc/frr/bfdd.conf - sonic-cfggen -d -t /usr/share/sonic/templates/ospfd/ospfd.conf.j2 > /etc/frr/ospfd.conf - fi echo "no service integrated-vtysh-config" > /etc/frr/vtysh.conf rm -f /etc/frr/frr.conf elif [ "$CONFIG_TYPE" == "unified" ]; then - sonic-cfggen -d -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/frr.conf.j2 >/etc/frr/frr.conf echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf rm -f /etc/frr/bfdd.conf /etc/frr/ospfd.conf /etc/frr/pimd.conf @@ -50,11 +58,9 @@ fi chown -R frr:frr /etc/frr/ -sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate chown root:root /usr/sbin/bgp-isolate chmod 0755 /usr/sbin/bgp-isolate -sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate chown root:root /usr/sbin/bgp-unisolate chmod 0755 /usr/sbin/bgp-unisolate diff --git a/dockers/docker-fpm-frr/frr/frr_vars.j2 b/dockers/docker-fpm-frr/frr/frr_vars.j2 new file mode 100644 index 000000000000..9909604e5f1c --- /dev/null +++ b/dockers/docker-fpm-frr/frr/frr_vars.j2 @@ -0,0 +1 @@ +{{ DEVICE_METADATA["localhost"]["docker_routing_config_mode"] }} diff --git a/dockers/docker-fpm-gobgp/start.sh b/dockers/docker-fpm-gobgp/start.sh index 83afbda4f736..cdb0c6301686 100755 --- a/dockers/docker-fpm-gobgp/start.sh +++ b/dockers/docker-fpm-gobgp/start.sh @@ -1,14 +1,19 @@ #!/usr/bin/env bash mkdir -p /etc/quagga -sonic-cfggen -d -t /usr/share/sonic/templates/gobgpd.conf.j2 > /etc/gobgp/gobgpd.conf -sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/quagga/zebra.conf -sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate +CFGGEN_PARAMS=" \ + -d \ + -t /usr/share/sonic/templates/gobgpd.conf.j2,/etc/gobgp/gobgpd.conf \ + -t /usr/share/sonic/templates/zebra.conf.j2,/etc/quagga/zebra.conf \ + -t /usr/share/sonic/templates/isolate.j2,/usr/sbin/bgp-isolate \ + -t /usr/share/sonic/templates/unisolate.j2,/usr/sbin/bgp-unisolate \ +" +sonic-cfggen $CFGGEN_PARAMS + chown root:root /usr/sbin/bgp-isolate chmod 0755 /usr/sbin/bgp-isolate -sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate chown root:root /usr/sbin/bgp-unisolate chmod 0755 /usr/sbin/bgp-unisolate diff --git a/dockers/docker-fpm-quagga/start.sh b/dockers/docker-fpm-quagga/start.sh index 1ffda3d17732..37d9c5072d9d 100755 --- a/dockers/docker-fpm-quagga/start.sh +++ b/dockers/docker-fpm-quagga/start.sh @@ -1,15 +1,20 @@ #!/usr/bin/env bash mkdir -p /etc/quagga -sonic-cfggen -d -y /etc/sonic/constants.yml -t /usr/share/sonic/templates/bgpd.conf.j2 > /etc/quagga/bgpd.conf -sonic-cfggen -d -t /usr/share/sonic/templates/zebra.conf.j2 > /etc/quagga/zebra.conf +CFGGEN_PARAMS=" \ + -d \ + -y /etc/sonic/constants.yml \ + -t /usr/share/sonic/templates/bgpd.conf.j2,/etc/quagga/bgpd.conf \ + -t /usr/share/sonic/templates/zebra.conf.j2,/etc/quagga/zebra.conf \ + -t /usr/share/sonic/templates/isolate.j2,/usr/sbin/bgp-isolate \ + -t /usr/share/sonic/templates/unisolate.j2,/usr/sbin/bgp-unisolate \ +" +sonic-cfggen $CFGGEN_PARAMS -sonic-cfggen -d -t /usr/share/sonic/templates/isolate.j2 > /usr/sbin/bgp-isolate chown root:root /usr/sbin/bgp-isolate chmod 0755 /usr/sbin/bgp-isolate -sonic-cfggen -d -t /usr/share/sonic/templates/unisolate.j2 > /usr/sbin/bgp-unisolate chown root:root /usr/sbin/bgp-unisolate chmod 0755 /usr/sbin/bgp-unisolate diff --git a/dockers/docker-orchagent/docker-init.sh b/dockers/docker-orchagent/docker-init.sh index 9d2aa16aab74..189cf28c9a08 100755 --- a/dockers/docker-orchagent/docker-init.sh +++ b/dockers/docker-orchagent/docker-init.sh @@ -2,10 +2,16 @@ mkdir -p /etc/swss/config.d/ -sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/switch.json.j2 > /etc/swss/config.d/switch.json -sonic-cfggen -d -t /usr/share/sonic/templates/ipinip.json.j2 > /etc/swss/config.d/ipinip.json -sonic-cfggen -d -t /usr/share/sonic/templates/ports.json.j2 > /etc/swss/config.d/ports.json -sonic-cfggen -d -t /usr/share/sonic/templates/copp.json.j2 > /etc/swss/config.d/00-copp.config.json +CFGGEN_PARAMS=" \ + -d \ + -y /etc/sonic/constants.yml \ + -t /usr/share/sonic/templates/switch.json.j2,/etc/swss/config.d/switch.json \ + -t /usr/share/sonic/templates/ipinip.json.j2,/etc/swss/config.d/ipinip.json \ + -t /usr/share/sonic/templates/ports.json.j2,/etc/swss/config.d/ports.json \ + -t /usr/share/sonic/templates/copp.json.j2,/etc/swss/config.d/00-copp.config.json \ + -t /usr/share/sonic/templates/vlan_vars.j2 \ +" +VLAN=$(sonic-cfggen $CFGGEN_PARAMS) # Executed HWSKU specific initialization tasks. if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then @@ -13,7 +19,6 @@ if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then fi # Start arp_update when VLAN exists -VLAN=`sonic-cfggen -d -v 'VLAN.keys() | join(" ") if VLAN'` if [ "$VLAN" != "" ]; then cp /usr/share/sonic/templates/arp_update.conf /etc/supervisord/conf.d/ fi diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 8743caea1fb5..fde5370dc181 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -25,6 +25,12 @@ ORCHAGENT_ARGS="-d /var/log/swss " # Set orchagent pop batch size to 8192 ORCHAGENT_ARGS+="-b 8192 " +# Set synchronous mode if it is enabled in CONFIG_DB +SYNC_MODE=$(echo $SWSS_VARS | jq -r '.synchronous_mode') +if [ "$SYNC_MODE" == "enable" ]; then + ORCHAGENT_ARGS+="-s " +fi + # Check if there is an "asic_id field" in the DEVICE_METADATA in configDB. #"DEVICE_METADATA": { # "localhost": { diff --git a/dockers/docker-orchagent/swss_vars.j2 b/dockers/docker-orchagent/swss_vars.j2 index 0a0b2712f46a..cb96aa826f6b 100644 --- a/dockers/docker-orchagent/swss_vars.j2 +++ b/dockers/docker-orchagent/swss_vars.j2 @@ -1,6 +1,7 @@ { "asic_type": "{{ asic_type }}", "asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}", - "mac": "{{ DEVICE_METADATA.localhost.mac }}" + "mac": "{{ DEVICE_METADATA.localhost.mac }}", + "synchronous_mode": "{{ DEVICE_METADATA.localhost.synchronous_mode }}" } diff --git a/dockers/docker-orchagent/vlan_vars.j2 b/dockers/docker-orchagent/vlan_vars.j2 new file mode 100644 index 000000000000..55db548043a3 --- /dev/null +++ b/dockers/docker-orchagent/vlan_vars.j2 @@ -0,0 +1 @@ +{%- if VLAN -%}{{- VLAN.keys() | join(' ') -}}{%- endif -%} diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 7c1b96b2063d..ffb6a61cb183 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -65,7 +65,7 @@ dependent_startup_wait_for=start:exited {% if not skip_ledd %} [program:ledd] -command=/usr/bin/ledd +command=/usr/local/bin/ledd priority=5 autostart=false autorestart=false @@ -78,7 +78,7 @@ dependent_startup_wait_for=start:exited {% if not skip_xcvrd %} [program:xcvrd] -command=/usr/bin/xcvrd +command=/usr/local/bin/xcvrd priority=6 autostart=false autorestart=false @@ -91,7 +91,7 @@ dependent_startup_wait_for=start:exited {% if not skip_psud %} [program:psud] -command=/usr/bin/psud +command=/usr/local/bin/psud priority=7 autostart=false autorestart=false @@ -104,7 +104,7 @@ dependent_startup_wait_for=start:exited {% if not skip_syseepromd %} [program:syseepromd] -command=/usr/bin/syseepromd +command=/usr/local/bin/syseepromd priority=8 autostart=false autorestart=unexpected @@ -117,7 +117,7 @@ dependent_startup_wait_for=start:exited {% if not skip_thermalctld %} [program:thermalctld] -command=/usr/bin/thermalctld +command=/usr/local/bin/thermalctld priority=9 autostart=false autorestart=unexpected @@ -130,7 +130,7 @@ dependent_startup_wait_for=start:exited {% if not skip_pcied %} [program:pcied] -command=/usr/bin/pcied +command=/usr/local/bin/pcied priority=10 autostart=false autorestart=unexpected diff --git a/dockers/docker-router-advertiser/Dockerfile.j2 b/dockers/docker-router-advertiser/Dockerfile.j2 index 7f57ade4fade..1d5a9acc43ea 100644 --- a/dockers/docker-router-advertiser/Dockerfile.j2 +++ b/dockers/docker-router-advertiser/Dockerfile.j2 @@ -25,7 +25,7 @@ RUN apt-get clean -y && \ rm -rf /debs COPY ["docker-init.sh", "/usr/bin/"] -COPY ["radvd.conf.j2", "wait_for_intf.sh.j2", "docker-router-advertiser.supervisord.conf.j2", "/usr/share/sonic/templates/"] +COPY ["radvd.conf.j2", "wait_for_link.sh.j2", "docker-router-advertiser.supervisord.conf.j2", "/usr/share/sonic/templates/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] diff --git a/dockers/docker-router-advertiser/docker-init.sh b/dockers/docker-router-advertiser/docker-init.sh index f93544e7cb64..a3f373f438aa 100755 --- a/dockers/docker-router-advertiser/docker-init.sh +++ b/dockers/docker-router-advertiser/docker-init.sh @@ -1,13 +1,17 @@ #!/usr/bin/env bash mkdir -p /etc/supervisor/conf.d -sonic-cfggen -d -t /usr/share/sonic/templates/docker-router-advertiser.supervisord.conf.j2 > /etc/supervisor/conf.d/supervisord.conf -# Generate /etc/radvd.conf config file -sonic-cfggen -d -t /usr/share/sonic/templates/radvd.conf.j2 > /etc/radvd.conf +# Generate supervisord router advertiser config, /etc/radvd.conf config file, and +# the script that waits for pertinent interfaces to come up and make it executable +CFGGEN_PARAMS=" \ + -d \ + -t /usr/share/sonic/templates/docker-router-advertiser.supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \ + -t /usr/share/sonic/templates/radvd.conf.j2,/etc/radvd.conf \ + -t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \ +" +sonic-cfggen $CFGGEN_PARAMS -# Generate the script that waits for pertinent interfaces to come up and make it executable -sonic-cfggen -d -t /usr/share/sonic/templates/wait_for_intf.sh.j2 > /usr/bin/wait_for_intf.sh -chmod +x /usr/bin/wait_for_intf.sh +chmod +x /usr/bin/wait_for_link.sh exec /usr/bin/supervisord diff --git a/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 b/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 index 146e7c1b67db..9bfc8d9220ad 100644 --- a/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 +++ b/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 @@ -26,20 +26,21 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true -{# Router advertiser should only run on ToR (T0) devices #} -{% if DEVICE_METADATA.localhost.type == "ToRRouter" %} - - {% if VLAN_INTERFACE %} - {% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} +{# Router advertiser should only run on ToR (T0) devices which have #} +{# at least one VLAN interface which has an IPv6 address asigned #} +{%- set vlan_v6 = namespace(count=0) -%} +{%- if DEVICE_METADATA.localhost.type == "ToRRouter" -%} + {%- if VLAN_INTERFACE -%} + {%- for (name, prefix) in VLAN_INTERFACE|pfx_filter -%} {# If this VLAN has an IPv6 address... #} - {% if prefix | ipv6 %} - {% set ipv6_found = true %} - {% endif %} - {% endfor %} - {% endif %} + {%- if prefix | ipv6 -%} + {%- set vlan_v6.count = vlan_v6.count + 1 -%} + {%- endif -%} + {%- endfor -%} + {%- endif -%} +{%- endif -%} - {# Enusre at least one ipv6 vlan interface #} - {% if ipv6_found == true %} +{%- if vlan_v6.count > 0 %} [program:wait_for_link] command=/usr/bin/wait_for_link.sh priority=3 @@ -60,6 +61,4 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=wait_for_link:exited - {% endif %} - -{% endif %} +{% endif -%} diff --git a/dockers/docker-router-advertiser/wait_for_intf.sh.j2 b/dockers/docker-router-advertiser/wait_for_link.sh.j2 similarity index 100% rename from dockers/docker-router-advertiser/wait_for_intf.sh.j2 rename to dockers/docker-router-advertiser/wait_for_link.sh.j2 diff --git a/dockers/docker-snmp/start.sh b/dockers/docker-snmp/start.sh index c4929738f9d8..37ba3577e597 100755 --- a/dockers/docker-snmp/start.sh +++ b/dockers/docker-snmp/start.sh @@ -1,10 +1,16 @@ #!/usr/bin/env bash -mkdir -p /etc/ssw -sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sysDescription.j2 > /etc/ssw/sysDescription +mkdir -p /etc/ssw /etc/snmp -mkdir -p /etc/snmp -sonic-cfggen -d -y /etc/sonic/snmp.yml -t /usr/share/sonic/templates/snmpd.conf.j2 > /etc/snmp/snmpd.conf +SONIC_CFGGEN_ARGS=" \ + -d \ + -y /etc/sonic/sonic_version.yml \ + -t /usr/share/sonic/templates/sysDescription.j2,/etc/ssw/sysDescription \ + -y /etc/sonic/snmp.yml \ + -t /usr/share/sonic/templates/snmpd.conf.j2,/etc/snmp/snmpd.conf \ +" + +sonic-cfggen $SONIC_CFGGEN_ARGS mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index 7d266e7d650e..e252af17718b 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -95,8 +95,13 @@ function postStartAction() link_namespace $DEV fi - # Wait until redis starts - until [[ $($SONIC_DB_CLI PING | grep -c PONG) -gt 0 ]]; do + # Wait until supervisord and redis starts. This change is needed + # because now database_config.json is jinja2 templated based + # and by the time file gets generated if we do redis ping + # then we catch python exception of file not valid + # that comes to syslog which is unwanted so wait till database + # config is ready and then ping + until [[ ($(docker exec -i database$DEV pgrep -x -c supervisord) -gt 0) && ($($SONIC_DB_CLI PING | grep -c PONG) -gt 0) ]]; do sleep 1; done diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 63d54989f5d0..23c0b8eb195f 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -2,7 +2,8 @@ "DEVICE_METADATA": { "localhost": { "default_bgp_status": {% if shutdown_bgp_on_start == "y" %}"down"{% else %}"up"{% endif %}, - "default_pfcwd_status": {% if enable_pfcwd_on_start == "y" %}"enable"{% else %}"disable"{% endif %} + "default_pfcwd_status": {% if enable_pfcwd_on_start == "y" %}"enable"{% else %}"disable"{% endif %}, + "synchronous_mode": {% if enable_synchronous_mode == "y" %}"enable"{% else %}"disable"{% endif %} } }, "CRM": { @@ -17,26 +18,28 @@ {% endfor %} } }, -{%- set features = [("bgp", "enabled", "enabled"), - ("database", "enabled", "disabled"), - ("dhcp_relay", "enabled", "enabled"), - ("lldp", "enabled", "enabled"), - ("pmon", "enabled", "enabled"), - ("radv", "enabled", "enabled"), - ("snmp", "enabled", "enabled"), - ("swss", "enabled", "enabled"), - ("syncd", "enabled", "enabled"), - ("teamd", "enabled", "enabled")] %} -{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", "enabled")) %}{% endif %} -{%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", "enabled")) %}{% endif %} -{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", "enabled")) %}{% endif %} -{%- if include_restapi == "y" %}{% do features.append(("restapi", "disabled", "enabled")) %}{% endif %} -{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", "enabled")) %}{% endif %} -{%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", "enabled")) %}{% endif %} +{%- set features = [("bgp", "enabled", false, "enabled"), + ("database", "enabled", false, "disabled"), + ("dhcp_relay", "enabled", false, "enabled"), + ("lldp", "enabled", false, "enabled"), + ("pmon", "enabled", false, "enabled"), + ("radv", "enabled", false, "enabled"), + ("snmp", "enabled", true, "enabled"), + ("swss", "enabled", false, "enabled"), + ("syncd", "enabled", false, "enabled"), + ("teamd", "enabled", false, "enabled")] %} +{%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", false, "enabled")) %}{% endif %} +{%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", false, "enabled")) %}{% endif %} +{%- if include_nat == "y" %}{% do features.append(("nat", "disabled", false, "enabled")) %}{% endif %} +{%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %} +{%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", false, "enabled")) %}{% endif %} +{%- if include_system_telemetry == "y" %}{% do features.append(("telemetry", "enabled", true, "enabled")) %}{% endif %} "FEATURE": { -{%- for feature, state, autorestart in features %} +{# has_timer field if set, will start the feature systemd .timer unit instead of .service unit #} +{%- for feature, state, has_timer, autorestart in features %} "{{feature}}": { "state": "{{state}}", + "has_timer" : {{has_timer | lower()}}, "auto_restart": "{{autorestart}}", "high_mem_alert": "disabled" }{% if not loop.last %},{% endif -%} diff --git a/files/build_templates/per_namespace/bgp.service.j2 b/files/build_templates/per_namespace/bgp.service.j2 index 79e9afc4ebc1..9f3c72e20db5 100644 --- a/files/build_templates/per_namespace/bgp.service.j2 +++ b/files/build_templates/per_namespace/bgp.service.j2 @@ -10,9 +10,9 @@ StartLimitBurst=3 [Service] User={{ sonicadmin_user }} -ExecStartPre=/usr/bin/{{docker_container_name}}.sh start{% if multi_instance == 'true' %} %i{% endif %} -ExecStart=/usr/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'true' %} %i{% endif %} -ExecStop=/usr/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %} +ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start{% if multi_instance == 'true' %} %i{% endif %} +ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'true' %} %i{% endif %} +ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %} Restart=always RestartSec=30 diff --git a/files/build_templates/radv.service.j2 b/files/build_templates/radv.service.j2 index b3dd3a8d8bcb..5cf25a21046d 100644 --- a/files/build_templates/radv.service.j2 +++ b/files/build_templates/radv.service.j2 @@ -8,9 +8,9 @@ StartLimitBurst=3 [Service] User={{ sonicadmin_user }} -ExecStartPre=/usr/bin/{{ docker_container_name }}.sh start -ExecStart=/usr/bin/{{ docker_container_name }}.sh wait -ExecStop=/usr/bin/{{ docker_container_name }}.sh stop +ExecStartPre=/usr/local/bin/{{ docker_container_name }}.sh start +ExecStart=/usr/local/bin/{{ docker_container_name }}.sh wait +ExecStop=/usr/local/bin/{{ docker_container_name }}.sh stop Restart=always RestartSec=30 diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index 34dcd48f9341..9fb517cb09a9 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -169,12 +169,6 @@ sudo cp {{platform_common_py2_wheel_path}} $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY2 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install $PLATFORM_COMMON_PY2_WHEEL_NAME sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY2_WHEEL_NAME -# Install sonic-daemon-base Python 2 package -DAEMON_BASE_PY2_WHEEL_NAME=$(basename {{daemon_base_py2_wheel_path}}) -sudo cp {{daemon_base_py2_wheel_path}} $FILESYSTEM_ROOT/$DAEMON_BASE_PY2_WHEEL_NAME -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install $DAEMON_BASE_PY2_WHEEL_NAME -sudo rm -rf $FILESYSTEM_ROOT/$DAEMON_BASE_PY2_WHEEL_NAME - # Install built Python Click package (and its dependencies via 'apt-get -y install -f') # Do this before installing sonic-utilities so that it doesn't attempt to install # an older version as part of its dependencies @@ -202,6 +196,12 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-ztp_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f {% endif %} +{% if include_host_service == "y" %} +# Install SONiC Host Service (and its dependencies via 'apt-get -y install -f') +sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/sonic-host-service_*.deb || \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f +{% endif %} + # SONiC utilities installs bash-completion as a dependency. However, it is disabled by default # in bash.bashrc, so we copy a version of the file with it enabled here. sudo cp -f $IMAGE_CONFIGS/bash/bash.bashrc $FILESYSTEM_ROOT/etc/ @@ -227,6 +227,13 @@ sudo DEBIAN_FRONTEND=noninteractive dpkg --root=$FILESYSTEM_ROOT -i $debs_path/k sudo LANG=C DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true chroot $FILESYSTEM_ROOT apt-get -q --no-install-suggests --no-install-recommends --force-no install fi +# Install python-swss-common package and all its dependent packages +{% if python_swss_debs.strip() -%} +{% for deb in python_swss_debs.strip().split(' ') -%} +sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f +{% endfor %} +{% endif %} + # Install custom-built monit package and SONiC configuration files sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/monit_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f @@ -484,10 +491,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS ta {% if include_kubernetes == "y" %} ## Pull in kubernetes docker images echo "pulling universal k8s images ..." -FLANNEL_ARCH=$([ "${CONFIGURED_ARCH}" == "armhf" ] && echo "arm64" || echo "${CONFIGURED_ARCH}") sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker pull k8s.gcr.io/pause:${K8s_GCR_IO_PAUSE_VERSION} -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker pull k8s.gcr.io/kube-proxy:v${KUBERNETES_VERSION} -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker pull quay.io/coreos/flannel:${K8s_CNI_FLANNEL_VERSION}-${FLANNEL_ARCH} echo "docker images pull complete" {% endif %} @@ -525,10 +529,11 @@ sudo LANG=C chroot $FILESYSTEM_ROOT fuser -km /sys || true sudo LANG=C chroot $FILESYSTEM_ROOT umount -lf /sys {% endif %} -# Copy swss and syncd service script +# Copy service scripts (swss, syncd, bgp, radv) sudo LANG=C cp $SCRIPTS_DIR/swss.sh $FILESYSTEM_ROOT/usr/local/bin/swss.sh sudo LANG=C cp $SCRIPTS_DIR/syncd.sh $FILESYSTEM_ROOT/usr/local/bin/syncd.sh sudo LANG=C cp $SCRIPTS_DIR/bgp.sh $FILESYSTEM_ROOT/usr/local/bin/bgp.sh +sudo LANG=C cp $SCRIPTS_DIR/radv.sh $FILESYSTEM_ROOT/usr/local/bin/radv.sh # Copy sonic-netns-exec script sudo LANG=C cp $SCRIPTS_DIR/sonic-netns-exec $FILESYSTEM_ROOT/usr/bin/sonic-netns-exec diff --git a/files/image_config/caclmgrd/caclmgrd b/files/image_config/caclmgrd/caclmgrd index 1e3ce01c7ac2..6b1cd6cc49ad 100755 --- a/files/image_config/caclmgrd/caclmgrd +++ b/files/image_config/caclmgrd/caclmgrd @@ -16,7 +16,10 @@ try: import subprocess import sys import syslog - from swsssdk import ConfigDBConnector + + from sonic_py_common import device_info + from swsscommon import swsscommon + from swsssdk import SonicDBConfig, ConfigDBConnector except ImportError as err: raise ImportError("%s - required module not found" % str(err)) @@ -46,6 +49,7 @@ def log_error(msg): # ========================== Helper Functions ========================= + def _ip_prefix_in_key(key): """ Function to check if IP prefix is present in a Redis database key. @@ -56,12 +60,12 @@ def _ip_prefix_in_key(key): # ============================== Classes ============================== + class ControlPlaneAclManager(object): """ Class which reads control plane ACL tables and rules from Config DB, translates them into equivalent iptables commands and runs those commands in order to apply the control plane ACLs. - Attributes: config_db: Handle to Config Redis database via SwSS SDK """ @@ -88,24 +92,48 @@ class ControlPlaneAclManager(object): } def __init__(self): - # Open a handle to the Config database - self.config_db = ConfigDBConnector() - self.config_db.connect() + SonicDBConfig.load_sonic_global_db_config() + self.config_db_map = {} + self.iptables_cmd_ns_prefix = {} + self.config_db_map[''] = ConfigDBConnector(use_unix_socket_path=True, namespace='') + self.config_db_map[''].connect() + self.iptables_cmd_ns_prefix[''] = "" + self.namespace_mgmt_ip = self.get_namespace_mgmt_ip(self.iptables_cmd_ns_prefix[''], '') + self.namespace_docker_mgmt_ip = {} + namespaces = device_info.get_all_namespaces() + for front_asic_namespace in namespaces['front_ns']: + self.config_db_map[front_asic_namespace] = ConfigDBConnector(use_unix_socket_path=True, namespace=front_asic_namespace) + self.config_db_map[front_asic_namespace].connect() + self.iptables_cmd_ns_prefix[front_asic_namespace] = "ip netns exec " + front_asic_namespace + " " + self.namespace_docker_mgmt_ip[front_asic_namespace] = self.get_namespace_mgmt_ip(self.iptables_cmd_ns_prefix[front_asic_namespace], + front_asic_namespace) + + for back_asic_namespace in namespaces['back_ns']: + self.iptables_cmd_ns_prefix[back_asic_namespace] = "ip netns exec " + back_asic_namespace + " " + self.namespace_docker_mgmt_ip[back_asic_namespace] = self.get_namespace_mgmt_ip(self.iptables_cmd_ns_prefix[back_asic_namespace], + back_asic_namespace) + + def get_namespace_mgmt_ip(self, iptable_ns_cmd_prefix, namespace): + ip_address_get_command = iptable_ns_cmd_prefix + "ip -4 -o addr show " + ("eth0" if namespace else "docker0") +\ + " | awk '{print $4}' | cut -d'/' -f1 | head -1" + + return self.run_commands([ip_address_get_command]) def run_commands(self, commands): """ Given a list of shell commands, run them in order - Args: commands: List of strings, each string is a shell command """ for cmd in commands: - proc = subprocess.Popen(cmd, shell=True) + proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) (stdout, stderr) = proc.communicate() if proc.returncode != 0: log_error("Error running command '{}'".format(cmd)) + elif stdout: + return stdout.rstrip('\n') def parse_int_to_tcp_flags(self, hex_value): tcp_flags_str = "" @@ -133,7 +161,7 @@ class ControlPlaneAclManager(object): tcp_flags_str = tcp_flags_str[:-1] return tcp_flags_str - def generate_block_ip2me_traffic_iptables_commands(self): + def generate_block_ip2me_traffic_iptables_commands(self, namespace): INTERFACE_TABLE_NAME_LIST = [ "LOOPBACK_INTERFACE", "MGMT_INTERFACE", @@ -146,7 +174,7 @@ class ControlPlaneAclManager(object): # Add iptables rules to drop all packets destined for peer-to-peer interface IP addresses for iface_table_name in INTERFACE_TABLE_NAME_LIST: - iface_table = self.config_db.get_table(iface_table_name) + iface_table = self.config_db_map[namespace].get_table(iface_table_name) if iface_table: for key, _ in iface_table.iteritems(): if not _ip_prefix_in_key(key): @@ -160,109 +188,129 @@ class ControlPlaneAclManager(object): ip_addr = next(ip_ntwrk.hosts()) if iface_table_name == "VLAN_INTERFACE" else ip_ntwrk.network_address if isinstance(ip_ntwrk, ipaddress.IPv4Network): - block_ip2me_cmds.append("iptables -A INPUT -d {}/{} -j DROP".format(ip_addr, ip_ntwrk.max_prefixlen)) + block_ip2me_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -d {}/{} -j DROP".format(ip_addr, ip_ntwrk.max_prefixlen)) elif isinstance(ip_ntwrk, ipaddress.IPv6Network): - block_ip2me_cmds.append("ip6tables -A INPUT -d {}/{} -j DROP".format(ip_addr, ip_ntwrk.max_prefixlen)) + block_ip2me_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -d {}/{} -j DROP".format(ip_addr, ip_ntwrk.max_prefixlen)) else: log_warning("Unrecognized IP address type on interface '{}': {}".format(iface_name, ip_ntwrk)) return block_ip2me_cmds + def generate_allow_internal_docker_ip_traffic_commands(self, namespace): + allow_internal_docker_ip_cmds = [] + + if namespace: + # For namespace docker allow all tcp/udp traffic from host docker bridge to its eth0 management ip + allow_internal_docker_ip_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p tcp -s {} -d {} -j ACCEPT".format + (self.namespace_mgmt_ip, self.namespace_docker_mgmt_ip[namespace])) + + allow_internal_docker_ip_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p udp -s {} -d {} -j ACCEPT".format + (self.namespace_mgmt_ip, self.namespace_docker_mgmt_ip[namespace])) + else: + # In host allow all tcp/udp traffic from namespace docker eth0 management ip to host docker bridge + for docker_mgmt_ip in self.namespace_docker_mgmt_ip.values(): + allow_internal_docker_ip_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p tcp -s {} -d {} -j ACCEPT".format + (docker_mgmt_ip, self.namespace_mgmt_ip)) + + allow_internal_docker_ip_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p udp -s {} -d {} -j ACCEPT".format + (docker_mgmt_ip, self.namespace_mgmt_ip)) + return allow_internal_docker_ip_cmds + def is_rule_ipv4(self, rule_props): if (("SRC_IP" in rule_props and rule_props["SRC_IP"]) or - ("DST_IP" in rule_props and rule_props["DST_IP"])): + ("DST_IP" in rule_props and rule_props["DST_IP"])): return True else: return False def is_rule_ipv6(self, rule_props): if (("SRC_IPV6" in rule_props and rule_props["SRC_IPV6"]) or - ("DST_IPV6" in rule_props and rule_props["DST_IPV6"])): + ("DST_IPV6" in rule_props and rule_props["DST_IPV6"])): return True else: return False - def get_acl_rules_and_translate_to_iptables_commands(self): + def get_acl_rules_and_translate_to_iptables_commands(self, namespace): """ Retrieves current ACL tables and rules from Config DB, translates control plane ACLs into a list of iptables commands that can be run in order to install ACL rules. - Returns: A list of strings, each string is an iptables shell command - """ iptables_cmds = [] # First, add iptables commands to set default policies to accept all # traffic. In case we are connected remotely, the connection will not # drop when we flush the current rules - iptables_cmds.append("iptables -P INPUT ACCEPT") - iptables_cmds.append("iptables -P FORWARD ACCEPT") - iptables_cmds.append("iptables -P OUTPUT ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -P INPUT ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -P FORWARD ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -P OUTPUT ACCEPT") # Add iptables command to flush the current rules - iptables_cmds.append("iptables -F") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -F") # Add iptables command to delete all non-default chains - iptables_cmds.append("iptables -X") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -X") # Add same set of commands for ip6tables - iptables_cmds.append("ip6tables -P INPUT ACCEPT") - iptables_cmds.append("ip6tables -P FORWARD ACCEPT") - iptables_cmds.append("ip6tables -P OUTPUT ACCEPT") - iptables_cmds.append("ip6tables -F") - iptables_cmds.append("ip6tables -X") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -P INPUT ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -P FORWARD ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -P OUTPUT ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -F") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -X") # Add iptables/ip6tables commands to allow all traffic from localhost - iptables_cmds.append("iptables -A INPUT -s 127.0.0.1 -i lo -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -s ::1 -i lo -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -s 127.0.0.1 -i lo -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -s ::1 -i lo -j ACCEPT") + + # Add iptables commands to allow internal docker traffic + iptables_cmds += self.generate_allow_internal_docker_ip_traffic_commands(namespace) # Add iptables/ip6tables commands to allow all incoming packets from established # connections or new connections which are related to established connections - iptables_cmds.append("iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT") # Add iptables/ip6tables commands to allow bidirectional ICMPv4 ping and traceroute # TODO: Support processing ICMPv4 service ACL rules, and remove this blanket acceptance - iptables_cmds.append("iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT") - iptables_cmds.append("iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT") - iptables_cmds.append("iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT") - iptables_cmds.append("iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT") # Add iptables/ip6tables commands to allow bidirectional ICMPv6 ping and traceroute # TODO: Support processing ICMPv6 service ACL rules, and remove this blanket acceptance - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-reply -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type destination-unreachable -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type time-exceeded -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-request -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type echo-reply -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type destination-unreachable -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type time-exceeded -j ACCEPT") # Add iptables/ip6tables commands to allow all incoming Neighbor Discovery Protocol (NDP) NS/NA/RS/RA messages # TODO: Support processing NDP service ACL rules, and remove this blanket acceptance - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type router-solicitation -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p icmpv6 --icmpv6-type router-advertisement -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-solicitation -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type neighbor-advertisement -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type router-solicitation -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p icmpv6 --icmpv6-type router-advertisement -j ACCEPT") # Add iptables/ip6tables commands to allow all incoming IPv4 DHCP packets - iptables_cmds.append("iptables -A INPUT -p udp --dport 67:68 -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p udp --dport 67:68 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p udp --dport 67:68 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p udp --dport 67:68 -j ACCEPT") # Add iptables/ip6tables commands to allow all incoming IPv6 DHCP packets - iptables_cmds.append("iptables -A INPUT -p udp --dport 546:547 -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p udp --dport 546:547 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p udp --dport 546:547 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p udp --dport 546:547 -j ACCEPT") # Add iptables/ip6tables commands to allow all incoming BGP traffic # TODO: Determine BGP ACLs based on configured device sessions, and remove this blanket acceptance - iptables_cmds.append("iptables -A INPUT -p tcp --dport 179 -j ACCEPT") - iptables_cmds.append("iptables -A INPUT -p tcp --sport 179 -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p tcp --dport 179 -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p tcp --sport 179 -j ACCEPT") - + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p tcp --dport 179 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -p tcp --sport 179 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p tcp --dport 179 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p tcp --sport 179 -j ACCEPT") # Get current ACL tables and rules from Config DB - self._tables_db_info = self.config_db.get_table(self.ACL_TABLE) - self._rules_db_info = self.config_db.get_table(self.ACL_RULE) + self._tables_db_info = self.config_db_map[namespace].get_table(self.ACL_TABLE) + self._rules_db_info = self.config_db_map[namespace].get_table(self.ACL_RULE) num_ctrl_plane_acl_rules = 0 @@ -280,11 +328,11 @@ class ControlPlaneAclManager(object): for acl_service in acl_services: if acl_service not in self.ACL_SERVICES: log_warning("Ignoring control plane ACL '{}' with unrecognized service '{}'" - .format(table_name, acl_service)) + .format(table_name, acl_service)) continue log_info("Translating ACL rules for control plane ACL '{}' (service: '{}')" - .format(table_name, acl_service)) + .format(table_name, acl_service)) # Obtain default IP protocol(s) and destination port(s) for this service ip_protocols = self.ACL_SERVICES[acl_service]["ip_protocols"] @@ -315,18 +363,18 @@ class ControlPlaneAclManager(object): if (self.is_rule_ipv6(rule_props) and (table_ip_version == 4)): log_error("CtrlPlane ACL table {} is a IPv4 based table and rule {} is a IPV6 rule! Ignoring rule." - .format(table_name, rule_id)) + .format(table_name, rule_id)) acl_rules.pop(rule_props["PRIORITY"]) elif (self.is_rule_ipv4(rule_props) and (table_ip_version == 6)): log_error("CtrlPlane ACL table {} is a IPv6 based table and rule {} is a IPV4 rule! Ignroing rule." - .format(table_name, rule_id)) + .format(table_name, rule_id)) acl_rules.pop(rule_props["PRIORITY"]) # If we were unable to determine whether this ACL table contains # IPv4 or IPv6 rules, log a message and skip processing this table. if not table_ip_version: log_warning("Unable to determine if ACL table '{}' contains IPv4 or IPv6 rules. Skipping table..." - .format(table_name)) + .format(table_name)) continue # For each ACL rule in this table (in descending order of priority) @@ -358,64 +406,91 @@ class ControlPlaneAclManager(object): tcp_flags_mask = int(tcp_flags_mask, 16) if tcp_flags_mask > 0: - rule_cmd += " --tcp-flags {mask} {flags}".format(mask = self.parse_int_to_tcp_flags(tcp_flags_mask), flags = self.parse_int_to_tcp_flags(tcp_flags)) + rule_cmd += " --tcp-flags {mask} {flags}".format(mask=self.parse_int_to_tcp_flags(tcp_flags_mask), flags=self.parse_int_to_tcp_flags(tcp_flags)) # Append the packet action as the jump target rule_cmd += " -j {}".format(rule_props["PACKET_ACTION"]) - iptables_cmds.append(rule_cmd) + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + rule_cmd) num_ctrl_plane_acl_rules += 1 # Add iptables commands to block ip2me traffic - iptables_cmds += self.generate_block_ip2me_traffic_iptables_commands() + iptables_cmds += self.generate_block_ip2me_traffic_iptables_commands(namespace) # Add iptables/ip6tables commands to allow all incoming packets with TTL of 0 or 1 # This allows the device to respond to tools like tcptraceroute - iptables_cmds.append("iptables -A INPUT -m ttl --ttl-lt 2 -j ACCEPT") - iptables_cmds.append("ip6tables -A INPUT -p tcp -m hl --hl-lt 2 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -m ttl --ttl-lt 2 -j ACCEPT") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -p tcp -m hl --hl-lt 2 -j ACCEPT") # Finally, if the device has control plane ACLs configured, # add iptables/ip6tables commands to drop all other incoming packets if num_ctrl_plane_acl_rules > 0: - iptables_cmds.append("iptables -A INPUT -j DROP") - iptables_cmds.append("ip6tables -A INPUT -j DROP") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "iptables -A INPUT -j DROP") + iptables_cmds.append(self.iptables_cmd_ns_prefix[namespace] + "ip6tables -A INPUT -j DROP") return iptables_cmds - def update_control_plane_acls(self): + def update_control_plane_acls(self, namespace): """ Convenience wrapper which retrieves current ACL tables and rules from Config DB, translates control plane ACLs into a list of iptables commands and runs them. """ - iptables_cmds = self.get_acl_rules_and_translate_to_iptables_commands() - + iptables_cmds = self.get_acl_rules_and_translate_to_iptables_commands(namespace) log_info("Issuing the following iptables commands:") for cmd in iptables_cmds: log_info(" " + cmd) self.run_commands(iptables_cmds) - def notification_handler(self, key, data): - log_info("ACL configuration changed. Updating iptables rules for control plane ACLs...") - self.update_control_plane_acls() - def run(self): - # Unconditionally update control plane ACLs once at start - self.update_control_plane_acls() - - # Subscribe to notifications when ACL tables or rules change - self.config_db.subscribe(self.ACL_TABLE, - lambda table, key, data: self.notification_handler(key, data)) - self.config_db.subscribe(self.ACL_RULE, - lambda table, key, data: self.notification_handler(key, data)) - - # Indefinitely listen for Config DB notifications - self.config_db.listen() - + # Select Time-out for 10 Seconds + SELECT_TIMEOUT_MS = 1000 * 10 + + # Initlaize Global config that loads all database*.json + if device_info.is_multi_npu(): + swsscommon.SonicDBConfig.initializeGlobalConfig() + + # Create the Select object + sel = swsscommon.Select() + # Map of Namespace <--> susbcriber table's object + config_db_subscriber_table_map = {} + + # Loop through all asic namespaces (if present) and host (namespace='') + for namespace in self.config_db_map.keys(): + # Unconditionally update control plane ACLs once at start on given namespace + self.update_control_plane_acls(namespace) + # Connect to Config DB of given namespace + acl_db_connector = swsscommon.DBConnector("CONFIG_DB", 0, False, namespace) + # Subscribe to notifications when ACL tables changes + subscribe_acl_table = swsscommon.SubscriberStateTable(acl_db_connector, swsscommon.CFG_ACL_TABLE_TABLE_NAME) + # Subscribe to notifications when ACL rule tables changes + subscribe_acl_rule_table = swsscommon.SubscriberStateTable(acl_db_connector, swsscommon.CFG_ACL_RULE_TABLE_NAME) + # Add both tables to the selectable object + sel.addSelectable(subscribe_acl_table) + sel.addSelectable(subscribe_acl_rule_table) + # Update the map + config_db_subscriber_table_map[namespace] = [] + config_db_subscriber_table_map[namespace].append(subscribe_acl_table) + config_db_subscriber_table_map[namespace].append(subscribe_acl_rule_table) + + # Loop on select to see if any event happen on config db of any namespace + while True: + (state, c) = sel.select(SELECT_TIMEOUT_MS) + # Continue if select is timeout or selectable object is not return + if state != swsscommon.Select.OBJECT: + continue + # Get the corresponding namespace from selectable object + namespace = c.getDbNamespace() + # Pop data of both Subscriber Table object of namespace that got config db acl table event + for table in config_db_subscriber_table_map[namespace]: + table.pop() + # Update the Control Plane ACL of the namespace that got config db acl table event + self.update_control_plane_acls(namespace) # ============================= Functions ============================= + def main(): log_info("Starting up...") diff --git a/files/image_config/hostcfgd/hostcfgd b/files/image_config/hostcfgd/hostcfgd index 3a895a729b19..29c88eb6456a 100755 --- a/files/image_config/hostcfgd/hostcfgd +++ b/files/image_config/hostcfgd/hostcfgd @@ -41,12 +41,16 @@ def obfuscate(data): return data -def update_feature_state(feature_name, state): +def update_feature_state(feature_name, state, has_timer=False): + feature_suffixes = ["service"] + (["timer"] if has_timer else []) if state == "enabled": start_cmds = [] - start_cmds.append("sudo systemctl unmask {}.service".format(feature_name)) - start_cmds.append("sudo systemctl enable {}.service".format(feature_name)) - start_cmds.append("sudo systemctl start {}.service".format(feature_name)) + for suffix in feature_suffixes: + start_cmds.append("sudo systemctl unmask {}.{}".format(feature_name, suffix)) + start_cmds.append("sudo systemctl enable {}.{}".format(feature_name, suffix)) + # If feature has timer associated with it, start corresponding systemd .timer unit + # otherwise, start corresponding systemd .service unit + start_cmds.append("sudo systemctl start {}.{}".format(feature_name, feature_suffixes[-1])) for cmd in start_cmds: syslog.syslog(syslog.LOG_INFO, "Running cmd: '{}'".format(cmd)) try: @@ -55,12 +59,14 @@ def update_feature_state(feature_name, state): syslog.syslog(syslog.LOG_ERR, "'{}' failed. RC: {}, output: {}" .format(err.cmd, err.returncode, err.output)) continue - syslog.syslog(syslog.LOG_INFO, "Feature '{}' is enabled and started".format(feature_name)) + syslog.syslog(syslog.LOG_INFO, "Feature '{}.{}' is enabled and started" + .format(feature_name, feature_suffixes[-1])) elif state == "disabled": stop_cmds = [] - stop_cmds.append("sudo systemctl stop {}.service".format(feature_name)) - stop_cmds.append("sudo systemctl disable {}.service".format(feature_name)) - stop_cmds.append("sudo systemctl mask {}.service".format(feature_name)) + for suffix in reversed(feature_suffixes): + stop_cmds.append("sudo systemctl stop {}.{}".format(feature_name, suffix)) + stop_cmds.append("sudo systemctl disable {}.{}".format(feature_name, suffix)) + stop_cmds.append("sudo systemctl mask {}.{}".format(feature_name, suffix)) for cmd in stop_cmds: syslog.syslog(syslog.LOG_INFO, "Running cmd: '{}'".format(cmd)) try: @@ -71,7 +77,8 @@ def update_feature_state(feature_name, state): continue syslog.syslog(syslog.LOG_INFO, "Feature '{}' is stopped and disabled".format(feature_name)) else: - syslog.syslog(syslog.LOG_ERR, "Unexpected state value '{}' for feature '{}'".format(state, feature_name)) + syslog.syslog(syslog.LOG_ERR, "Unexpected state value '{}' for feature '{}'" + .format(state, feature_name)) class Iptables(object): @@ -284,7 +291,7 @@ class HostConfigDaemon: syslog.syslog(syslog.LOG_WARNING, "Eanble state of feature '{}' is None".format(feature_name)) continue - update_feature_state(feature_name, state) + update_feature_state(feature_name, state, feature_table[feature_name]['has_timer']) def aaa_handler(self, key, data): self.aaacfg.aaa_update(key, data) @@ -326,7 +333,7 @@ class HostConfigDaemon: syslog.syslog(syslog.LOG_WARNING, "Enable state of feature '{}' is None".format(feature_name)) return - update_feature_state(feature_name, state) + update_feature_state(feature_name, state, feature_table[feature_name]['has_timer']) def start(self): # Update all feature states once upon starting diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index b5352745a7ef..688b2f8433a5 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -18,8 +18,14 @@ else echo "{ \"ZTP_DHCP_DISABLED\" : \"true\" }" > /tmp/ztp_input.json fi -# Create /e/n/i file for existing and active interfaces -sonic-cfggen -d -j /tmp/ztp_input.json -t /usr/share/sonic/templates/interfaces.j2 > /etc/network/interfaces +# Create /e/n/i file for existing and active interfaces, dhcp6 sytcl.conf and dhclient.conf +CFGGEN_PARAMS=" \ + -d -j /tmp/ztp_input.json \ + -t /usr/share/sonic/templates/interfaces.j2,/etc/network/interfaces \ + -t /usr/share/sonic/templates/90-dhcp6-systcl.conf.j2,/etc/sysctl.d/90-dhcp6-systcl.conf \ + -t /usr/share/sonic/templates/dhclient.conf.j2,/etc/dhcp/dhclient.conf \ +" +sonic-cfggen $CFGGEN_PARAMS [ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid [ -f /var/run/dhclient6.eth0.pid ] && kill `cat /var/run/dhclient6.eth0.pid` && rm -f /var/run/dhclient6.eth0.pid @@ -28,11 +34,9 @@ for intf_pid in $(ls -1 /var/run/dhclient*.Ethernet*.pid 2> /dev/null); do [ -f ${intf_pid} ] && kill `cat ${intf_pid}` && rm -f ${intf_pid} done -sonic-cfggen -d -j /tmp/ztp_input.json -t /usr/share/sonic/templates/90-dhcp6-systcl.conf.j2 > /etc/sysctl.d/90-dhcp6-systcl.conf # Read sysctl conf files again sysctl -p /etc/sysctl.d/90-dhcp6-systcl.conf -sonic-cfggen -d -j /tmp/ztp_input.json -t /usr/share/sonic/templates/dhclient.conf.j2 > /etc/dhcp/dhclient.conf systemctl restart networking # Clean-up created files diff --git a/files/initramfs-tools/arista-convertfs.j2 b/files/initramfs-tools/arista-convertfs.j2 index 0dad56e5776b..348272c59554 100644 --- a/files/initramfs-tools/arista-convertfs.j2 +++ b/files/initramfs-tools/arista-convertfs.j2 @@ -213,6 +213,9 @@ umount "$root_mnt" if [ $(echo -n "$root_dev" | tail -c 1) == "1" ]; then # Create a new partition table (content in flash_dev will be deleted) + err_msg="Error: Failed to zero out first MB" + cmd="dd if=/dev/zero of=$flash_dev bs=512 count=2048" + run_cmd "$cmd" "$err_msg" err_msg="Error: repartitioning $flash_dev failed" cmd="echo '2048' | sfdisk $flash_dev || (sleep 3; blockdev --rereadpt $flash_dev && fdisk -l $flash_dev | grep -q ${root_dev}.*Linux)" run_cmd "$cmd" "$err_msg" diff --git a/files/scripts/bgp.sh b/files/scripts/bgp.sh index 5da8c35cf064..b7a383ebbdd7 100755 --- a/files/scripts/bgp.sh +++ b/files/scripts/bgp.sh @@ -31,9 +31,9 @@ function validate_restore_count() function check_fast_boot () { if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then - FAST_BOOT = "true" + FAST_BOOT="true" else - FAST_BOOT = "false" + FAST_BOOT="false" fi } diff --git a/files/scripts/radv.sh b/files/scripts/radv.sh new file mode 100755 index 000000000000..1047808e4e44 --- /dev/null +++ b/files/scripts/radv.sh @@ -0,0 +1,84 @@ +#!/bin/bash + +function debug() +{ + /usr/bin/logger $1 + /bin/echo `date` "- $1" >> ${DEBUGLOG} +} + +function check_warm_boot() +{ + SYSTEM_WARM_START=`$SONIC_DB_CLI STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable` + SERVICE_WARM_START=`$SONIC_DB_CLI STATE_DB hget "WARM_RESTART_ENABLE_TABLE|${SERVICE}" enable` + if [[ x"$SYSTEM_WARM_START" == x"true" ]] || [[ x"$SERVICE_WARM_START" == x"true" ]]; then + WARM_BOOT="true" + else + WARM_BOOT="false" + fi +} + +function check_fast_boot () +{ + if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + FAST_BOOT="true" + else + FAST_BOOT="false" + fi +} + +start() { + debug "Starting ${SERVICE}$DEV service..." + + check_warm_boot + check_fast_boot + debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}." + debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}." + + # start service docker + /usr/bin/${SERVICE}.sh start $DEV + debug "Started ${SERVICE}$DEV service..." +} + +wait() { + /usr/bin/${SERVICE}.sh wait $DEV +} + +stop() { + debug "Stopping ${SERVICE}$DEV service..." + + check_warm_boot + check_fast_boot + debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}." + debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}." + + # For WARM/FAST boot do not perform service stop + if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then + /usr/bin/${SERVICE}.sh stop $DEV + debug "Stopped ${SERVICE}$DEV service..." + else + debug "Killing Docker radv..." + /usr/bin/docker kill radv &> /dev/null || debug "Docker radv is not running ($?) ..." + fi +} + +DEV=$2 + +SERVICE="radv" +DEBUGLOG="/tmp/radv-debug$DEV.log" +NAMESPACE_PREFIX="asic" +if [ "$DEV" ]; then + NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace + SONIC_DB_CLI="sonic-db-cli -n $NET_NS" +else + SONIC_DB_CLI="sonic-db-cli" +fi + +case "$1" in + start|wait|stop) + $1 + ;; + *) + echo "Usage: $0 {start|wait|stop}" + exit 1 + ;; +esac diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index 74828c740fe1..0ef605fd83c8 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -37,6 +37,15 @@ function check_warm_boot() fi } +function check_fast_boot() +{ + if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + FAST_BOOT="true" + else + FAST_BOOT="false" + fi +} + function validate_restore_count() { if [[ x"$WARM_BOOT" == x"true" ]]; then @@ -99,8 +108,8 @@ start_peer_and_dependent_services() { } stop_peer_and_dependent_services() { - # if warm start enabled or peer lock exists, don't stop peer service docker - if [[ x"$WARM_BOOT" != x"true" ]]; then + # if warm/fast start enabled or peer lock exists, don't stop peer service docker + if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then if [[ ! -z $DEV ]]; then /bin/systemctl stop ${PEER}@$DEV else @@ -185,17 +194,26 @@ stop() { lock_service_state_change check_warm_boot debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}." + check_fast_boot + debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}." - /usr/bin/${SERVICE}.sh stop $DEV - debug "Stopped ${SERVICE}$DEV service..." + # For WARM/FAST boot do not perform service stop + if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then + /usr/bin/${SERVICE}.sh stop $DEV + debug "Stopped ${SERVICE}$DEV service..." + else + debug "Killing Docker swss..." + /usr/bin/docker kill swss &> /dev/null || debug "Docker swss is not running ($?) ..." + fi # Flush FAST_REBOOT table when swss needs to stop. The only # time when this would take effect is when fast-reboot # encountered error, e.g. syncd crashed. And swss needs to # be restarted. - debug "Clearing FAST_REBOOT flag..." - clean_up_tables STATE_DB "'FAST_REBOOT*'" - + if [[ x"$FAST_BOOT" != x"true" ]]; then + debug "Clearing FAST_REBOOT flag..." + clean_up_tables STATE_DB "'FAST_REBOOT*'" + fi # Unlock has to happen before reaching out to peer service unlock_service_state_change diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index 5c0bf0fad3f2..77d887095c33 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 5c0bf0fad3f2e2ac9fa9034c99f216cd7604ccf8 +Subproject commit 77d887095c331ddff0bc681edfc6a6dd66d96228 diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules index 972f49ff91d0..7b430e9bd284 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules @@ -3,6 +3,7 @@ PACKAGE_NAME := sonic-platform-modules-bfn-montara SCRIPT_SRC := $(shell pwd)/scripts CONFIGS_SRC := $(shell pwd)/configs +PLUGINS_DIR := $(shell pwd)/plugins %: dh $@ @@ -12,6 +13,8 @@ override_dh_auto_install: cp -r $(SCRIPT_SRC)/* debian/$(PACKAGE_NAME)/usr/local/bin dh_installdirs -p$(PACKAGE_NAME) etc/network/interfaces.d/ cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_NAME)/etc/network/interfaces.d/ + dh_installdirs -p$(PACKAGE_NAME) usr/share/sonic/device/x86_64-accton_wedge100bf_32x-r0/plugins + cp -r $(PLUGINS_DIR)/* debian/$(PACKAGE_NAME)/usr/share/sonic/device/x86_64-accton_wedge100bf_32x-r0/plugins/ override_dh_usrlocal: diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/plugins/pcie.yaml b/platform/barefoot/sonic-platform-modules-bfn-montara/plugins/pcie.yaml new file mode 100644 index 000000000000..ab38096c9740 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/plugins/pcie.yaml @@ -0,0 +1,412 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: 1d + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '00' + dev: 1f + fn: '6' + id: 8c24 + name: 'Signal processing controller: Intel Corporation 8 Series Chipset Family Thermal + Management Controller (rev 05)' +- bus: '02' + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 10a6 + name: 'Unassigned class [ff00]: Intel Corporation 82599EB 10-Gigabit Dummy Function' +- bus: '05' + dev: '00' + fn: '0' + id: '0010' + name: 'Unassigned class [ff00]: Device 1d1c:0010 (rev 10)' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: 6f76 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link Debug (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '2' + id: 6fe2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '3' + id: 6fe3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules index 951069a6016a..cb033bae0514 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules @@ -8,6 +8,7 @@ KERNEL_SRC := /lib/modules/$(KVERSION) MODULE_SRC := $(shell pwd)/modules SCRIPT_SRC := $(shell pwd)/scripts CONFIGS_SRC := $(shell pwd)/configs +PLUGINS_DIR := $(shell pwd)/plugins %: dh $@ @@ -22,6 +23,8 @@ override_dh_auto_install: cp -r $(SCRIPT_SRC)/* debian/$(PACKAGE_NAME)/usr/local/bin dh_installdirs -p$(PACKAGE_NAME) etc/network/interfaces.d/ cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_NAME)/etc/network/interfaces.d/ + dh_installdirs -p$(PACKAGE_NAME) usr/share/sonic/device/x86_64-accton_as9516bf_32d-r0/plugins + cp -r $(PLUGINS_DIR)/* debian/$(PACKAGE_NAME)/usr/share/sonic/device/x86_64-accton_as9516bf_32d-r0/plugins/ override_dh_usrlocal: diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/plugins/pcie.yaml b/platform/barefoot/sonic-platform-modules-bfn-newport/plugins/pcie.yaml new file mode 100644 index 000000000000..c45064a9f73c --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/plugins/pcie.yaml @@ -0,0 +1,428 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '16' + fn: '0' + id: 8c3a + name: 'Communication controller: Intel Corporation 8 Series/C220 Series Chipset + Family MEI Controller #1 (rev 04)' +- bus: '00' + dev: '16' + fn: '1' + id: 8c3b + name: 'Communication controller: Intel Corporation 8 Series/C220 Series Chipset + Family MEI Controller #2 (rev 04)' +- bus: '00' + dev: 1c + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: 1d + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '02' + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '04' + dev: '00' + fn: '1' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '06' + dev: '00' + fn: '0' + id: '0100' + name: 'Ethernet controller: Device 1d1c:0100' +- bus: '07' + dev: '00' + fn: '0' + id: 01f0 + name: 'Memory controller: Device 1d1c:01f0' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: 6f76 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link Debug (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '2' + id: 6fe2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '3' + id: 6fe3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index a2232367fd27..00aaae57b4fa 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,8 +1,8 @@ -BRCM_SAI = libsaibcm_3.7.5.1-2_amd64.deb -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.7/master/libsaibcm_3.7.5.1-2_amd64.deb?sv=2015-04-05&sr=b&sig=Ir7VDgFPOs4mU0k%2Fu76shUBpysh46Q1Btt0i%2FdhM0Ig%3D&se=2034-04-14T01%3A19%3A11Z&sp=r" -BRCM_SAI_DEV = libsaibcm-dev_3.7.5.1-2_amd64.deb +BRCM_SAI = libsaibcm_3.7.5.1-3_amd64.deb +$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.7/master/libsaibcm_3.7.5.1-3_amd64.deb?sv=2015-04-05&sr=b&sig=hwGt%2Fw1fWhauEsCXBTBmC3vC8G90iJT4DEp%2Bznwh4WY%3D&se=2034-04-16T01%3A02%3A17Z&sp=r" +BRCM_SAI_DEV = libsaibcm-dev_3.7.5.1-3_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.7/master/libsaibcm-dev_3.7.5.1-2_amd64.deb?sv=2015-04-05&sr=b&sig=sBiXxx2vncp0GLHIPx4IyiJQBqFV%2BGWUmdr7ccrnsT4%3D&se=2034-04-14T01%3A18%3A39Z&sp=r" +$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/3.7/master/libsaibcm-dev_3.7.5.1-3_amd64.deb?sv=2015-04-05&sr=b&sig=nuyZOMB%2BnmDIROP60UAiDl9eG0YHAEj6u8ViTlEqjf0%3D&se=2034-04-16T01%3A01%3A51Z&sp=r" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54t/modules/accton_as5835_54t_cpld.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54t/modules/accton_as5835_54t_cpld.c old mode 100644 new mode 100755 index ae773b4d8209..9765fd430432 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54t/modules/accton_as5835_54t_cpld.c +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54t/modules/accton_as5835_54t_cpld.c @@ -225,7 +225,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da, struct i2c_client *client = to_i2c_client(dev); struct as5835_54t_cpld_data *data = i2c_get_clientdata(client); int status = 0; - u8 reg = 0, mask = 0, revert = 0; + u8 reg = 0, mask = 0, invert = 0; switch (attr->index) { case MODULE_PRESENT_49 ... MODULE_PRESENT_54: @@ -239,13 +239,14 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da, case MODULE_RESET_49 ... MODULE_RESET_54: reg = 0x15; mask = 0x1 << (attr->index - MODULE_RESET_49); + invert = 1; break; default: return 0; } if (attr->index >= MODULE_PRESENT_49 && attr->index <= MODULE_PRESENT_54) { - revert = 1; + invert = 1; } mutex_lock(&data->update_lock); @@ -255,7 +256,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da, } mutex_unlock(&data->update_lock); - return sprintf(buf, "%d\n", revert ? !(status & mask) : !!(status & mask)); + return sprintf(buf, "%d\n", invert ? !(status & mask) : !!(status & mask)); exit: mutex_unlock(&data->update_lock); @@ -298,6 +299,9 @@ static ssize_t set_control(struct device *dev, struct device_attribute *da, } /* Update tx_disable/lpmode/reset status */ + if (attr->index >= MODULE_RESET_49 && attr->index <= MODULE_RESET_54) { + value = !value; + } if (value) { status |= mask; } diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py index a07ab1a1bc7e..88d5bc254628 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py @@ -291,6 +291,9 @@ def device_install(): print output if FORCE == 0: return status + for i in range(49, 55): #Set qsfp port to normal state + log_os_system("echo 0 > /sys/bus/i2c/devices/3-0062/module_reset_" + str(i), 1) + for i in range(0,len(sfp_map)): status, output =log_os_system("echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device", 1) if status: diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_cpld.c b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_cpld.c old mode 100644 new mode 100755 index c9d4f1c31e5e..97b7d879f03a --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_cpld.c +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/modules/accton_as5835_54x_cpld.c @@ -678,7 +678,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da, struct i2c_client *client = to_i2c_client(dev); struct as5835_54x_cpld_data *data = i2c_get_clientdata(client); int status = 0; - u8 reg = 0, mask = 0, revert = 0; + u8 reg = 0, mask = 0, invert = 0; switch (attr->index) { case MODULE_PRESENT_1 ... MODULE_PRESENT_8: @@ -804,13 +804,14 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da, case MODULE_RESET_49 ... MODULE_RESET_54: reg = 0x15; mask = 0x1 << (attr->index - MODULE_RESET_49); + invert = 1; break; default: return 0; } if (attr->index >= MODULE_PRESENT_1 && attr->index <= MODULE_PRESENT_54) { - revert = 1; + invert = 1; } mutex_lock(&data->update_lock); @@ -820,7 +821,7 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da, } mutex_unlock(&data->update_lock); - return sprintf(buf, "%d\n", revert ? !(status & mask) : !!(status & mask)); + return sprintf(buf, "%d\n", invert ? !(status & mask) : !!(status & mask)); exit: mutex_unlock(&data->update_lock); @@ -891,6 +892,9 @@ static ssize_t set_control(struct device *dev, struct device_attribute *da, } /* Update tx_disable/lpmode/reset status */ + if (attr->index >= MODULE_RESET_49 && attr->index <= MODULE_RESET_54) { + value = !value; + } if (value) { status |= mask; } diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py index b712b8c940ac..615bf6ea208f 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py @@ -314,6 +314,10 @@ def device_install(): print output if FORCE == 0: return status + + for i in range(49, 55): #Set qsfp port to normal state + log_os_system("echo 0 > /sys/bus/i2c/devices/3-0062/module_reset_" + str(i), 1) + for i in range(0,len(sfp_map)): if i < qsfp_start: status, output =log_os_system("echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device", 1) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/x86-64-accton-as7816-64x-fan.c b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/x86-64-accton-as7816-64x-fan.c index 3de2c200e1e1..2cd85c43a9c2 100644 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/x86-64-accton-as7816-64x-fan.c +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/modules/x86-64-accton-as7816-64x-fan.c @@ -176,7 +176,6 @@ static struct attribute *as7816_64x_fan_attributes[] = { #define FAN_DUTY_CYCLE_REG_MASK 0xF #define FAN_MAX_DUTY_CYCLE 100 -#define FAN_REG_VAL_TO_SPEED_RPM_STEP 100 static int as7816_64x_fan_read_value(struct i2c_client *client, u8 reg) { @@ -220,7 +219,14 @@ static u8 duty_cycle_to_reg_val(u8 duty_cycle) static u32 reg_val_to_speed_rpm(u8 reg_val) { - return (u32)reg_val * FAN_REG_VAL_TO_SPEED_RPM_STEP; + if (reg_val == 0 || reg_val == 255) { + return 0; + } else { + u64 f, dv; + dv = 2 * 2 * 40960 * (u64)(255 - reg_val); + f = 60000000000 / dv; + return (u32)f; + } } static u8 reg_val_to_direction(u8 reg_val, enum fan_id id) diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index 5c0bf0fad3f2..77d887095c33 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit 5c0bf0fad3f2e2ac9fa9034c99f216cd7604ccf8 +Subproject commit 77d887095c331ddff0bc681edfc6a6dd66d96228 diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install index 74000c147993..a3f2bbbc86b4 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install @@ -10,6 +10,7 @@ s6100/scripts/platform_reboot_override usr/share/sonic/device/x86_64-dell_s6100_ s6100/scripts/fast-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/track_reboot_reason.sh usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/warm-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 +s6100/scripts/ssd-fw-upgrade usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/override.conf /etc/systemd/system/systemd-reboot.service.d common/dell_lpc_mon.sh usr/local/bin s6100/scripts/platform_sensors.py usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_override b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_override index dcec8067054a..b971c26f4fc2 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_override +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_override @@ -12,6 +12,11 @@ def log_software_reboot(): res = subprocess.check_output(['/usr/share/sonic/device/x86_64-dell_s6100_c2538-r0/fast-reboot_plugin']) return +def ssd_hdparm_upgrade(): + if os.path.exists('/tmp/SSD/SYS_S.bin'): + res = subprocess.check_output(['/usr/share/sonic/device/x86_64-dell_s6100_c2538-r0/ssd-fw-upgrade', 'hdparm-upgrade']) + return + def portio_reg_write(resource, offset, val): fd = os.open(resource, os.O_RDWR) if(fd < 0): @@ -28,5 +33,6 @@ def portio_reg_write(resource, offset, val): if __name__ == "__main__": log_software_reboot() + ssd_hdparm_upgrade() portio_reg_write(PORT_RES, 0xcf9, 0xe) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/ssd-fw-upgrade b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/ssd-fw-upgrade new file mode 100755 index 000000000000..0db6b1f62c66 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/ssd-fw-upgrade @@ -0,0 +1,100 @@ +#!/bin/bash +# This script does the SSD firware upgrade +# This has been integrated as part of reboot/warm-reboot/fast-reboot script. +SKIP_UPGRADE=0 +CHECKSUM_VALUE="b9b6dbb362b7632837af9cd320c5d147" +unmount () { + exist=$(mount | grep " $1 " | wc -l) + if [ $exist -ne 0 ]; then + umount $1 + if [[ $? -ne 0 ]]; then + fuser -vm $1 + SKIP_UPGRADE=1 + fi + fi +} + +mp_tool_reboot() { + if [ ! -d /mnt/ramdisk ]; then + mkdir -p /mnt/ramdisk; + fi + mount -t tmpfs -o size=16m swap /mnt/ramdisk + cp /tmp/SSD.zip /mnt/ramdisk/ + cd /mnt/ramdisk + unzip -q SSD.zip + chmod +x SSD/mp_64 + + #stopped journal and syslog services to unmount /host + systemctl stop systemd-journald.service + systemctl stop systemd-journald.socket + systemctl stop systemd-journald-audit.socket + systemctl stop systemd-journald-dev-log.socket + systemctl stop syslog.service + systemctl stop syslog.socket + systemctl stop docker.socket + sleep 2 + unmount /var/log + loop_exist=$(losetup -a | grep loop1 | wc -l) + if [ $loop_exist -ne 0 ]; then + losetup -d /dev/loop1 + fi + unmount /boot + unmount /var/lib/docker + unmount /host + #start the services whichever we stopped for succesful /host unmount + systemctl start systemd-journald.service + systemctl start systemd-journald.socket + systemctl start systemd-journald-audit.socket + systemctl start systemd-journald-dev-log.socket + systemctl start syslog.service + systemctl start syslog.socket + if [ $SKIP_UPGRADE == 0 ]; then + echo 1 > /sys/class/scsi_device/4\:0\:0\:0/device/delete + echo "0 0 0" > /sys/class/scsi_host/host4/scan + sleep 3 + DEVICE=$(dmesg | grep "Attached SCSI disk" | sed -n \$p | + grep -o -P '(sd[a-z])') + cd /mnt/ramdisk/SSD + ./mp_64 -d /dev/${DEVICE} -c 1 -u -k -r + fi +} + +hdparm-upgrade() { + if [[ -x "$(command -v hdparm)" ]];then + hdparm --fwdownload /tmp/SSD/SYS_S.bin --yes-i-know-what-i-am-doing \ + --please-destroy-my-drive /dev/sda + fi +} + +platform_check() { + platform=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + version_type=$(dmesg | grep "mSATA") + md5sum_value=$(md5sum /tmp/SSD.zip | cut -d ' ' -f1) + if [[ "$md5sum_value" != "$CHECKSUM_VALUE" || "$platform" != *"s6100"* || + "$version_type" != *"3IE3"* || "$version_type" != *"S16425c1"* ]];then + exit 1 + fi +} + +if [[ ! -f /tmp/SSD.zip ]];then + exit 1 +fi + +case "$1" in + fast-reboot|warm-reboot) + platform_check + mp_tool_reboot + ;; + reboot) + platform_check + cd /tmp + unzip -q SSD.zip + ;; + hdparm-upgrade) + $1 + ;; + *) + echo "Usage: $0 {fast-reboot|warm-reboot|reboot|hdparm-upgrade}" >&2 + exit 2 + ;; +esac diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 35265337fe21..83ae59308ed8 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -11,17 +11,17 @@ else FW_FROM_URL = n endif -MLNX_SPC_FW_VERSION = 13.2007.1280 +MLNX_SPC_FW_VERSION = 13.2008.1310 MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa $(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE) -MLNX_SPC2_FW_VERSION = 29.2007.1280 +MLNX_SPC2_FW_VERSION = 29.2008.1310 MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa $(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE) -MLNX_SPC3_FW_VERSION = 30.2007.1280 +MLNX_SPC3_FW_VERSION = 30.2008.1310 MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa $(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE) diff --git a/platform/mellanox/mlnx-ffb.sh b/platform/mellanox/mlnx-ffb.sh index 1488bb2c6b97..d0bef9d57761 100755 --- a/platform/mellanox/mlnx-ffb.sh +++ b/platform/mellanox/mlnx-ffb.sh @@ -23,8 +23,8 @@ check_sdk_upgrade() { CHECK_RESULT="${FFB_FAILURE}" - NEXT_SONIC_IMAGE="$(sonic_installer list | grep "Next: " | cut -f2 -d' ')" - CURRENT_SONIC_IMAGE="$(sonic_installer list | grep "Current: " | cut -f2 -d' ')" + NEXT_SONIC_IMAGE="$(sonic-installer list | grep "Next: " | cut -f2 -d' ')" + CURRENT_SONIC_IMAGE="$(sonic-installer list | grep "Current: " | cut -f2 -d' ')" FS_PATH="/host/image-${NEXT_SONIC_IMAGE#SONiC-OS-}/fs.squashfs" FS_MOUNTPOINT="/tmp/image-${NEXT_SONIC_IMAGE#SONiC-OS-}-fs" diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index d0f69c35e0bc..c24c5b006f49 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -217,8 +217,8 @@ function UpgradeFW() { } function UpgradeFWFromImage() { - local -r _NEXT_SONIC_IMAGE="$(sonic_installer list | grep "Next: " | cut -f2 -d' ')" - local -r _CURRENT_SONIC_IMAGE="$(sonic_installer list | grep "Current: " | cut -f2 -d' ')" + local -r _NEXT_SONIC_IMAGE="$(sonic-installer list | grep "Next: " | cut -f2 -d' ')" + local -r _CURRENT_SONIC_IMAGE="$(sonic-installer list | grep "Current: " | cut -f2 -d' ')" local -r _FS_PATH="/host/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}/fs.squashfs" local -r _FS_MOUNTPOINT="/tmp/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}-fs" diff --git a/platform/mellanox/mlnx-platform-api.mk b/platform/mellanox/mlnx-platform-api.mk index c579b4539283..4abc0fda8d19 100644 --- a/platform/mellanox/mlnx-platform-api.mk +++ b/platform/mellanox/mlnx-platform-api.mk @@ -3,7 +3,7 @@ SONIC_PLATFORM_API_PY2 = mlnx_platform_api-1.0-py2-none-any.whl $(SONIC_PLATFORM_API_PY2)_SRC_PATH = $(PLATFORM_PATH)/mlnx-platform-api $(SONIC_PLATFORM_API_PY2)_PYTHON_VERSION = 2 -$(SONIC_PLATFORM_API_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_DAEMON_BASE_PY2) $(SONIC_CONFIG_ENGINE) +$(SONIC_PLATFORM_API_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_CONFIG_ENGINE) SONIC_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2) export mlnx_platform_api_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_API_PY2))" diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 67d8b6331ae3..afe0dd0cc19b 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -59,6 +59,8 @@ XCVR_HW_REV_WIDTH_OSFP = 2 XCVR_HW_REV_WIDTH_QSFP = 2 XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET = 64 +XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH = 1 XCVR_VENDOR_SN_OFFSET = 68 XCVR_VENDOR_SN_WIDTH = 16 XCVR_VENDOR_DATE_OFFSET = 84 @@ -826,7 +828,12 @@ def get_transceiver_info(self): for key in qsfp_compliance_code_tup: if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + sfp_ext_specification_compliance_raw = self._read_eeprom_specific_bytes(offset + XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET, XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH) + if sfp_ext_specification_compliance_raw is not None: + sfp_ext_specification_compliance_data = sfpi_obj.parse_ext_specification_compliance(sfp_ext_specification_compliance_raw[0 : 1], 0) + if sfp_ext_specification_compliance_data['data']['Extended Specification compliance']['value'] != "Unspecified": + compliance_code_dict['Extended Specification compliance'] = sfp_ext_specification_compliance_data['data']['Extended Specification compliance']['value'] transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index e465e2543ee3..61a209939c18 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,6 +1,6 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIRel1.16.5-sai16 +MLNX_SAI_VERSION = SAIRel1.17.0-master export MLNX_SAI_VERSION diff --git a/platform/mellanox/mlnx-sai/SAI-Implementation b/platform/mellanox/mlnx-sai/SAI-Implementation index 0ddcb4e6d12e..61e28bc2949c 160000 --- a/platform/mellanox/mlnx-sai/SAI-Implementation +++ b/platform/mellanox/mlnx-sai/SAI-Implementation @@ -1 +1 @@ -Subproject commit 0ddcb4e6d12efdd5255529ed53cc785351e8b3b3 +Subproject commit 61e28bc2949ce03d9fbf0da818cd7f7348ab209a diff --git a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers b/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers index 9dff92deb1f4..efac7c95806f 160000 --- a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers +++ b/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers @@ -1 +1 @@ -Subproject commit 9dff92deb1f4cafa2e5c5077c8a6e98f0fbf586e +Subproject commit efac7c95806fa6092c7995ca2605b3778f8e1dce diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index 973ea8294cf5..0abce26527b3 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -1,6 +1,6 @@ MLNX_SDK_BASE_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel/Switch-SDK-drivers/bin/ MLNX_SDK_PKG_BASE_PATH = $(MLNX_SDK_BASE_PATH)/$(BLDENV)/ -MLNX_SDK_VERSION = 4.4.0952 +MLNX_SDK_VERSION = 4.4.1306 MLNX_SDK_ISSU_VERSION = 101 MLNX_SDK_DEB_VERSION = $(subst _,.,$(MLNX_SDK_VERSION)) diff --git a/platform/p4/docker-sonic-p4/Dockerfile.j2 b/platform/p4/docker-sonic-p4/Dockerfile.j2 index 22621b985465..c0063af09bd1 100644 --- a/platform/p4/docker-sonic-p4/Dockerfile.j2 +++ b/platform/p4/docker-sonic-p4/Dockerfile.j2 @@ -78,6 +78,7 @@ COPY ["start.sh", "orchagent.sh", "config_bm.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["files/configdb-load.sh", "/usr/bin/"] COPY ["files/arp_update", "/usr/bin"] +COPY ["init_cfg.json", "/etc/sonic/"] RUN echo "docker-sonic-p4" > /etc/hostname RUN touch /etc/quagga/zebra.conf diff --git a/platform/p4/docker-sonic-p4/init_cfg.json.j2 b/platform/p4/docker-sonic-p4/init_cfg.json.j2 new file mode 100644 index 000000000000..a30ea5770dd3 --- /dev/null +++ b/platform/p4/docker-sonic-p4/init_cfg.json.j2 @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "synchronous_mode": {% if enable_synchronous_mode == "y" %}"enable"{% else %}"disable"{% endif %} + } + } +} diff --git a/platform/p4/docker-sonic-p4/orchagent.sh b/platform/p4/docker-sonic-p4/orchagent.sh index 9abfc22c967e..52cdd43265f0 100755 --- a/platform/p4/docker-sonic-p4/orchagent.sh +++ b/platform/p4/docker-sonic-p4/orchagent.sh @@ -13,6 +13,12 @@ ORCHAGENT_ARGS="-d /var/log/swss " # Set orchagent pop batch size to 8192 ORCHAGENT_ARGS+="-b 8192 " +# Set synchronous mode if it is enabled in CONFIG_DB +SYNC_MODE=$(sonic-cfggen -d -v DEVICE_METADATA.localhost.synchronous_mode) +if [ "$SYNC_MODE" == "enable" ]; then + ORCHAGENT_ARGS+="-s " +fi + # Set mac address ORCHAGENT_ARGS+="-m $MAC_ADDRESS" diff --git a/platform/p4/docker-sonic-p4/start.sh b/platform/p4/docker-sonic-p4/start.sh index e3251bb2f4e5..b3c451e7c3d4 100755 --- a/platform/p4/docker-sonic-p4/start.sh +++ b/platform/p4/docker-sonic-p4/start.sh @@ -8,7 +8,12 @@ if ! ip link show eth0 &> /dev/null; then fi SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') -sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' --print-data > /etc/sonic/init_cfg.json +if [ -f /etc/sonic/init_cfg.json ]; then + sonic-cfggen -j /etc/sonic/init_cfg.json -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' --print-data > /tmp/init_cfg.json + mv /tmp/init_cfg.json /etc/sonic/init_cfg.json +else + sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' --print-data > /etc/sonic/init_cfg.json +fi if [ -f /etc/sonic/config_db.json ]; then sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --print-data > /tmp/config_db.json diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index e96db2d79ddc..b3a6f1cefa9e 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -46,7 +46,8 @@ RUN apt-get install -y net-tools \ python-scapy \ conntrack \ iptables \ - python3-pip + python3-pip \ + jq RUN pip install setuptools RUN pip3 install setuptools @@ -127,11 +128,16 @@ COPY ["files/configdb-load.sh", "/usr/bin/"] COPY ["files/arp_update", "/usr/bin/"] COPY ["files/buffers_config.j2", "files/qos_config.j2", "/usr/share/sonic/templates/"] COPY ["files/sonic_version.yml", "/etc/sonic/"] +COPY ["init_cfg.json", "/etc/sonic/"] COPY ["database_config.json", "/etc/default/sonic-db/"] COPY ["hostname.j2", "/usr/share/sonic/templates/"] COPY ["default_chassis_cfg.json", "/etc/default/sonic-db/"] COPY ["chassis_db.py", "/usr/bin/"] +COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] +COPY ["hwsku.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/"] +COPY ["platform.json", "/usr/share/sonic/platform/"] + # Workaround the tcpdump issue RUN mv /usr/sbin/tcpdump /usr/bin/tcpdump diff --git a/platform/vs/docker-sonic-vs/hwsku.json b/platform/vs/docker-sonic-vs/hwsku.json new file mode 100644 index 000000000000..ed121868c9f5 --- /dev/null +++ b/platform/vs/docker-sonic-vs/hwsku.json @@ -0,0 +1,100 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet4": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet8": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet12": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet16": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet20": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet24": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet28": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet32": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet36": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet40": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet44": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet48": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet52": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet56": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet60": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet64": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet68": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet72": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet76": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet80": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet84": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet88": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet92": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet96": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet100": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet104": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet108": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet112": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet116": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet120": { + "default_brkout_mode": "1x100G[40G]" + }, + "Ethernet124": { + "default_brkout_mode": "1x100G[40G]" + } + } +} diff --git a/platform/vs/docker-sonic-vs/init_cfg.json.j2 b/platform/vs/docker-sonic-vs/init_cfg.json.j2 new file mode 100644 index 000000000000..a30ea5770dd3 --- /dev/null +++ b/platform/vs/docker-sonic-vs/init_cfg.json.j2 @@ -0,0 +1,7 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "synchronous_mode": {% if enable_synchronous_mode == "y" %}"enable"{% else %}"disable"{% endif %} + } + } +} diff --git a/platform/vs/docker-sonic-vs/orchagent.sh b/platform/vs/docker-sonic-vs/orchagent.sh index 2acd709a8e94..ec703fa10ee6 100755 --- a/platform/vs/docker-sonic-vs/orchagent.sh +++ b/platform/vs/docker-sonic-vs/orchagent.sh @@ -6,7 +6,8 @@ else export platform=$fake_platform fi -MAC_ADDRESS=$(sonic-cfggen -d -v 'DEVICE_METADATA.localhost.mac') +CFG_VARS=$(sonic-cfggen -d --var-json 'DEVICE_METADATA') +MAC_ADDRESS=$(echo $CFG_VARS | jq -r '.localhost.mac') if [ "$MAC_ADDRESS" == "None" ] || [ -z "$MAC_ADDRESS" ]; then MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') logger "Mac address not found in Device Metadata, Falling back to eth0" @@ -19,6 +20,12 @@ ORCHAGENT_ARGS="-d /var/log/swss " # Set orchagent pop batch size to 8192 ORCHAGENT_ARGS+="-b 8192 " +# Set synchronous mode if it is enabled in CONFIG_DB +SYNC_MODE=$(echo $CFG_VARS | jq -r '.localhost.synchronous_mode') +if [ "$SYNC_MODE" == "enable" ]; then + ORCHAGENT_ARGS+="-s " +fi + # Set mac address ORCHAGENT_ARGS+="-m $MAC_ADDRESS" diff --git a/platform/vs/docker-sonic-vs/platform.json b/platform/vs/docker-sonic-vs/platform.json new file mode 100644 index 000000000000..053fed5516ed --- /dev/null +++ b/platform/vs/docker-sonic-vs/platform.json @@ -0,0 +1,196 @@ +{ + "interfaces": { + "Ethernet0": { + "index": "0,0,0,0", + "lanes": "25,26,27,28", + "alias_at_lanes": "fortyGigE0/0,fortyGigE0/1,fortyGigE0/2,fortyGigE0/3", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet4": { + "index": "1,1,1,1", + "lanes": "29,30,31,32", + "alias_at_lanes": "fortyGigE0/4,fortyGigE0/5,fortyGigE0/6,fortyGigE0/7", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet8": { + "index": "2,2,2,2", + "lanes": "33,34,35,36", + "alias_at_lanes": "fortyGigE0/8,fortyGigE0/9,fortyGigE0/10,fortyGigE0/11", + "breakout_modes": "1x100G[40G],2x50G,2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet12": { + "index": "3,3,3,3", + "lanes": "37,38,39,40", + "alias_at_lanes": "fortyGigE0/12,fortyGigE0/13,fortyGigE0/14,fortyGigE0/15", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet16": { + "index": "4,4,4,4", + "lanes": "45,46,47,48", + "alias_at_lanes": "fortyGigE0/16,fortyGigE0/17,fortyGigE0/18,fortyGigE0/19", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet20": { + "index": "5,5,5,5", + "lanes": "41,42,43,44", + "alias_at_lanes": "fortyGigE0/20,fortyGigE0/21,fortyGigE0/22,fortyGigE0/23", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet24": { + "index": "6,6,6,6", + "lanes": "1,2,3,4", + "alias_at_lanes": "fortyGigE0/24,fortyGigE0/25,fortyGigE0/26,fortyGigE0/27", + "breakout_modes": "1x100G[40G],4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet28": { + "index": "7,7,7,7", + "lanes": "5,6,7,8", + "alias_at_lanes": "fortyGigE0/28,fortyGigE0/29,fortyGigE0/30,fortyGigE0/31", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet32": { + "index": "8,8,8,8", + "lanes": "13,14,15,16", + "alias_at_lanes": "fortyGigE0/32,fortyGigE0/33,fortyGigE0/34,fortyGigE0/35", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet36": { + "index": "9,9,9,9", + "lanes": "9,10,11,12", + "alias_at_lanes": "fortyGigE0/36,fortyGigE0/37,fortyGigE0/38,fortyGigE0/39", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet40": { + "index": "10,10,10,10", + "lanes": "17,18,19,20", + "alias_at_lanes": "fortyGigE0/40,fortyGigE0/41,fortyGigE0/42,fortyGigE0/43", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet44": { + "index": "11,11,11,11", + "lanes": "21,22,23,24", + "alias_at_lanes": "fortyGigE0/44,fortyGigE0/45,fortyGigE0/46,fortyGigE0/47", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet48": { + "index": "12,12,12,12", + "lanes": "53,54,55,56", + "alias_at_lanes": "fortyGigE0/48,fortyGigE0/49,fortyGigE0/50,fortyGigE0/51", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet52": { + "index": "13,13,13,13", + "lanes": "49,50,51,52", + "alias_at_lanes": "fortyGigE0/52,fortyGigE0/53,fortyGigE0/54,fortyGigE0/55", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet56": { + "index": "14,14,14,14", + "lanes": "57,58,59,60", + "alias_at_lanes": "fortyGigE0/56,fortyGigE0/57,fortyGigE0/58,fortyGigE0/59", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet60": { + "index": "15,15,15,15", + "lanes": "61,62,63,64", + "alias_at_lanes": "fortyGigE0/60,fortyGigE0/61,fortyGigE0/62,fortyGigE0/63", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet64": { + "index": "16,16,16,16", + "lanes": "69,70,71,72", + "alias_at_lanes": "fortyGigE0/64,fortyGigE0/65,fortyGigE0/66,fortyGigE0/67", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet68": { + "index": "17,17,17,17", + "lanes": "65,66,67,68", + "alias_at_lanes": "fortyGigE0/68,fortyGigE0/69,fortyGigE0/70,fortyGigE0/71", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet72": { + "index": "18,18,18,18", + "lanes": "73,74,75,76", + "alias_at_lanes": "fortyGigE0/72,fortyGigE0/73,fortyGigE0/74,fortyGigE0/75", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet76": { + "index": "19,19,19,19", + "lanes": "77,78,79,80", + "alias_at_lanes": "fortyGigE0/76,fortyGigE0/77,fortyGigE0/78,fortyGigE0/79", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet80": { + "index": "20,20,20,20", + "lanes": "109,110,111,112", + "alias_at_lanes": "fortyGigE0/80,fortyGigE0/81,fortyGigE0/82,fortyGigE0/83", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet84": { + "index": "21,21,21,21", + "lanes": "105,106,107,108", + "alias_at_lanes": "fortyGigE0/84,fortyGigE0/85,fortyGigE0/86,fortyGigE0/87", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet88": { + "index": "22,22,22,22", + "lanes": "113,114,115,116", + "alias_at_lanes": "fortyGigE0/88,fortyGigE0/89,fortyGigE0/90,fortyGigE0/91", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet92": { + "index": "23,23,23,23", + "lanes": "117,118,119,120", + "alias_at_lanes": "fortyGigE0/92,fortyGigE0/93,fortyGigE0/94,fortyGigE0/95", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet96": { + "index": "24,24,24,24", + "lanes": "125,126,127,128", + "alias_at_lanes": "fortyGigE0/96,fortyGigE0/97,fortyGigE0/98,fortyGigE0/99", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet100": { + "index": "25,25,25,25", + "lanes": "121,122,123,124", + "alias_at_lanes": "fortyGigE0/100,fortyGigE0/101,fortyGigE0/102,fortyGigE0/103", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet104": { + "index": "26,26,26,26", + "lanes": "81,82,83,84", + "alias_at_lanes": "fortyGigE0/104,fortyGigE0/105,fortyGigE0/106,fortyGigE0/107", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet108": { + "index": "27,27,27,27", + "lanes": "85,86,87,88", + "alias_at_lanes": "fortyGigE0/108,fortyGigE0/109,fortyGigE0/110,fortyGigE0/111", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet112": { + "index": "28,28,28,28", + "lanes": "93,94,95,96", + "alias_at_lanes": "fortyGigE0/112,fortyGigE0/113,fortyGigE0/114,fortyGigE0/115", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet116": { + "index": "29,29,29,29", + "lanes": "89,90,91,92", + "alias_at_lanes": "fortyGigE0/116,fortyGigE0/117,fortyGigE0/118,fortyGigE0/119", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet120": { + "index": "30,30,30,30", + "lanes": "101,102,103,104", + "alias_at_lanes": "fortyGigE0/120,fortyGigE0/121,fortyGigE0/122,fortyGigE0/123", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + }, + "Ethernet124": { + "index": "31,31,31,31", + "lanes": "97,98,99,100", + "alias_at_lanes": "fortyGigE0/124,fortyGigE0/125,fortyGigE0/126,fortyGigE0/127", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G],2x25G(2)+1x50G(2),1x50G(2)+2x25G(2)" + } + } +} diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 94825825851c..7c53c864a79b 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -31,16 +31,23 @@ if [[ -f /usr/share/sonic/virtual_chassis/default_config.json ]]; then fi SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') -sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' $CHASS_CFG --print-data > /etc/sonic/init_cfg.json +if [ -f /etc/sonic/init_cfg.json ]; then + sonic-cfggen -j /etc/sonic/init_cfg.json -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' $CHASS_CFG --print-data > /tmp/init_cfg.json + mv /tmp/init_cfg.json /etc/sonic/init_cfg.json +else + sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'"}}}' $CHASS_CFG --print-data > /etc/sonic/init_cfg.json +fi if [ -f /etc/sonic/config_db.json ]; then sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --print-data > /tmp/config_db.json mv /tmp/config_db.json /etc/sonic/config_db.json else # generate and merge buffers configuration into config file - sonic-cfggen -k $HWSKU -p /usr/share/sonic/hwsku/port_config.ini -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json + sonic-cfggen -k $HWSKU -p /usr/share/sonic/device/$PLATFORM/platform.json -t /usr/share/sonic/hwsku/buffers.json.j2 > /tmp/buffers.json sonic-cfggen -j /etc/sonic/init_cfg.json -t /usr/share/sonic/hwsku/qos.json.j2 > /tmp/qos.json - sonic-cfggen -p /usr/share/sonic/hwsku/port_config.ini -k $HWSKU --print-data > /tmp/ports.json + sonic-cfggen -p /usr/share/sonic/device/$PLATFORM/platform.json -k $HWSKU --print-data > /tmp/ports.json + # change admin_status from up to down; Test cases dependent + sed -i "s/up/down/g" /tmp/ports.json sonic-cfggen -j /etc/sonic/init_cfg.json -j /tmp/buffers.json -j /tmp/qos.json -j /tmp/ports.json --print-data > /etc/sonic/config_db.json fi @@ -87,10 +94,10 @@ fi supervisorctl start syncd -supervisorctl start orchagent - supervisorctl start portsyncd +supervisorctl start orchagent + supervisorctl start neighsyncd supervisorctl start teamsyncd diff --git a/platform/vs/docker-sonic-vs/supervisord.conf b/platform/vs/docker-sonic-vs/supervisord.conf index abf09574dbf7..79baead76765 100644 --- a/platform/vs/docker-sonic-vs/supervisord.conf +++ b/platform/vs/docker-sonic-vs/supervisord.conf @@ -43,16 +43,16 @@ autorestart=false stdout_logfile=syslog stderr_logfile=syslog -[program:orchagent] -command=/usr/bin/orchagent.sh +[program:portsyncd] +command=/usr/bin/portsyncd priority=5 autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog -[program:portsyncd] -command=/usr/bin/portsyncd +[program:orchagent] +command=/usr/bin/orchagent.sh priority=6 autostart=false autorestart=false diff --git a/platform/vs/tests/breakout/sample_output/sample_new_port_config.json b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json new file mode 100644 index 000000000000..7c5c190a3330 --- /dev/null +++ b/platform/vs/tests/breakout/sample_output/sample_new_port_config.json @@ -0,0 +1,252 @@ +{ + "Ethernet0_2x50G": { + "Ethernet2": { + "alias": "fortyGigE0/2", + "admin_status": "up", + "lanes": "27,28", + "speed": "50000", + "index": "0" + }, + "Ethernet0": { + "alias": "fortyGigE0/0", + "admin_status": "up", + "lanes": "25,26", + "speed": "50000", + "index": "0" + } + }, + "Ethernet12_1x50G_2x25G": { + "Ethernet12": { + "alias": "fortyGigE0/12", + "admin_status": "up", + "lanes": "37,38", + "speed": "50000", + "index": "3" + }, + "Ethernet14": { + "alias": "fortyGigE0/14", + "admin_status": "up", + "lanes": "39", + "speed": "25000", + "index": "3" + }, + "Ethernet15": { + "alias": "fortyGigE0/15", + "admin_status": "up", + "lanes": "40", + "speed": "25000", + "index": "3" + } + }, + "Ethernet0_2x50G": { + "Ethernet2": { + "alias": "fortyGigE0/2", + "admin_status": "up", + "lanes": "27,28", + "speed": "50000", + "index": "0" + }, + "Ethernet0": { + "alias": "fortyGigE0/0", + "admin_status": "up", + "lanes": "25,26", + "speed": "50000", + "index": "0" + } + }, + "Ethernet0_1x100G": { + "Ethernet0": { + "alias": "fortyGigE0/0", + "admin_status": "up", + "lanes": "25,26,27,28", + "speed": "100000", + "index": "0" + } + }, + "Ethernet0_4x25G": { + "Ethernet2": { + "alias": "fortyGigE0/2", + "admin_status": "up", + "lanes": "27", + "speed": "25000", + "index": "0" + }, + "Ethernet3": { + "alias": "fortyGigE0/3", + "admin_status": "up", + "lanes": "28", + "speed": "25000", + "index": "0" + }, + "Ethernet0": { + "alias": "fortyGigE0/0", + "admin_status": "up", + "lanes": "25", + "speed": "25000", + "index": "0" + }, + "Ethernet1": { + "alias": "fortyGigE0/1", + "admin_status": "up", + "lanes": "26", + "speed": "25000", + "index": "0" + } + }, + "Ethernet0_2x25G_1x50G": { + "Ethernet2": { + "alias": "fortyGigE0/2", + "admin_status": "up", + "lanes": "27,28", + "speed": "50000", + "index": "0" + }, + "Ethernet0": { + "alias": "fortyGigE0/0", + "admin_status": "up", + "lanes": "25", + "speed": "25000", + "index": "0" + }, + "Ethernet1": { + "alias": "fortyGigE0/1", + "admin_status": "up", + "lanes": "26", + "speed": "25000", + "index": "0" + } + }, + "Ethernet0_1x50G_2x25G": { + "Ethernet2": { + "alias": "fortyGigE0/2", + "admin_status": "up", + "lanes": "27", + "speed": "25000", + "index": "0" + }, + "Ethernet3": { + "alias": "fortyGigE0/3", + "admin_status": "up", + "lanes": "28", + "speed": "25000", + "index": "0" + }, + "Ethernet0": { + "alias": "fortyGigE0/0", + "admin_status": "up", + "lanes": "25,26", + "speed": "50000", + "index": "0" + } + }, + "Ethernet4_4x25G": { + "Ethernet6": { + "alias": "fortyGigE0/6", + "admin_status": "up", + "lanes": "31", + "speed": "25000", + "index": "1" + }, + "Ethernet7": { + "alias": "fortyGigE0/7", + "admin_status": "up", + "lanes": "32", + "speed": "25000", + "index": "1" + }, + "Ethernet4": { + "alias": "fortyGigE0/4", + "admin_status": "up", + "lanes": "29", + "speed": "25000", + "index": "1" + }, + "Ethernet5": { + "alias": "fortyGigE0/5", + "admin_status": "up", + "lanes": "30", + "speed": "25000", + "index": "1" + } + }, + "Ethernet4_2x50G": { + "Ethernet6": { + "alias": "fortyGigE0/6", + "admin_status": "up", + "lanes": "31,32", + "speed": "50000", + "index": "1" + }, + "Ethernet4": { + "alias": "fortyGigE0/4", + "admin_status": "up", + "lanes": "29,30", + "speed": "50000", + "index": "1" + } + }, + "Ethernet8_2x50G": { + "Ethernet8": { + "alias": "fortyGigE0/8", + "admin_status": "up", + "lanes": "33,34", + "speed": "50000", + "index": "2" + }, + "Ethernet10": { + "alias": "fortyGigE0/10", + "admin_status": "up", + "lanes": "35,36", + "speed": "50000", + "index": "2" + } + }, + "Ethernet8_1x50G_2x25G": { + "Ethernet10": { + "alias": "fortyGigE0/10", + "admin_status": "up", + "lanes": "35", + "speed": "25000", + "index": "2" + }, + "Ethernet11": { + "alias": "fortyGigE0/11", + "admin_status": "up", + "lanes": "36", + "speed": "25000", + "index": "2" + } + }, + "Ethernet8_2x25G_1x50G": { + "Ethernet8": { + "alias": "fortyGigE0/8", + "admin_status": "up", + "lanes": "33", + "speed": "25000", + "index": "2" + }, + "Ethernet9": { + "alias": "fortyGigE0/9", + "admin_status": "up", + "lanes": "34", + "speed": "25000", + "index": "2" + }, + "Ethernet10": { + "alias": "fortyGigE0/10", + "admin_status": "up", + "lanes": "35,36", + "speed": "50000", + "index": "2" + } + }, + "Ethernet8_1x100G": { + "Ethernet8": { + "alias": "fortyGigE0/8", + "admin_status": "up", + "lanes": "33,34,35,36", + "speed": "100000", + "index": "2" + } + } +} diff --git a/platform/vs/tests/breakout/test_breakout_cli.py b/platform/vs/tests/breakout/test_breakout_cli.py new file mode 100755 index 000000000000..d93dc0e044a6 --- /dev/null +++ b/platform/vs/tests/breakout/test_breakout_cli.py @@ -0,0 +1,168 @@ +from swsscommon import swsscommon +import time +import os +import json +import ast +import pytest +import collections + +@pytest.mark.usefixtures('dpb_setup_fixture') +class TestBreakoutCli(object): + def setup_db(self, dvs): + self.cdb = swsscommon.DBConnector(4, dvs.redis_sock, 0) + + def read_Json(self, dvs): + test_dir = os.path.dirname(os.path.realpath(__file__)) + sample_output_file = os.path.join(test_dir, 'sample_output', 'sample_new_port_config.json') + with open(sample_output_file, 'rb') as fh: + fh_data = json.load(fh) + + if not fh_data: + return False + expected = ast.literal_eval(json.dumps(fh_data)) + return expected + + def breakout(self, dvs, interface, brkout_mode): + (exitcode, result) = dvs.runcmd("config interface breakout {} {} -y".format(interface, brkout_mode)) + + if result.strip("\n")[0] == "[ERROR] Breakout feature is not available without platform.json file" : + pytest.skip("**** This test is not needed ****") + root_dir = os.path.dirname('/') + (exitcode, output_dict) = dvs.runcmd("jq '.' new_port_config.json") + if output_dict is None: + raise Exception("Breakout output cant be None") + + output_dict = ast.literal_eval(output_dict.strip()) + return output_dict + + # Check Initial Brakout Mode + def test_InitialBreakoutMode(self, dvs, testlog): + self.setup_db(dvs) + + output_dict = {} + brkoutTbl = swsscommon.Table(self.cdb, "BREAKOUT_CFG") + brkout_entries = brkoutTbl.getKeys() + assert len(brkout_entries) == 32 + + for key in brkout_entries: + (status, fvs) = brkoutTbl.get(key) + assert status + + brkout_mode = fvs[0][1] + output_dict[key] = brkout_mode + output = collections.OrderedDict(sorted(output_dict.items(), key=lambda t: t[0])) + expected_dict = \ + {'Ethernet8': '1x100G[40G]', 'Ethernet0': '1x100G[40G]', 'Ethernet4': '1x100G[40G]', \ + 'Ethernet108': '1x100G[40G]', 'Ethernet100': '1x100G[40G]', 'Ethernet104': '1x100G[40G]', \ + 'Ethernet68': '1x100G[40G]', 'Ethernet96': '1x100G[40G]', 'Ethernet124': '1x100G[40G]', \ + 'Ethernet92': '1x100G[40G]', 'Ethernet120': '1x100G[40G]', 'Ethernet52': '1x100G[40G]', \ + 'Ethernet56': '1x100G[40G]', 'Ethernet76': '1x100G[40G]', 'Ethernet72': '1x100G[40G]', \ + 'Ethernet32': '1x100G[40G]', 'Ethernet16': '1x100G[40G]', 'Ethernet36': '1x100G[40G]', \ + 'Ethernet12': '1x100G[40G]', 'Ethernet28': '1x100G[40G]', 'Ethernet88': '1x100G[40G]', \ + 'Ethernet116': '1x100G[40G]', 'Ethernet80': '1x100G[40G]', 'Ethernet112': '1x100G[40G]', \ + 'Ethernet84': '1x100G[40G]', 'Ethernet48': '1x100G[40G]', 'Ethernet44': '1x100G[40G]', \ + 'Ethernet40': '1x100G[40G]', 'Ethernet64': '1x100G[40G]', 'Ethernet60': '1x100G[40G]', \ + 'Ethernet20': '1x100G[40G]', 'Ethernet24': '1x100G[40G]'} + expected = collections.OrderedDict(sorted(expected_dict.items(), key=lambda t: t[0])) + assert output == expected + + # Breakout Cli Test Mode + def test_breakout_modes(self, dvs): + expected = self.read_Json(dvs) + assert expected + + print("**** Breakout Cli test Starts ****") + output_dict = self.breakout(dvs, 'Ethernet0', '2x50G') + expected_dict = expected["Ethernet0_2x50G"] + assert output_dict == expected_dict + print("**** 1X100G --> 2x50G passed ****") + + output_dict = self.breakout(dvs, 'Ethernet4', '4x25G[10G]') + expected_dict = expected["Ethernet4_4x25G"] + assert output_dict == expected_dict + print("**** 1X100G --> 4x25G[10G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') + expected_dict = expected["Ethernet8_2x25G_1x50G"] + assert output_dict == expected_dict + print("**** 1X100G --> 2x25G(2)+1x50G(2) passed ****") + + output_dict = self.breakout(dvs, 'Ethernet12', '1x50G(2)+2x25G(2)') + expected_dict = expected["Ethernet12_1x50G_2x25G"] + assert output_dict == expected_dict + print("**** 1X100G --> 1x50G(2)+2x25G(2) passed ****") + + # TODOFIX: remove comments once #4442 PR got merged and + # yang model for DEVICE_METADATA becomes available. + # As below test cases are dependent on DEVICE_METADATA to go + # from a non-default breakout mode to a different breakout mode. + """ + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print("**** 2x50G --> 1x100G[40G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet0', '4x25G[10G]') + expected_dict = expected["Ethernet0_4x25G"] + assert output_dict == expected_dict + print("**** 1X100G --> 4x25G[10G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print("**** 4x25G[10G] --> 1x100G[40G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet4', '2x50G') + print("**** 1X100G --> 2x50G mode change ****") + + output_dict = self.breakout(dvs, 'Ethernet4', '4x25G[10G]') + expected_dict = expected["Ethernet4_4x25G"] + assert output_dict == expected_dict + print("**** 2X50G --> 4x25G[10G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet4', '2x50G') + expected_dict = expected["Ethernet4_2x50G"] + assert output_dict == expected_dict + print("**** 4x25G[10G] --> 2X50G passed ****") + + output_dict = self.breakout(dvs, 'Ethernet4', '1x100G[40G]') + print("**** 2x50G -- > 1X100G mode change ****") + + output_dict = self.breakout(dvs, 'Ethernet0', '2x25G(2)+1x50G(2)') + expected_dict = expected["Ethernet0_2x25G_1x50G"] + assert output_dict == expected_dict + print("**** 1x100G[40G] --> 2x25G(2)+1x50G(2) passed ****") + + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print("**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet0', '1x50G(2)+2x25G(2)') + expected_dict = expected["Ethernet0_1x50G_2x25G"] + assert output_dict == expected_dict + print("**** 1x100G[40G] --> 1x50G(2)+2x25G(2) passed ****") + + output_dict = self.breakout(dvs, 'Ethernet0', '1x100G[40G]') + expected_dict = expected["Ethernet0_1x100G"] + assert output_dict == expected_dict + print("**** 1x50G(2)+2x25G(2) --> 1x100G[40G] passed ****") + + output_dict = self.breakout(dvs, 'Ethernet8', '2x50G') + print("**** 1x100G[40G] --> 2x50G mode change ****") + + output_dict = self.breakout(dvs, 'Ethernet8', '1x50G(2)+2x25G(2)') + expected_dict = expected["Ethernet8_1x50G_2x25G"] + assert output_dict == expected_dict + print("**** 2x50G --> 2x25G(2)+1x50G(2) passed ****") + + output_dict = self.breakout(dvs, 'Ethernet8', '2x25G(2)+1x50G(2)') + expected_dict = expected["Ethernet8_2x25G_1x50G"] + assert output_dict == expected_dict + print("**** 1x50G(2)+2x25G(2) --> 2x25G(2)+1x50G(2) passed ****") + + output_dict = self.breakout(dvs, 'Ethernet8', '1x100G[40G]') + expected_dict = expected["Ethernet8_1x100G"] + assert output_dict == expected_dict + print("**** 2x25G(2)+1x50G(2) --> 1x100G[40G] passed ****") + """ diff --git a/rules/config b/rules/config index e41a8de1d72b..b0bbb0b60173 100644 --- a/rules/config +++ b/rules/config @@ -125,6 +125,10 @@ INCLUDE_SFLOW = y # INCLUDE_MGMT_FRAMEWORK - build docker-sonic-mgmt-framework for CLI and REST server support INCLUDE_MGMT_FRAMEWORK = y +# INCLUDE_HOST_SERVICE - build sonic-host-services for mgmt-framework and/or +# telemetry containers to access host functionality +INCLUDE_HOST_SERVICE = n + # INCLUDE_RESTAPI - build docker-sonic-restapi for configuring the switch using REST APIs INCLUDE_RESTAPI = n @@ -140,14 +144,12 @@ INCLUDE_KUBERNETES = n # KUBERNETES_VERSION - Set to the required version. # K8s_GCR_IO_PAUSE_VERSION - Version of k8s universal pause container image -# K8s_CNI_FLANNEL_VERSION - Flannel used as CNI; Appropriate version for this Kubernetes version # These are Used *only* when INCLUDE_KUBERNETES=y # NOTE: As a worker node it has to run version compatible to kubernetes master. # KUBERNETES_VERSION = 1.18.6 KUBERNETES_CNI_VERSION = 0.8.6 K8s_GCR_IO_PAUSE_VERSION = 3.2 -K8s_CNI_FLANNEL_VERSION = v0.12.0 # SONIC_ENABLE_IMAGE_SIGNATURE - enable image signature # To not use the auto-generated self-signed certificate, the required files to sign the image as below: @@ -156,3 +158,6 @@ K8s_CNI_FLANNEL_VERSION = v0.12.0 # CA_CERT = # The relative path is build root folder. SONIC_ENABLE_IMAGE_SIGNATURE ?= n + +# ENABLE_SYNCHRONOUS_MODE - enable synchronous mode between orchagent and syncd +ENABLE_SYNCHRONOUS_MODE = n diff --git a/rules/docker-platform-monitor.mk b/rules/docker-platform-monitor.mk index a310b7503e92..72f9e145d6d4 100644 --- a/rules/docker-platform-monitor.mk +++ b/rules/docker-platform-monitor.mk @@ -10,12 +10,16 @@ $(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(LIBSENSORS) $(LM_SENSORS) $(FANCONTROL) ifeq ($(CONFIGURED_PLATFORM),barefoot) $(DOCKER_PLATFORM_MONITOR)_DEPENDS += $(PYTHON_THRIFT) endif -$(DOCKER_PLATFORM_MONITOR)_PYTHON_DEBS += $(SONIC_LEDD) $(SONIC_XCVRD) $(SONIC_PSUD) $(SONIC_SYSEEPROMD) $(SONIC_THERMALCTLD) $(SONIC_PCIED) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SWSSSDK_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PY_COMMON_PY2) $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PLATFORM_API_PY2) -$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_DAEMON_BASE_PY2) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_LEDD) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PCIED) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD) +$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD) $(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) $(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS += $(LIBSWSSCOMMON_DBG) $(LIBSENSORS_DBG) @@ -37,7 +41,9 @@ $(DOCKER_PLATFORM_MONITOR)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro # Mount Arista python library on Aboot images to be used by plugins $(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python2.7/dist-packages/arista:/usr/lib/python2.7/dist-packages/arista:ro -$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python2.7/dist-packages/arista/utils/sonic_platform:/usr/lib/python2.7/dist-packages/sonic_platform:ro +$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python3/dist-packages/arista:/usr/lib/python3/dist-packages/arista:ro +$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python2.7/dist-packages/sonic_platform:/usr/lib/python2.7/dist-packages/sonic_platform:ro +$(DOCKER_PLATFORM_MONITOR)_aboot_RUN_OPT += -v /usr/lib/python3/dist-packages/sonic_platform:/usr/lib/python3/dist-packages/sonic_platform:ro $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/bin/sensors $(DOCKER_PLATFORM_MONITOR)_BASE_IMAGE_FILES += cmd_wrapper:/usr/sbin/smartctl diff --git a/rules/docker-snmp.mk b/rules/docker-snmp.mk index 0b2f2e5da3cd..3493a2dfa337 100644 --- a/rules/docker-snmp.mk +++ b/rules/docker-snmp.mk @@ -26,7 +26,5 @@ SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_SNMP_DBG) $(DOCKER_SNMP)_CONTAINER_NAME = snmp $(DOCKER_SNMP)_RUN_OPT += --privileged -t $(DOCKER_SNMP)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -# mount Arista platform python libraries to support corresponding platforms SNMP power status query -$(DOCKER_SNMP)_RUN_OPT += -v /usr/lib/python3/dist-packages/arista:/usr/lib/python3/dist-packages/arista:ro $(DOCKER_SNMP)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) $(DOCKER_SNMP)_BASE_IMAGE_FILES += monit_snmp:/etc/monit/conf.d diff --git a/rules/docker-sonic-mgmt-framework.mk b/rules/docker-sonic-mgmt-framework.mk index 997881ca46f9..65bac8bd9ddc 100644 --- a/rules/docker-sonic-mgmt-framework.mk +++ b/rules/docker-sonic-mgmt-framework.mk @@ -28,6 +28,7 @@ $(DOCKER_MGMT_FRAMEWORK)_CONTAINER_NAME = mgmt-framework $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --privileged -t $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /etc:/host_etc:ro +$(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw $(DOCKER_MGMT_FRAMEWORK)_RUN_OPT += --mount type=bind,source="/var/platform/",target="/mnt/platform/" $(DOCKER_MGMT_FRAMEWORK)_BASE_IMAGE_FILES += sonic-cli:/usr/bin/sonic-cli diff --git a/rules/docker-telemetry.mk b/rules/docker-telemetry.mk index b44f7dc60227..c42e15e24430 100644 --- a/rules/docker-telemetry.mk +++ b/rules/docker-telemetry.mk @@ -26,6 +26,7 @@ endif $(DOCKER_TELEMETRY)_CONTAINER_NAME = telemetry $(DOCKER_TELEMETRY)_RUN_OPT += --privileged -t $(DOCKER_TELEMETRY)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro +$(DOCKER_TELEMETRY)_RUN_OPT += -v /var/run/dbus:/var/run/dbus:rw $(DOCKER_TELEMETRY)_RUN_OPT += --mount type=bind,source="/var/platform/",target="/mnt/platform/" $(DOCKER_TELEMETRY)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) diff --git a/rules/redis-dump-load-py3.dep b/rules/redis-dump-load-py3.dep new file mode 100644 index 000000000000..1c230acd1f7a --- /dev/null +++ b/rules/redis-dump-load-py3.dep @@ -0,0 +1,10 @@ +SPATH := $($(REDIS_DUMP_LOAD_PY3)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/redis-dump-load-py3.mk rules/redis-dump-load-py3.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(REDIS_DUMP_LOAD_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(REDIS_DUMP_LOAD_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(REDIS_DUMP_LOAD_PY3)_DEP_FILES := $(DEP_FILES) +$(REDIS_DUMP_LOAD_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(REDIS_DUMP_LOAD_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-daemon-base.dep b/rules/sonic-daemon-base.dep deleted file mode 100644 index 2c6e8a38c757..000000000000 --- a/rules/sonic-daemon-base.dep +++ /dev/null @@ -1,10 +0,0 @@ - -SPATH := $($(SONIC_DAEMON_BASE_PY2)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-daemon-base.mk rules/sonic-daemon-base.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files $(SPATH)) - -$(SONIC_DAEMON_BASE_PY2)_CACHE_MODE := GIT_CONTENT_SHA -$(SONIC_DAEMON_BASE_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(SONIC_DAEMON_BASE_PY2)_DEP_FILES := $(DEP_FILES) - diff --git a/rules/sonic-daemon-base.mk b/rules/sonic-daemon-base.mk deleted file mode 100644 index 5385c18f1f12..000000000000 --- a/rules/sonic-daemon-base.mk +++ /dev/null @@ -1,8 +0,0 @@ -# SONIC_DAEMON_BASE_PY2 package - -SONIC_DAEMON_BASE_PY2 = sonic_daemon_base-1.0-py2-none-any.whl -$(SONIC_DAEMON_BASE_PY2)_SRC_PATH = $(SRC_PATH)/sonic-daemon-base -$(SONIC_DAEMON_BASE_PY2)_PYTHON_VERSION = 2 -SONIC_PYTHON_WHEELS += $(SONIC_DAEMON_BASE_PY2) - -export daemon_base_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_DAEMON_BASE_PY2))" diff --git a/rules/sonic-host-service.dep b/rules/sonic-host-service.dep new file mode 100644 index 000000000000..9e5d823caeaf --- /dev/null +++ b/rules/sonic-host-service.dep @@ -0,0 +1,11 @@ + +SPATH := $($(SONIC_HOST_SERVICE)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-host-service.mk rules/sonic-host-service.dep +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(SONIC_HOST_SERVICE)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_HOST_SERVICE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_HOST_SERVICE)_DEP_FILES := $(DEP_FILES) +$(SONIC_HOST_SERVICE)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_HOST_SERVICE)_SMDEP_PATHS := $(SPATH) + diff --git a/rules/sonic-host-service.mk b/rules/sonic-host-service.mk new file mode 100644 index 000000000000..ad786f1a9d1a --- /dev/null +++ b/rules/sonic-host-service.mk @@ -0,0 +1,9 @@ +# SONiC host service package + +ifeq ($(INCLUDE_HOST_SERVICE), y) + +SONIC_HOST_SERVICE = sonic-host-service_1.0.0_all.deb +$(SONIC_HOST_SERVICE)_SRC_PATH = $(SRC_PATH)/sonic-host-service +SONIC_MAKE_DEBS += $(SONIC_HOST_SERVICE) + +endif diff --git a/rules/sonic-ledd.dep b/rules/sonic-ledd.dep index 42e54897423a..f02163761548 100644 --- a/rules/sonic-ledd.dep +++ b/rules/sonic-ledd.dep @@ -1,14 +1,10 @@ - SPATH := $($(SONIC_LEDD)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-ledd.mk rules/sonic-ledd.dep +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-ledd.mk rules/sonic-ledd.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_LEDD)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_LEDD)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_LEDD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SONIC_LEDD)_DEP_FILES := $(DEP_FILES) $(SONIC_LEDD)_SMDEP_FILES := $(SMDEP_FILES) $(SONIC_LEDD)_SMDEP_PATHS := $(SPATH) - - - diff --git a/rules/sonic-ledd.mk b/rules/sonic-ledd.mk index c9d66b113de2..930e8436ecaf 100644 --- a/rules/sonic-ledd.mk +++ b/rules/sonic-ledd.mk @@ -1,6 +1,7 @@ # sonic-ledd (SONiC Front-panel LED control daemon) Debian package -SONIC_LEDD = python-sonic-ledd_1.1-1_all.deb +SONIC_LEDD = sonic_ledd-1.1-py2-none-any.whl $(SONIC_LEDD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-ledd -$(SONIC_LEDD)_WHEEL_DEPENDS = $(SONIC_PY_COMMON_PY2) -SONIC_PYTHON_STDEB_DEBS += $(SONIC_LEDD) +$(SONIC_LEDD)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_LEDD)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_LEDD) diff --git a/rules/sonic-pcied.mk b/rules/sonic-pcied.mk index 91796f4da54f..dfcca1cab640 100644 --- a/rules/sonic-pcied.mk +++ b/rules/sonic-pcied.mk @@ -1,6 +1,7 @@ # sonic-pcied (SONiC PCIe Monitor daemon) Debian package -SONIC_PCIED = python-sonic-pcied_1.0-1_all.deb +SONIC_PCIED = sonic_pcied-1.0-py2-none-any.whl $(SONIC_PCIED)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-pcied -$(SONIC_PCIED)_WHEEL_DEPENDS = $(SONIC_DAEMON_BASE_PY2) -SONIC_PYTHON_STDEB_DEBS += $(SONIC_PCIED) +$(SONIC_PCIED)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_PCIED)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_PCIED) diff --git a/rules/sonic-psud.dep b/rules/sonic-psud.dep index 1999811f2a0a..29cc82f68b71 100644 --- a/rules/sonic-psud.dep +++ b/rules/sonic-psud.dep @@ -1,12 +1,10 @@ - SPATH := $($(SONIC_PSUD)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-psud.mk rules/sonic-psud.dep +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-psud.mk rules/sonic-psud.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_PSUD)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_PSUD)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_PSUD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SONIC_PSUD)_DEP_FILES := $(DEP_FILES) $(SONIC_PSUD)_SMDEP_FILES := $(SMDEP_FILES) $(SONIC_PSUD)_SMDEP_PATHS := $(SPATH) - diff --git a/rules/sonic-psud.mk b/rules/sonic-psud.mk index 404b18d2fe7b..7f4596505e12 100644 --- a/rules/sonic-psud.mk +++ b/rules/sonic-psud.mk @@ -1,6 +1,7 @@ # sonic-psud (SONiC PSU daemon) Debian package -SONIC_PSUD = python-sonic-psud_1.0-1_all.deb +SONIC_PSUD = sonic_psud-1.0-py2-none-any.whl $(SONIC_PSUD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-psud -$(SONIC_PSUD)_WHEEL_DEPENDS = $(SONIC_PY_COMMON_PY2) -SONIC_PYTHON_STDEB_DEBS += $(SONIC_PSUD) +$(SONIC_PSUD)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_PSUD)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_PSUD) diff --git a/rules/sonic-syseepromd.dep b/rules/sonic-syseepromd.dep index a00131942031..d5fc42a585c5 100644 --- a/rules/sonic-syseepromd.dep +++ b/rules/sonic-syseepromd.dep @@ -1,12 +1,10 @@ - SPATH := $($(SONIC_SYSEEPROMD)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-syseepromd.mk rules/sonic-syseepromd.dep +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-syseepromd.mk rules/sonic-syseepromd.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_SYSEEPROMD)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_SYSEEPROMD)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_SYSEEPROMD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SONIC_SYSEEPROMD)_DEP_FILES := $(DEP_FILES) $(SONIC_SYSEEPROMD)_SMDEP_FILES := $(SMDEP_FILES) $(SONIC_SYSEEPROMD)_SMDEP_PATHS := $(SPATH) - diff --git a/rules/sonic-syseepromd.mk b/rules/sonic-syseepromd.mk index b8c68179571d..1fba4027a2d4 100644 --- a/rules/sonic-syseepromd.mk +++ b/rules/sonic-syseepromd.mk @@ -1,6 +1,7 @@ # sonic-syseepromd (SONiC Syseeprom gathering daemon) Debian package -SONIC_SYSEEPROMD = python-sonic-syseepromd_1.0-1_all.deb +SONIC_SYSEEPROMD = sonic_syseepromd-1.0-py2-none-any.whl $(SONIC_SYSEEPROMD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-syseepromd -$(SONIC_SYSEEPROMD)_WHEEL_DEPENDS = $(SONIC_PY_COMMON_PY2) -SONIC_PYTHON_STDEB_DEBS += $(SONIC_SYSEEPROMD) +$(SONIC_SYSEEPROMD)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_SYSEEPROMD)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_SYSEEPROMD) diff --git a/rules/sonic-thermalctld.dep b/rules/sonic-thermalctld.dep index 6faa53b378e6..aa437849fdf9 100644 --- a/rules/sonic-thermalctld.dep +++ b/rules/sonic-thermalctld.dep @@ -1,12 +1,10 @@ - SPATH := $($(SONIC_THERMALCTLD)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-thermalctld.mk rules/sonic-thermalctld.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_THERMALCTLD)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_THERMALCTLD)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_THERMALCTLD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SONIC_THERMALCTLD)_DEP_FILES := $(DEP_FILES) $(SONIC_THERMALCTLD)_SMDEP_FILES := $(SMDEP_FILES) $(SONIC_THERMALCTLD)_SMDEP_PATHS := $(SPATH) - diff --git a/rules/sonic-thermalctld.mk b/rules/sonic-thermalctld.mk index cf42c2544af9..b2cf134642d6 100644 --- a/rules/sonic-thermalctld.mk +++ b/rules/sonic-thermalctld.mk @@ -1,6 +1,7 @@ # sonic-thermalctld (SONiC Thermal control daemon) Debian package -SONIC_THERMALCTLD = python-sonic-thermalctld_1.0-1_all.deb +SONIC_THERMALCTLD = sonic_thermalctld-1.0-py2-none-any.whl $(SONIC_THERMALCTLD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-thermalctld -$(SONIC_THERMALCTLD)_WHEEL_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_DAEMON_BASE_PY2) -SONIC_PYTHON_STDEB_DEBS += $(SONIC_THERMALCTLD) +$(SONIC_THERMALCTLD)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_THERMALCTLD)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_THERMALCTLD) diff --git a/rules/sonic-xcvrd.dep b/rules/sonic-xcvrd.dep index 25c1e8c2aaa7..724f4280a730 100644 --- a/rules/sonic-xcvrd.dep +++ b/rules/sonic-xcvrd.dep @@ -1,12 +1,10 @@ - SPATH := $($(SONIC_XCVRD)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-xcvrd.mk rules/sonic-xcvrd.dep +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-xcvrd.mk rules/sonic-xcvrd.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) -$(SONIC_XCVRD)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_XCVRD)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_XCVRD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(SONIC_XCVRD)_DEP_FILES := $(DEP_FILES) $(SONIC_XCVRD)_SMDEP_FILES := $(SMDEP_FILES) $(SONIC_XCVRD)_SMDEP_PATHS := $(SPATH) - diff --git a/rules/sonic-xcvrd.mk b/rules/sonic-xcvrd.mk index c4b6016f1a86..8af04a2c07b6 100644 --- a/rules/sonic-xcvrd.mk +++ b/rules/sonic-xcvrd.mk @@ -1,6 +1,7 @@ # sonic-xcvrd (SONiC Transceiver monitoring daemon) Debian package -SONIC_XCVRD = python-sonic-xcvrd_1.0-1_all.deb +SONIC_XCVRD = sonic_xcvrd-1.0-py2-none-any.whl $(SONIC_XCVRD)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-xcvrd -$(SONIC_XCVRD)_WHEEL_DEPENDS = $(SONIC_PY_COMMON_PY2) -SONIC_PYTHON_STDEB_DEBS += $(SONIC_XCVRD) +$(SONIC_XCVRD)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_XCVRD)_PYTHON_VERSION = 2 +SONIC_PYTHON_WHEELS += $(SONIC_XCVRD) diff --git a/rules/swss-common.mk b/rules/swss-common.mk index 3e1c0b0576e2..8a319ea62bc0 100644 --- a/rules/swss-common.mk +++ b/rules/swss-common.mk @@ -15,6 +15,9 @@ $(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(LIBSWSSCOMMON_DEV))) PYTHON_SWSSCOMMON = python-swsscommon_1.0.0_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(PYTHON_SWSSCOMMON))) +PYTHON3_SWSSCOMMON = python3-swsscommon_1.0.0_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBSWSSCOMMON),$(PYTHON3_SWSSCOMMON))) + LIBSWSSCOMMON_DBG = libswsscommon-dbg_1.0.0_$(CONFIGURED_ARCH).deb $(LIBSWSSCOMMON_DBG)_DEPENDS += $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DBG)_RDEPENDS += $(LIBSWSSCOMMON) diff --git a/slave.mk b/slave.mk index 64fb77b5721d..f77cec3f1eaa 100644 --- a/slave.mk +++ b/slave.mk @@ -224,11 +224,13 @@ $(info "VS_PREPARE_MEM" : "$(VS_PREPARE_MEM)") $(info "INCLUDE_MGMT_FRAMEWORK" : "$(INCLUDE_MGMT_FRAMEWORK)") $(info "INCLUDE_ICCPD" : "$(INCLUDE_ICCPD)") $(info "INCLUDE_SYSTEM_TELEMETRY" : "$(INCLUDE_SYSTEM_TELEMETRY)") +$(info "INCLUDE_HOST_SERVICE" : "$(INCLUDE_HOST_SERVICE)") $(info "INCLUDE_RESTAPI" : "$(INCLUDE_RESTAPI)") $(info "INCLUDE_SFLOW" : "$(INCLUDE_SFLOW)") $(info "INCLUDE_NAT" : "$(INCLUDE_NAT)") $(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)") $(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)") +$(info "ENABLE_SYNCHRONOUS_MODE" : "$(ENABLE_SYNCHRONOUS_MODE)") $(info ) include Makefile.cache @@ -246,6 +248,7 @@ endif export kernel_procure_method=$(KERNEL_PROCURE_METHOD) export vs_build_prepare_mem=$(VS_PREPARE_MEM) +export enable_synchronous_mode=$(ENABLE_SYNCHRONOUS_MODE) ############################################################################### ## Local targets @@ -347,7 +350,7 @@ $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $ # Build project and take package make DEST=$(shell pwd)/$(FILES_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(FILES_PATH)/$* $(LOG) # Clean up - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) @@ -390,7 +393,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(a # Build project and take package DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC}" make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG) # Clean up - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) @@ -433,7 +436,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(a ) popd $(LOG_SIMPLE) # Clean up - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi # Take built package(s) mv $(addprefix $($*_SRC_PATH)/../, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) $(DEBS_PATH) $(LOG) @@ -533,7 +536,7 @@ $(addprefix $(PYTHON_DEBS_PATH)/, $(SONIC_PYTHON_STDEB_DEBS)) : $(PYTHON_DEBS_PA python setup.py --command-packages=stdeb.command bdist_deb $(LOG) popd $(LOG_SIMPLE) # Clean up - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi # Take built package(s) mv $(addprefix $($*_SRC_PATH)/deb_dist/, $* $($*_DERIVED_DEBS)) $(PYTHON_DEBS_PATH) $(LOG) @@ -570,7 +573,7 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA if [ ! "$($*_TEST)" = "n" ]; then python$($*_PYTHON_VERSION) setup.py test $(LOG); fi python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG) # clean up - if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt pop -a -f; fi + if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt pop -a -f; [ -d .pc ] && rm -rf .pc; fi popd $(LOG_SIMPLE) mv $($*_SRC_PATH)/dist/$* $(PYTHON_WHEELS_PATH) $(LOG) @@ -623,7 +626,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) : $(TARGET_PATH)/%.g -t $* $($*.gz_PATH) $(LOG) docker save $* | gzip -c > $@ # Clean up - if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; popd; fi + if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi $(FOOTER) SONIC_TARGET_LIST += $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) @@ -694,6 +697,9 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_whls=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_WHEELS)))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++')) j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile + if [ -f $($*.gz_PATH)/init_cfg.json.j2 ] ; then + j2 $($*.gz_PATH)/init_cfg.json.j2 > $($*.gz_PATH)/init_cfg.json + fi docker info $(LOG) docker build --squash --no-cache \ --build-arg http_proxy=$(HTTP_PROXY) \ @@ -708,7 +714,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform -t $* $($*.gz_PATH) $(LOG) docker save $* | gzip -c > $@ # Clean up - if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; popd; fi + if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi # Save the target deb into DPKG cache $(call SAVE_CACHE,$*.gz,$@) @@ -749,7 +755,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%-$(DBG_IMAG -t $*-dbg $($*.gz_PATH) $(LOG) docker save $*-dbg | gzip -c > $@ # Clean up - if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; popd; fi + if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi # Save the target deb into DPKG cache $(call SAVE_CACHE,$*-$(DBG_IMAGE_MARK).gz,$@) @@ -790,10 +796,12 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(KDUMP_TOOLS) \ $(LIBPAM_TACPLUS) \ $(LIBNSS_TACPLUS) \ - $(MONIT)) \ + $(MONIT) \ + $(PYTHON_SWSSCOMMON)) \ $$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) \ $$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \ - $(if $(findstring y,$(ENABLE_ZTP)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SONIC_ZTP))) \ + $(if $(findstring y,$(ENABLE_ZTP)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SONIC_ZTP))) \ + $(if $(findstring y,$(INCLUDE_HOST_SERVICE)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SONIC_HOST_SERVICE))) \ $(addprefix $(PYTHON_DEBS_PATH)/,$(SONIC_UTILS)) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PY_COMMON_PY2)) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PY_COMMON_PY3)) \ @@ -820,6 +828,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export enable_ztp="$(ENABLE_ZTP)" export include_system_telemetry="$(INCLUDE_SYSTEM_TELEMETRY)" export include_restapi="$(INCLUDE_RESTAPI)" + export include_host_service="$(INCLUDE_HOST_SERVICE)" export include_nat="$(INCLUDE_NAT)" export include_sflow="$(INCLUDE_SFLOW)" export include_mgmt_framework="$(INCLUDE_MGMT_FRAMEWORK)" @@ -842,6 +851,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export sonic_yang_models_py3_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_YANG_MODELS_PY3))" export sonic_yang_mgmt_py_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_YANG_MGMT_PY))" export multi_instance="false" + export python_swss_debs="$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$($(LIBSWSSCOMMON)_RDEPENDS))" + export python_swss_debs+=" $(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(LIBSWSSCOMMON)) $(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(PYTHON_SWSSCOMMON))" $(foreach docker, $($*_DOCKERS),\ export docker_image="$(docker)" diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index e7ad71c53a55..88f905cb0f8a 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -209,8 +209,10 @@ RUN apt-get update && apt-get install -y \ clang \ pylint \ python-pytest \ + python3-pytest \ gcovr \ python-pytest-cov \ + python3-pytest-cov \ python-parse \ # For snmpd default-libmysqlclient-dev \ @@ -339,6 +341,21 @@ RUN export VERSION=1.14.2 \ && echo 'export PATH=$PATH:$GOROOT/bin' >> /etc/bash.bashrc \ && rm go$VERSION.linux-*.tar.gz +# For building Python packages +RUN pip install setuptools==40.8.0 +RUN pip3 install setuptools==49.6.00 + +# For running Python unit tests +RUN pip install pytest-runner==4.4 +RUN pip3 install pytest-runner==5.2 +RUN pip install mockredispy==2.9.3 +RUN pip3 install mockredispy==2.9.3 + +# For Python 2 unit tests, we need 'mock'. The last version of 'mock' +# which supports Python 2 is 3.0.5. In Python 3, 'mock' is part of 'unittest' +# in the standard library +RUN pip install mock==3.0.5 + # For p4 build RUN pip install \ ctypesgen==1.0.2 \ @@ -357,25 +374,17 @@ RUN apt-get purge -y python-click # For sonic utilities testing RUN pip install click natsort tabulate netifaces==0.10.7 fastentrypoints -# For sonic snmpagent mock testing -RUN pip3 install mockredispy==2.9.3 - RUN pip3 install "PyYAML>=5.1" # For sonic-platform-common testing RUN pip3 install redis # For supervisor build -RUN pip install meld3 mock +RUN pip install meld3 # For vs image build RUN pip install pexpect==4.6.0 -# For sonic-utilities build -RUN pip install mockredispy==2.9.3 -RUN pip install pytest-runner==4.4 -RUN pip install setuptools==40.8.0 - # For sonic-swss-common testing RUN pip install Pympler==0.8 diff --git a/src/iccpd/src/iccp_ifm.c b/src/iccpd/src/iccp_ifm.c index ea8ce20f05c3..258c661e03a4 100644 --- a/src/iccpd/src/iccp_ifm.c +++ b/src/iccpd/src/iccp_ifm.c @@ -502,7 +502,7 @@ int do_one_neigh_request(struct nlmsghdr *n) { struct ndmsg *ndm = NLMSG_DATA(n); int len = n->nlmsg_len; - struct rtattr * tb[NDA_MAX + 1]; + struct rtattr *tb[NDA_MAX + 1] = {0}; if (n->nlmsg_type == NLMSG_DONE) { @@ -966,7 +966,7 @@ void iccp_parse_if_vlan_info_from_netlink(struct nlmsghdr *n) { struct ifinfomsg *ifm = NLMSG_DATA(n); int len = n->nlmsg_len; - struct rtattr * tb[IFLA_MAX + 1]; + struct rtattr *tb[IFLA_MAX + 1] = {0}; if (n->nlmsg_type != RTM_NEWLINK) { diff --git a/src/redis-dump-load b/src/redis-dump-load index 832a645e4ddf..758549795174 160000 --- a/src/redis-dump-load +++ b/src/redis-dump-load @@ -1 +1 @@ -Subproject commit 832a645e4ddff0f38ec0d64e3be70f48013287e6 +Subproject commit 758549795174dc6b3be70810e0e4d6308f80f1a3 diff --git a/src/sonic-config-engine/.gitignore b/src/sonic-config-engine/.gitignore index e41d5b085e5b..8562c3d1344c 100644 --- a/src/sonic-config-engine/.gitignore +++ b/src/sonic-config-engine/.gitignore @@ -1,2 +1,7 @@ +**/*.pyc +*.egg-info/ +.eggs/ +build/ dist/ tests/output +tests/output2 diff --git a/src/sonic-config-engine/config_samples.py b/src/sonic-config-engine/config_samples.py index 1b38276524c0..42c545488c50 100644 --- a/src/sonic-config-engine/config_samples.py +++ b/src/sonic-config-engine/config_samples.py @@ -13,7 +13,7 @@ def generate_t1_sample_config(data): data['INTERFACE'] = {} port_count = 0 total_port_amount = len(data['PORT']) - for port in natsorted(data['PORT'].keys()): + for port in natsorted(data['PORT']): data['PORT'][port]['admin_status'] = 'up' data['PORT'][port]['mtu'] = '9100' local_addr = '10.0.{}.{}'.format(2 * port_count / 256, 2 * port_count % 256) @@ -35,22 +35,22 @@ def generate_t1_sample_config(data): def generate_empty_config(data): new_data = {'DEVICE_METADATA': data['DEVICE_METADATA']} - if not new_data['DEVICE_METADATA']['localhost'].has_key('hostname'): + if 'hostname' not in new_data['DEVICE_METADATA']['localhost']: new_data['DEVICE_METADATA']['localhost']['hostname'] = 'sonic' - if not new_data['DEVICE_METADATA']['localhost'].has_key('type'): + if 'type' not in new_data['DEVICE_METADATA']['localhost']: new_data['DEVICE_METADATA']['localhost']['type'] = 'LeafRouter' return new_data def generate_l2_config(data): - if not data['DEVICE_METADATA']['localhost'].has_key('hostname'): + if 'hostname' not in data['DEVICE_METADATA']['localhost']: data['DEVICE_METADATA']['localhost']['hostname'] = 'sonic' - if not data['DEVICE_METADATA']['localhost'].has_key('type'): + if 'type' not in data['DEVICE_METADATA']['localhost']: data['DEVICE_METADATA']['localhost']['type'] = 'ToRRouter' data['VLAN'] = {'Vlan1000': {'vlanid': '1000'}} - vp = natsorted(data['PORT'].keys()) + vp = natsorted(list(data['PORT'].keys())) data['VLAN']['Vlan1000'].setdefault('members', vp) data['VLAN_MEMBER'] = {} - for port in natsorted(data['PORT'].keys()): + for port in natsorted(data['PORT']): data['PORT'][port].setdefault('admin_status', 'up') data['VLAN_MEMBER']['Vlan1000|{}'.format(port)] = {'tagging_mode': 'untagged'} return data @@ -62,7 +62,7 @@ def generate_l2_config(data): } def get_available_config(): - return _sample_generators.keys() + return list(_sample_generators.keys()) def generate_sample_config(data, setting_name): return _sample_generators[setting_name.lower()](data) diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 5ee209d17ddf..4bc76c6aa6fe 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import print_function import calendar import math import os @@ -14,7 +15,8 @@ from lxml.etree import QName from portconfig import get_port_config -from sonic_py_common.device_info import get_npu_id_from_name +from sonic_py_common.multi_asic import get_asic_id_from_name +from sonic_py_common.interface import backplane_prefix """minigraph.py version_added: "1.9" @@ -37,7 +39,6 @@ FRONTEND_ASIC_SUB_ROLE = 'FrontEnd' BACKEND_ASIC_SUB_ROLE = 'BackEnd' -BACKEND_ASIC_INTERFACE_NAME_PREFIX = 'Ethernet-BP' # Default Virtual Network Index (VNI) vni_default = 8000 @@ -124,13 +125,13 @@ def parse_png(png, hname): bandwidth_node = link.find(str(QName(ns, "Bandwidth"))) bandwidth = bandwidth_node.text if bandwidth_node is not None else None if enddevice.lower() == hname.lower(): - if port_alias_map.has_key(endport): + if endport in port_alias_map: endport = port_alias_map[endport] neighbors[endport] = {'name': startdevice, 'port': startport} if bandwidth: port_speeds[endport] = bandwidth elif startdevice.lower() == hname.lower(): - if port_alias_map.has_key(startport): + if startport in port_alias_map: startport = port_alias_map[startport] neighbors[startport] = {'name': enddevice, 'port': endport} if bandwidth: @@ -175,14 +176,14 @@ def parse_asic_external_link(link, asic_name, hostname): # if chassis internal is false, the interface name will be # interface alias which should be converted to asic port name if (enddevice.lower() == hostname.lower()): - if ((port_alias_asic_map.has_key(endport)) and + if ((endport in port_alias_asic_map) and (asic_name.lower() in port_alias_asic_map[endport].lower())): endport = port_alias_asic_map[endport] neighbors[port_alias_map[endport]] = {'name': startdevice, 'port': startport} if bandwidth: port_speeds[port_alias_map[endport]] = bandwidth elif (startdevice.lower() == hostname.lower()): - if ((port_alias_asic_map.has_key(startport)) and + if ((startport in port_alias_asic_map) and (asic_name.lower() in port_alias_asic_map[startport].lower())): startport = port_alias_asic_map[startport] neighbors[port_alias_map[startport]] = {'name': enddevice, 'port': endport} @@ -202,14 +203,14 @@ def parse_asic_internal_link(link, asic_name, hostname): bandwidth = bandwidth_node.text if bandwidth_node is not None else None if ((enddevice.lower() == asic_name.lower()) and (startdevice.lower() != hostname.lower())): - if port_alias_map.has_key(endport): + if endport in port_alias_map: endport = port_alias_map[endport] neighbors[endport] = {'name': startdevice, 'port': startport} if bandwidth: port_speeds[endport] = bandwidth elif ((startdevice.lower() == asic_name.lower()) and (enddevice.lower() != hostname.lower())): - if port_alias_map.has_key(startport): + if startport in port_alias_map: startport = port_alias_map[startport] neighbors[startport] = {'name': enddevice, 'port': endport} if bandwidth: @@ -288,7 +289,7 @@ def parse_dpg(dpg, hname): if vni_element.text.isdigit(): vni = int(vni_element.text) else: - print >> sys.stderr, "VNI must be an integer (use default VNI %d instead)" % vni_default + print("VNI must be an integer (use default VNI %d instead)" % vni_default, file=sys.stderr) ipintfs = child.find(str(QName(ns, "IPInterfaces"))) intfs = {} @@ -391,18 +392,18 @@ def parse_dpg(dpg, hname): # decide an ACL is a Control Plane ACL if acl_intfs is empty below. for member in aclattach: member = member.strip() - if pcs.has_key(member): + if member in pcs: # If try to attach ACL to a LAG interface then we shall add the LAG to # to acl_intfs directly instead of break it into member ports, ACL attach # to LAG will be applied to all the LAG members internally by SAI/SDK acl_intfs.append(member) - elif vlans.has_key(member): + elif member in vlans: acl_intfs.append(member) - elif port_alias_map.has_key(member): + elif member in port_alias_map: acl_intfs.append(port_alias_map[member]) # Give a warning if trying to attach ACL to a LAG member interface, correct way is to attach ACL to the LAG interface if port_alias_map[member] in intfs_inpc: - print >> sys.stderr, "Warning: ACL " + aclname + " is attached to a LAG member interface " + port_alias_map[member] + ", instead of LAG interface" + print("Warning: ACL " + aclname + " is attached to a LAG member interface " + port_alias_map[member] + ", instead of LAG interface", file=sys.stderr) elif member.lower().startswith('erspan') or member.lower().startswith('egress_erspan'): if member.lower().startswith('erspanv6') or member.lower().startswith('egress_erspanv6'): is_mirror_v6 = True @@ -439,9 +440,9 @@ def parse_dpg(dpg, hname): # append the service to our list of services if aclname in acls: if acls[aclname]['type'] != 'CTRLPLANE': - print >> sys.stderr, "Warning: ACL '%s' type mismatch. Not updating ACL." % aclname + print("Warning: ACL '%s' type mismatch. Not updating ACL." % aclname, file=sys.stderr) elif acls[aclname]['services'] == aclservice: - print >> sys.stderr, "Warning: ACL '%s' already contains service '%s'. Not updating ACL." % (aclname, aclservice) + print("Warning: ACL '%s' already contains service '%s'. Not updating ACL." % (aclname, aclservice), file=sys.stderr) else: acls[aclname]['services'].append(aclservice) else: @@ -450,7 +451,7 @@ def parse_dpg(dpg, hname): 'stage': stage, 'services': [aclservice]} except: - print >> sys.stderr, "Warning: Ignoring Control Plane ACL %s without type" % aclname + print("Warning: Ignoring Control Plane ACL %s without type" % aclname, file=sys.stderr) return intfs, lo_intfs, mvrf, mgmt_intf, vlans, vlan_members, pcs, pc_members, acls, vni return None, None, None, None, None, None, None, None, None, None @@ -530,8 +531,8 @@ def parse_cpg(cpg, hname): if hostname.lower() == bgp_session['name'].lower(): bgp_session['asn'] = asn - bgp_monitors = { key: bgp_sessions[key] for key in bgp_sessions if bgp_sessions[key].has_key('asn') and bgp_sessions[key]['name'] == 'BGPMonitor' } - bgp_sessions = { key: bgp_sessions[key] for key in bgp_sessions if bgp_sessions[key].has_key('asn') and int(bgp_sessions[key]['asn']) != 0 } + bgp_monitors = { key: bgp_sessions[key] for key in bgp_sessions if 'asn' in bgp_sessions[key] and bgp_sessions[key]['name'] == 'BGPMonitor' } + bgp_sessions = { key: bgp_sessions[key] for key in bgp_sessions if 'asn' in bgp_sessions[key] and int(bgp_sessions[key]['asn']) != 0 } return bgp_sessions, myasn, bgp_peers_with_range, bgp_monitors @@ -696,7 +697,7 @@ def parse_spine_chassis_fe(results, vni, lo_intfs, phyport_intfs, pc_intfs, pc_m break if intf_name == None: - print >> sys.stderr, 'Warning: cannot find any interfaces that belong to %s' % (pc_intf) + print('Warning: cannot find any interfaces that belong to %s' % (pc_intf), file=sys.stderr) continue # Get the neighbor router of this port channel interface @@ -729,12 +730,12 @@ def filter_acl_table_bindings(acls, neighbors, port_channels, sub_role): # architecture for port_channel_intf in port_channels: backend_port_channel = any(lag_member in port_alias_asic_map \ - and lag_member.startswith(BACKEND_ASIC_INTERFACE_NAME_PREFIX) \ + and lag_member.startswith(backplane_prefix()) \ for lag_member in port_channels[port_channel_intf]['members']) if not backend_port_channel: front_port_channel_intf.append(port_channel_intf) - for acl_table, group_params in acls.iteritems(): + for acl_table, group_params in acls.items(): group_type = group_params.get('type', None) filter_acls[acl_table] = acls[acl_table] @@ -751,7 +752,7 @@ def filter_acl_table_bindings(acls, neighbors, port_channels, sub_role): # This will be applicable in Multi-NPU Platforms. front_panel_ports = [] for port in group_params.get('ports', []): - if port in port_alias_asic_map and port.startswith(BACKEND_ASIC_INTERFACE_NAME_PREFIX): + if port in port_alias_asic_map and port.startswith(backplane_prefix()): continue if port in port_channels and port not in front_port_channel_intf: continue @@ -763,7 +764,7 @@ def filter_acl_table_bindings(acls, neighbors, port_channels, sub_role): active_ports = [port for port in front_panel_ports if port in neighbors.keys() or port in front_port_channel_intf] if not active_ports: - print >> sys.stderr, 'Warning: mirror table {} in ACL_TABLE does not have any ports bound to it'.format(acl_table) + print('Warning: mirror table {} in ACL_TABLE does not have any ports bound to it'.format(acl_table), file=sys.stderr) filter_acls[acl_table]['ports'] = active_ports @@ -840,7 +841,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw # hostname is the asic_name, get the asic_id from the asic_name if asic_name is not None: - asic_id = get_npu_id_from_name(asic_name) + asic_id = get_asic_id_from_name(asic_name) else: asic_id = None @@ -921,14 +922,14 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['BGP_PEER_RANGE'] = bgp_peers_with_range if mgmt_routes: # TODO: differentiate v4 and v6 - mgmt_intf.itervalues().next()['forced_mgmt_routes'] = mgmt_routes + iter(mgmt_intf.values()).next()['forced_mgmt_routes'] = mgmt_routes results['MGMT_PORT'] = {} results['MGMT_INTERFACE'] = {} mgmt_intf_count = 0 mgmt_alias_reverse_mapping = {} for key in mgmt_intf: alias = key[0] - if mgmt_alias_reverse_mapping.has_key(alias): + if alias in mgmt_alias_reverse_mapping: name = mgmt_alias_reverse_mapping[alias] else: name = 'eth' + str(mgmt_intf_count) @@ -953,14 +954,14 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw phyport_intfs = {} vlan_intfs = {} pc_intfs = {} - vlan_invert_mapping = { v['alias']:k for k,v in vlans.items() if v.has_key('alias') } + vlan_invert_mapping = { v['alias']:k for k,v in vlans.items() if 'alias' in v } vlan_sub_intfs = {} for intf in intfs: if intf[0][0:4] == 'Vlan': vlan_intfs[intf] = {} vlan_intfs[intf[0]] = {} - elif vlan_invert_mapping.has_key(intf[0]): + elif intf[0] in vlan_invert_mapping: vlan_intfs[(vlan_invert_mapping[intf[0]], intf[1])] = {} vlan_intfs[vlan_invert_mapping[intf[0]]] = {} elif intf[0][0:11] == 'PortChannel': @@ -975,7 +976,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw for port_name in port_speeds_default: # ignore port not in port_config.ini - if not ports.has_key(port_name): + if port_name not in ports: continue ports.setdefault(port_name, {})['speed'] = port_speeds_default[port_name] @@ -985,12 +986,12 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw # If no port_config_file is found ports is empty so ignore this error if port_config_file is not None: if port_name not in ports: - print >> sys.stderr, "Warning: ignore interface '%s' as it is not in the port_config.ini" % port_name + print("Warning: ignore interface '%s' as it is not in the port_config.ini" % port_name, file=sys.stderr) continue ports.setdefault(port_name, {})['speed'] = port_speed_png[port_name] - for port_name, port in ports.items(): + for port_name, port in list(ports.items()): # get port alias from port_config.ini alias = port.get('alias', port_name) # generate default 100G FEC @@ -1001,14 +1002,14 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw # set port description if parsed from deviceinfo for port_name in port_descriptions: # ignore port not in port_config.ini - if not ports.has_key(port_name): + if port_name not in ports: continue ports.setdefault(port_name, {})['description'] = port_descriptions[port_name] for port_name, port in ports.items(): if not port.get('description'): - if neighbors.has_key(port_name): + if port_name in neighbors: # for the ports w/o description set it to neighbor name:port port['description'] = "%s:%s" % (neighbors[port_name]['name'], neighbors[port_name]['port']) else: @@ -1016,11 +1017,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw port['description'] = port.get('alias', port_name) # set default port MTU as 9100 - for port in ports.itervalues(): + for port in ports.values(): port['mtu'] = '9100' # asymmetric PFC is disabled by default - for port in ports.itervalues(): + for port in ports.values(): port['pfc_asym'] = 'off' # set physical port default admin status up @@ -1028,11 +1029,16 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if port[0] in ports: ports.get(port[0])['admin_status'] = 'up' - for member in pc_members.keys() + vlan_members.keys(): + for member in list(pc_members.keys()) + list(vlan_members.keys()): port = ports.get(member[1]) if port: port['admin_status'] = 'up' + for port in neighbors.keys(): + if port in ports.keys(): + # make all neighbors connected ports to 'admin_up' + ports[port]['admin_status'] = 'up' + results['PORT'] = ports results['CONSOLE_PORT'] = console_ports @@ -1042,11 +1048,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw # remove portchannels that contain ports not existing in port_config.ini # when port_config.ini exists if not set(mbr_map['members']).issubset(port_set): - print >> sys.stderr, "Warning: ignore '%s' as part of its member interfaces is not in the port_config.ini" % pc_name + print("Warning: ignore '%s' as part of its member interfaces is not in the port_config.ini" % pc_name, file=sys.stderr) del pcs[pc_name] # set default port channel MTU as 9100 and admin status up - for pc in pcs.itervalues(): + for pc in pcs.values(): pc['mtu'] = '9100' pc['admin_status'] = 'up' @@ -1056,7 +1062,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw for pc_intf in pc_intfs.keys(): # remove portchannels not in PORTCHANNEL dictionary if isinstance(pc_intf, tuple) and pc_intf[0] not in pcs: - print >> sys.stderr, "Warning: ignore '%s' interface '%s' as '%s' is not in the valid PortChannel list" % (pc_intf[0], pc_intf[1], pc_intf[0]) + print("Warning: ignore '%s' interface '%s' as '%s' is not in the valid PortChannel list" % (pc_intf[0], pc_intf[1], pc_intf[0]), file=sys.stderr) del pc_intfs[pc_intf] pc_intfs.pop(pc_intf[0], None) @@ -1095,7 +1101,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw # remove port not in port_config.ini if nghbr not in ports: if port_config_file is not None: - print >> sys.stderr, "Warning: ignore interface '%s' in DEVICE_NEIGHBOR as it is not in the port_config.ini" % nghbr + print("Warning: ignore interface '%s' in DEVICE_NEIGHBOR as it is not in the port_config.ini" % nghbr, file=sys.stderr) del neighbors[nghbr] results['DEVICE_NEIGHBOR'] = neighbors if asic_name is None: @@ -1193,4 +1199,4 @@ def parse_asic_sub_role(filename, asic_name): def print_parse_xml(filename): results = parse_xml(filename) - print(json.dumps(results, indent=3, cls=minigraph_encoder)) + print((json.dumps(results, indent=3, cls=minigraph_encoder))) diff --git a/src/sonic-config-engine/openconfig_acl.py b/src/sonic-config-engine/openconfig_acl.py index cb29183652e7..d36b98301383 100644 --- a/src/sonic-config-engine/openconfig_acl.py +++ b/src/sonic-config-engine/openconfig_acl.py @@ -18,7 +18,9 @@ from pyangbind.lib.base import PybindBase from decimal import Decimal from bitarray import bitarray -import __builtin__ + +import builtins + class yc_state_openconfig_acl__acl_state(PybindBase): """ This class was auto-generated by the PythonClass plugin for PYANG @@ -39,7 +41,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-acl:AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) load = kwargs.pop("load", None) if args: @@ -66,7 +68,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'state'] + return ['acl', 'state'] def _get_counter_capability(self): """ @@ -91,7 +93,7 @@ def _set_counter_capability(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-acl:AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """counter_capability must be of a type compatible with identityref""", @@ -104,9 +106,9 @@ def _set_counter_capability(self, v, load=False): self._set() def _unset_counter_capability(self): - self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-acl:AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - counter_capability = __builtin__.property(_get_counter_capability) + counter_capability = builtins.property(_get_counter_capability) _pyangbind_elements = {'counter_capability': counter_capability, } @@ -132,8 +134,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__name = YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) load = kwargs.pop("load", None) if args: @@ -160,7 +162,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'config'] + return ['acl', 'acl-sets', 'acl-set', 'config'] def _get_name(self): """ @@ -183,7 +185,7 @@ def _set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """name must be of a type compatible with string""", @@ -196,7 +198,7 @@ def _set_name(self, v, load=False): self._set() def _unset_name(self): - self.__name = YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) def _get_description(self): @@ -220,7 +222,7 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", @@ -233,10 +235,10 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) - name = __builtin__.property(_get_name, _set_name) - description = __builtin__.property(_get_description, _set_description) + name = builtins.property(_get_name, _set_name) + description = builtins.property(_get_description, _set_description) _pyangbind_elements = {'name': name, 'description': description, } @@ -262,8 +264,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__name = YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) load = kwargs.pop("load", None) if args: @@ -290,7 +292,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'state'] + return ['acl', 'acl-sets', 'acl-set', 'state'] def _get_name(self): """ @@ -313,7 +315,7 @@ def _set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """name must be of a type compatible with string""", @@ -326,7 +328,7 @@ def _set_name(self, v, load=False): self._set() def _unset_name(self): - self.__name = YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) def _get_description(self): @@ -350,7 +352,7 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", @@ -363,10 +365,10 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) - name = __builtin__.property(_get_name) - description = __builtin__.property(_get_description) + name = builtins.property(_get_name) + description = builtins.property(_get_description) _pyangbind_elements = {'name': name, 'description': description, } @@ -392,8 +394,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) load = kwargs.pop("load", None) if args: @@ -420,7 +422,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'config'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'config'] def _get_sequence_id(self): """ @@ -451,7 +453,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with uint32""", @@ -464,7 +466,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) def _get_description(self): @@ -490,7 +492,7 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", @@ -503,10 +505,10 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) - sequence_id = __builtin__.property(_get_sequence_id, _set_sequence_id) - description = __builtin__.property(_get_description, _set_description) + sequence_id = builtins.property(_get_sequence_id, _set_sequence_id) + description = builtins.property(_get_description, _set_description) _pyangbind_elements = {'sequence_id': sequence_id, 'description': description, } @@ -532,10 +534,10 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) load = kwargs.pop("load", None) if args: @@ -562,7 +564,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'state'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'state'] def _get_sequence_id(self): """ @@ -593,7 +595,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with uint32""", @@ -606,7 +608,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) def _get_description(self): @@ -632,7 +634,7 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", @@ -645,7 +647,7 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) def _get_matched_packets(self): @@ -695,7 +697,7 @@ def _set_matched_packets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_packets must be of a type compatible with yang:counter64""", @@ -708,7 +710,7 @@ def _set_matched_packets(self, v, load=False): self._set() def _unset_matched_packets(self): - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) def _get_matched_octets(self): @@ -758,7 +760,7 @@ def _set_matched_octets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_octets must be of a type compatible with yang:counter64""", @@ -771,12 +773,12 @@ def _set_matched_octets(self, v, load=False): self._set() def _unset_matched_octets(self): - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - sequence_id = __builtin__.property(_get_sequence_id) - description = __builtin__.property(_get_description) - matched_packets = __builtin__.property(_get_matched_packets) - matched_octets = __builtin__.property(_get_matched_octets) + sequence_id = builtins.property(_get_sequence_id) + description = builtins.property(_get_description) + matched_packets = builtins.property(_get_matched_packets) + matched_octets = builtins.property(_get_matched_octets) _pyangbind_elements = {'sequence_id': sequence_id, 'description': description, 'matched_packets': matched_packets, 'matched_octets': matched_octets, } @@ -802,11 +804,11 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) load = kwargs.pop("load", None) if args: @@ -833,7 +835,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'l2', u'config'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'l2', 'config'] def _get_source_mac(self): """ @@ -856,7 +858,7 @@ def _set_source_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac must be of a type compatible with yang:mac-address""", @@ -869,7 +871,7 @@ def _set_source_mac(self, v, load=False): self._set() def _unset_source_mac(self): - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_source_mac_mask(self): @@ -893,7 +895,7 @@ def _set_source_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac_mask must be of a type compatible with yang:mac-address""", @@ -906,7 +908,7 @@ def _set_source_mac_mask(self, v, load=False): self._set() def _unset_source_mac_mask(self): - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_destination_mac(self): @@ -930,7 +932,7 @@ def _set_destination_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac must be of a type compatible with yang:mac-address""", @@ -943,7 +945,7 @@ def _set_destination_mac(self, v, load=False): self._set() def _unset_destination_mac(self): - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_destination_mac_mask(self): @@ -967,7 +969,7 @@ def _set_destination_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac_mask must be of a type compatible with yang:mac-address""", @@ -980,7 +982,7 @@ def _set_destination_mac_mask(self, v, load=False): self._set() def _unset_destination_mac_mask(self): - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_ethertype(self): @@ -1004,7 +1006,7 @@ def _set_ethertype(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethertype must be of a type compatible with oc-pkt-match-types:ethertype-type""", @@ -1017,13 +1019,13 @@ def _set_ethertype(self, v, load=False): self._set() def _unset_ethertype(self): - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) - source_mac = __builtin__.property(_get_source_mac, _set_source_mac) - source_mac_mask = __builtin__.property(_get_source_mac_mask, _set_source_mac_mask) - destination_mac = __builtin__.property(_get_destination_mac, _set_destination_mac) - destination_mac_mask = __builtin__.property(_get_destination_mac_mask, _set_destination_mac_mask) - ethertype = __builtin__.property(_get_ethertype, _set_ethertype) + source_mac = builtins.property(_get_source_mac, _set_source_mac) + source_mac_mask = builtins.property(_get_source_mac_mask, _set_source_mac_mask) + destination_mac = builtins.property(_get_destination_mac, _set_destination_mac) + destination_mac_mask = builtins.property(_get_destination_mac_mask, _set_destination_mac_mask) + ethertype = builtins.property(_get_ethertype, _set_ethertype) _pyangbind_elements = {'source_mac': source_mac, 'source_mac_mask': source_mac_mask, 'destination_mac': destination_mac, 'destination_mac_mask': destination_mac_mask, 'ethertype': ethertype, } @@ -1049,11 +1051,11 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) load = kwargs.pop("load", None) if args: @@ -1080,7 +1082,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'l2', u'state'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'l2', 'state'] def _get_source_mac(self): """ @@ -1103,7 +1105,7 @@ def _set_source_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac must be of a type compatible with yang:mac-address""", @@ -1116,7 +1118,7 @@ def _set_source_mac(self, v, load=False): self._set() def _unset_source_mac(self): - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_source_mac_mask(self): @@ -1140,7 +1142,7 @@ def _set_source_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac_mask must be of a type compatible with yang:mac-address""", @@ -1153,7 +1155,7 @@ def _set_source_mac_mask(self, v, load=False): self._set() def _unset_source_mac_mask(self): - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_destination_mac(self): @@ -1177,7 +1179,7 @@ def _set_destination_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac must be of a type compatible with yang:mac-address""", @@ -1190,7 +1192,7 @@ def _set_destination_mac(self, v, load=False): self._set() def _unset_destination_mac(self): - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_destination_mac_mask(self): @@ -1214,7 +1216,7 @@ def _set_destination_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac_mask must be of a type compatible with yang:mac-address""", @@ -1227,7 +1229,7 @@ def _set_destination_mac_mask(self, v, load=False): self._set() def _unset_destination_mac_mask(self): - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_ethertype(self): @@ -1251,7 +1253,7 @@ def _set_ethertype(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethertype must be of a type compatible with oc-pkt-match-types:ethertype-type""", @@ -1264,13 +1266,13 @@ def _set_ethertype(self, v, load=False): self._set() def _unset_ethertype(self): - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) - source_mac = __builtin__.property(_get_source_mac) - source_mac_mask = __builtin__.property(_get_source_mac_mask) - destination_mac = __builtin__.property(_get_destination_mac) - destination_mac_mask = __builtin__.property(_get_destination_mac_mask) - ethertype = __builtin__.property(_get_ethertype) + source_mac = builtins.property(_get_source_mac) + source_mac_mask = builtins.property(_get_source_mac_mask) + destination_mac = builtins.property(_get_destination_mac) + destination_mac_mask = builtins.property(_get_destination_mac_mask) + ethertype = builtins.property(_get_ethertype) _pyangbind_elements = {'source_mac': source_mac, 'source_mac_mask': source_mac_mask, 'destination_mac': destination_mac, 'destination_mac_mask': destination_mac_mask, 'ethertype': ethertype, } @@ -1324,7 +1326,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'l2'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'l2'] def _get_config(self): """ @@ -1399,8 +1401,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) _pyangbind_elements = {'config': config, 'state': state, } @@ -1426,14 +1428,14 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) load = kwargs.pop("load", None) if args: @@ -1460,7 +1462,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'ip', u'config'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'ip', 'config'] def _get_ip_version(self): """ @@ -1483,12 +1485,12 @@ def _set_ip_version(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """ip_version must be of a type compatible with inet:ip-version""", 'defined-type': "inet:ip-version", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True)""", }) self.__ip_version = t @@ -1496,7 +1498,7 @@ def _set_ip_version(self, v, load=False): self._set() def _unset_ip_version(self): - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) def _get_source_ip_address(self): @@ -1520,7 +1522,7 @@ def _set_source_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_address must be of a type compatible with inet:ip-prefix""", @@ -1533,7 +1535,7 @@ def _set_source_ip_address(self, v, load=False): self._set() def _unset_source_ip_address(self): - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) def _get_source_ip_flow_label(self): @@ -1557,7 +1559,7 @@ def _set_source_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", @@ -1570,7 +1572,7 @@ def _set_source_ip_flow_label(self, v, load=False): self._set() def _unset_source_ip_flow_label(self): - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) def _get_destination_ip_address(self): @@ -1594,7 +1596,7 @@ def _set_destination_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_address must be of a type compatible with inet:ip-prefix""", @@ -1607,7 +1609,7 @@ def _set_destination_ip_address(self, v, load=False): self._set() def _unset_destination_ip_address(self): - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) def _get_destination_ip_flow_label(self): @@ -1631,7 +1633,7 @@ def _set_destination_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", @@ -1644,7 +1646,7 @@ def _set_destination_ip_flow_label(self, v, load=False): self._set() def _unset_destination_ip_flow_label(self): - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) def _get_dscp(self): @@ -1668,7 +1670,7 @@ def _set_dscp(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dscp must be of a type compatible with inet:dscp""", @@ -1681,7 +1683,7 @@ def _set_dscp(self, v, load=False): self._set() def _unset_dscp(self): - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) def _get_protocol(self): @@ -1705,7 +1707,7 @@ def _set_protocol(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """protocol must be of a type compatible with oc-pkt-match-types:ip-protocol-type""", @@ -1718,7 +1720,7 @@ def _set_protocol(self, v, load=False): self._set() def _unset_protocol(self): - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) def _get_hop_limit(self): @@ -1744,7 +1746,7 @@ def _set_hop_limit(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """hop_limit must be of a type compatible with uint8""", @@ -1757,16 +1759,16 @@ def _set_hop_limit(self, v, load=False): self._set() def _unset_hop_limit(self): - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) - ip_version = __builtin__.property(_get_ip_version, _set_ip_version) - source_ip_address = __builtin__.property(_get_source_ip_address, _set_source_ip_address) - source_ip_flow_label = __builtin__.property(_get_source_ip_flow_label, _set_source_ip_flow_label) - destination_ip_address = __builtin__.property(_get_destination_ip_address, _set_destination_ip_address) - destination_ip_flow_label = __builtin__.property(_get_destination_ip_flow_label, _set_destination_ip_flow_label) - dscp = __builtin__.property(_get_dscp, _set_dscp) - protocol = __builtin__.property(_get_protocol, _set_protocol) - hop_limit = __builtin__.property(_get_hop_limit, _set_hop_limit) + ip_version = builtins.property(_get_ip_version, _set_ip_version) + source_ip_address = builtins.property(_get_source_ip_address, _set_source_ip_address) + source_ip_flow_label = builtins.property(_get_source_ip_flow_label, _set_source_ip_flow_label) + destination_ip_address = builtins.property(_get_destination_ip_address, _set_destination_ip_address) + destination_ip_flow_label = builtins.property(_get_destination_ip_flow_label, _set_destination_ip_flow_label) + dscp = builtins.property(_get_dscp, _set_dscp) + protocol = builtins.property(_get_protocol, _set_protocol) + hop_limit = builtins.property(_get_hop_limit, _set_hop_limit) _pyangbind_elements = {'ip_version': ip_version, 'source_ip_address': source_ip_address, 'source_ip_flow_label': source_ip_flow_label, 'destination_ip_address': destination_ip_address, 'destination_ip_flow_label': destination_ip_flow_label, 'dscp': dscp, 'protocol': protocol, 'hop_limit': hop_limit, } @@ -1792,14 +1794,14 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) load = kwargs.pop("load", None) if args: @@ -1826,7 +1828,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'ip', u'state'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'ip', 'state'] def _get_ip_version(self): """ @@ -1849,12 +1851,12 @@ def _set_ip_version(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ip_version must be of a type compatible with inet:ip-version""", 'defined-type': "inet:ip-version", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False)""", }) self.__ip_version = t @@ -1862,7 +1864,7 @@ def _set_ip_version(self, v, load=False): self._set() def _unset_ip_version(self): - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) def _get_source_ip_address(self): @@ -1886,7 +1888,7 @@ def _set_source_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_address must be of a type compatible with inet:ip-prefix""", @@ -1899,7 +1901,7 @@ def _set_source_ip_address(self, v, load=False): self._set() def _unset_source_ip_address(self): - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) def _get_source_ip_flow_label(self): @@ -1923,7 +1925,7 @@ def _set_source_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", @@ -1936,7 +1938,7 @@ def _set_source_ip_flow_label(self, v, load=False): self._set() def _unset_source_ip_flow_label(self): - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) def _get_destination_ip_address(self): @@ -1960,7 +1962,7 @@ def _set_destination_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_address must be of a type compatible with inet:ip-prefix""", @@ -1973,7 +1975,7 @@ def _set_destination_ip_address(self, v, load=False): self._set() def _unset_destination_ip_address(self): - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) def _get_destination_ip_flow_label(self): @@ -1997,7 +1999,7 @@ def _set_destination_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", @@ -2010,7 +2012,7 @@ def _set_destination_ip_flow_label(self, v, load=False): self._set() def _unset_destination_ip_flow_label(self): - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) def _get_dscp(self): @@ -2034,7 +2036,7 @@ def _set_dscp(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """dscp must be of a type compatible with inet:dscp""", @@ -2047,7 +2049,7 @@ def _set_dscp(self, v, load=False): self._set() def _unset_dscp(self): - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) def _get_protocol(self): @@ -2071,7 +2073,7 @@ def _set_protocol(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """protocol must be of a type compatible with oc-pkt-match-types:ip-protocol-type""", @@ -2084,7 +2086,7 @@ def _set_protocol(self, v, load=False): self._set() def _unset_protocol(self): - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) def _get_hop_limit(self): @@ -2110,7 +2112,7 @@ def _set_hop_limit(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """hop_limit must be of a type compatible with uint8""", @@ -2123,16 +2125,16 @@ def _set_hop_limit(self, v, load=False): self._set() def _unset_hop_limit(self): - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) - ip_version = __builtin__.property(_get_ip_version) - source_ip_address = __builtin__.property(_get_source_ip_address) - source_ip_flow_label = __builtin__.property(_get_source_ip_flow_label) - destination_ip_address = __builtin__.property(_get_destination_ip_address) - destination_ip_flow_label = __builtin__.property(_get_destination_ip_flow_label) - dscp = __builtin__.property(_get_dscp) - protocol = __builtin__.property(_get_protocol) - hop_limit = __builtin__.property(_get_hop_limit) + ip_version = builtins.property(_get_ip_version) + source_ip_address = builtins.property(_get_source_ip_address) + source_ip_flow_label = builtins.property(_get_source_ip_flow_label) + destination_ip_address = builtins.property(_get_destination_ip_address) + destination_ip_flow_label = builtins.property(_get_destination_ip_flow_label) + dscp = builtins.property(_get_dscp) + protocol = builtins.property(_get_protocol) + hop_limit = builtins.property(_get_hop_limit) _pyangbind_elements = {'ip_version': ip_version, 'source_ip_address': source_ip_address, 'source_ip_flow_label': source_ip_flow_label, 'destination_ip_address': destination_ip_address, 'destination_ip_flow_label': destination_ip_flow_label, 'dscp': dscp, 'protocol': protocol, 'hop_limit': hop_limit, } @@ -2186,7 +2188,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'ip'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'ip'] def _get_config(self): """ @@ -2261,8 +2263,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) _pyangbind_elements = {'config': config, 'state': state, } @@ -2288,9 +2290,9 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) load = kwargs.pop("load", None) if args: @@ -2317,7 +2319,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'transport', u'config'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'transport', 'config'] def _get_source_port(self): """ @@ -2340,12 +2342,12 @@ def _set_source_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", }) self.__source_port = t @@ -2353,7 +2355,7 @@ def _set_source_port(self, v, load=False): self._set() def _unset_source_port(self): - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) def _get_destination_port(self): @@ -2377,12 +2379,12 @@ def _set_destination_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", }) self.__destination_port = t @@ -2390,7 +2392,7 @@ def _set_destination_port(self, v, load=False): self._set() def _unset_destination_port(self): - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) def _get_tcp_flags(self): @@ -2414,7 +2416,7 @@ def _set_tcp_flags(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """tcp_flags must be of a type compatible with identityref""", @@ -2427,11 +2429,11 @@ def _set_tcp_flags(self, v, load=False): self._set() def _unset_tcp_flags(self): - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - source_port = __builtin__.property(_get_source_port, _set_source_port) - destination_port = __builtin__.property(_get_destination_port, _set_destination_port) - tcp_flags = __builtin__.property(_get_tcp_flags, _set_tcp_flags) + source_port = builtins.property(_get_source_port, _set_source_port) + destination_port = builtins.property(_get_destination_port, _set_destination_port) + tcp_flags = builtins.property(_get_tcp_flags, _set_tcp_flags) _pyangbind_elements = {'source_port': source_port, 'destination_port': destination_port, 'tcp_flags': tcp_flags, } @@ -2457,9 +2459,9 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) load = kwargs.pop("load", None) if args: @@ -2486,7 +2488,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'transport', u'state'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'transport', 'state'] def _get_source_port(self): """ @@ -2509,12 +2511,12 @@ def _set_source_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", }) self.__source_port = t @@ -2522,7 +2524,7 @@ def _set_source_port(self, v, load=False): self._set() def _unset_source_port(self): - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) def _get_destination_port(self): @@ -2546,12 +2548,12 @@ def _set_destination_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", }) self.__destination_port = t @@ -2559,7 +2561,7 @@ def _set_destination_port(self, v, load=False): self._set() def _unset_destination_port(self): - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) def _get_tcp_flags(self): @@ -2583,7 +2585,7 @@ def _set_tcp_flags(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """tcp_flags must be of a type compatible with identityref""", @@ -2596,11 +2598,11 @@ def _set_tcp_flags(self, v, load=False): self._set() def _unset_tcp_flags(self): - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - source_port = __builtin__.property(_get_source_port) - destination_port = __builtin__.property(_get_destination_port) - tcp_flags = __builtin__.property(_get_tcp_flags) + source_port = builtins.property(_get_source_port) + destination_port = builtins.property(_get_destination_port) + tcp_flags = builtins.property(_get_tcp_flags) _pyangbind_elements = {'source_port': source_port, 'destination_port': destination_port, 'tcp_flags': tcp_flags, } @@ -2654,7 +2656,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'transport'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'transport'] def _get_config(self): """ @@ -2729,8 +2731,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) _pyangbind_elements = {'config': config, 'state': state, } @@ -2756,8 +2758,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -2784,7 +2786,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface', u'interface-ref', u'config'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface', 'interface-ref', 'config'] def _get_interface(self): """ @@ -2811,7 +2813,7 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", @@ -2824,7 +2826,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_subinterface(self): @@ -2854,7 +2856,7 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", @@ -2867,10 +2869,10 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - interface = __builtin__.property(_get_interface, _set_interface) - subinterface = __builtin__.property(_get_subinterface, _set_subinterface) + interface = builtins.property(_get_interface, _set_interface) + subinterface = builtins.property(_get_subinterface, _set_subinterface) _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } @@ -2896,8 +2898,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -2924,7 +2926,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface', u'interface-ref', u'state'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface', 'interface-ref', 'state'] def _get_interface(self): """ @@ -2951,7 +2953,7 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", @@ -2964,7 +2966,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_subinterface(self): @@ -2994,7 +2996,7 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", @@ -3007,10 +3009,10 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - interface = __builtin__.property(_get_interface) - subinterface = __builtin__.property(_get_subinterface) + interface = builtins.property(_get_interface) + subinterface = builtins.property(_get_subinterface) _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } @@ -3064,7 +3066,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface', u'interface-ref'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface', 'interface-ref'] def _get_config(self): """ @@ -3139,8 +3141,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) _pyangbind_elements = {'config': config, 'state': state, } @@ -3193,7 +3195,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface'] def _get_interface_ref(self): """ @@ -3231,7 +3233,7 @@ def _set_interface_ref(self, v, load=False): def _unset_interface_ref(self): self.__interface_ref = YANGDynClass(base=yc_interface_ref_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - interface_ref = __builtin__.property(_get_interface_ref, _set_interface_ref) + interface_ref = builtins.property(_get_interface_ref, _set_interface_ref) _pyangbind_elements = {'interface_ref': interface_ref, } @@ -3257,8 +3259,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) load = kwargs.pop("load", None) if args: @@ -3285,7 +3287,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'actions', u'config'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'actions', 'config'] def _get_forwarding_action(self): """ @@ -3310,7 +3312,7 @@ def _set_forwarding_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """forwarding_action must be of a type compatible with identityref""", @@ -3323,7 +3325,7 @@ def _set_forwarding_action(self, v, load=False): self._set() def _unset_forwarding_action(self): - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) def _get_log_action(self): @@ -3351,7 +3353,7 @@ def _set_log_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """log_action must be of a type compatible with identityref""", @@ -3364,10 +3366,10 @@ def _set_log_action(self, v, load=False): self._set() def _unset_log_action(self): - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - forwarding_action = __builtin__.property(_get_forwarding_action, _set_forwarding_action) - log_action = __builtin__.property(_get_log_action, _set_log_action) + forwarding_action = builtins.property(_get_forwarding_action, _set_forwarding_action) + log_action = builtins.property(_get_log_action, _set_log_action) _pyangbind_elements = {'forwarding_action': forwarding_action, 'log_action': log_action, } @@ -3393,8 +3395,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) load = kwargs.pop("load", None) if args: @@ -3421,7 +3423,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'actions', u'state'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'actions', 'state'] def _get_forwarding_action(self): """ @@ -3446,7 +3448,7 @@ def _set_forwarding_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """forwarding_action must be of a type compatible with identityref""", @@ -3459,7 +3461,7 @@ def _set_forwarding_action(self, v, load=False): self._set() def _unset_forwarding_action(self): - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) def _get_log_action(self): @@ -3487,7 +3489,7 @@ def _set_log_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """log_action must be of a type compatible with identityref""", @@ -3500,10 +3502,10 @@ def _set_log_action(self, v, load=False): self._set() def _unset_log_action(self): - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - forwarding_action = __builtin__.property(_get_forwarding_action) - log_action = __builtin__.property(_get_log_action) + forwarding_action = builtins.property(_get_forwarding_action) + log_action = builtins.property(_get_log_action) _pyangbind_elements = {'forwarding_action': forwarding_action, 'log_action': log_action, } @@ -3558,7 +3560,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'actions'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'actions'] def _get_config(self): """ @@ -3633,8 +3635,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) _pyangbind_elements = {'config': config, 'state': state, } @@ -3664,7 +3666,7 @@ def __init__(self, *args, **kwargs): self.__input_interface = YANGDynClass(base=yc_input_interface_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface, is_container='container', yang_name="input-interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__actions = YANGDynClass(base=yc_actions_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions, is_container='container', yang_name="actions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__l2 = YANGDynClass(base=yc_l2_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2, is_container='container', yang_name="l2", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__transport = YANGDynClass(base=yc_transport_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport, is_container='container', yang_name="transport", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -3694,7 +3696,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry'] def _get_sequence_id(self): """ @@ -3722,7 +3724,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", @@ -3735,7 +3737,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -3998,14 +4000,14 @@ def _set_actions(self, v, load=False): def _unset_actions(self): self.__actions = YANGDynClass(base=yc_actions_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions, is_container='container', yang_name="actions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - sequence_id = __builtin__.property(_get_sequence_id, _set_sequence_id) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) - l2 = __builtin__.property(_get_l2, _set_l2) - ip = __builtin__.property(_get_ip, _set_ip) - transport = __builtin__.property(_get_transport, _set_transport) - input_interface = __builtin__.property(_get_input_interface, _set_input_interface) - actions = __builtin__.property(_get_actions, _set_actions) + sequence_id = builtins.property(_get_sequence_id, _set_sequence_id) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) + l2 = builtins.property(_get_l2, _set_l2) + ip = builtins.property(_get_ip, _set_ip) + transport = builtins.property(_get_transport, _set_transport) + input_interface = builtins.property(_get_input_interface, _set_input_interface) + actions = builtins.property(_get_actions, _set_actions) _pyangbind_elements = {'sequence_id': sequence_id, 'config': config, 'state': state, 'l2': l2, 'ip': ip, 'transport': transport, 'input_interface': input_interface, 'actions': actions, } @@ -4058,7 +4060,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set', u'acl-entries'] + return ['acl', 'acl-sets', 'acl-set', 'acl-entries'] def _get_acl_entry(self): """ @@ -4096,7 +4098,7 @@ def _set_acl_entry(self, v, load=False): def _unset_acl_entry(self): self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - acl_entry = __builtin__.property(_get_acl_entry, _set_acl_entry) + acl_entry = builtins.property(_get_acl_entry, _set_acl_entry) _pyangbind_elements = {'acl_entry': acl_entry, } @@ -4125,7 +4127,7 @@ def __init__(self, *args, **kwargs): self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - self.__name = YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_acl_sets_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) load = kwargs.pop("load", None) @@ -4153,7 +4155,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets', u'acl-set'] + return ['acl', 'acl-sets', 'acl-set'] def _get_name(self): """ @@ -4181,7 +4183,7 @@ def _set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """name must be of a type compatible with leafref""", @@ -4194,7 +4196,7 @@ def _set_name(self, v, load=False): self._set() def _unset_name(self): - self.__name = YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -4307,10 +4309,10 @@ def _set_acl_entries(self, v, load=False): def _unset_acl_entries(self): self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_acl_sets_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - name = __builtin__.property(_get_name, _set_name) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) - acl_entries = __builtin__.property(_get_acl_entries, _set_acl_entries) + name = builtins.property(_get_name, _set_name) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) + acl_entries = builtins.property(_get_acl_entries, _set_acl_entries) _pyangbind_elements = {'name': name, 'config': config, 'state': state, 'acl_entries': acl_entries, } @@ -4363,7 +4365,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'acl-sets'] + return ['acl', 'acl-sets'] def _get_acl_set(self): """ @@ -4403,7 +4405,7 @@ def _set_acl_set(self, v, load=False): def _unset_acl_set(self): self.__acl_set = YANGDynClass(base=YANGListType("name",yc_acl_set_openconfig_acl__acl_acl_sets_acl_set, yang_name="acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - acl_set = __builtin__.property(_get_acl_set, _set_acl_set) + acl_set = builtins.property(_get_acl_set, _set_acl_set) _pyangbind_elements = {'acl_set': acl_set, } @@ -4429,7 +4431,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__id = YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) + self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) load = kwargs.pop("load", None) if args: @@ -4456,7 +4458,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'config'] + return ['acl', 'interfaces', 'interface', 'config'] def _get_id(self): """ @@ -4481,7 +4483,7 @@ def _set_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """id must be of a type compatible with oc-if:interface-id""", @@ -4494,9 +4496,9 @@ def _set_id(self, v, load=False): self._set() def _unset_id(self): - self.__id = YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) + self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) - id = __builtin__.property(_get_id, _set_id) + id = builtins.property(_get_id, _set_id) _pyangbind_elements = {'id': id, } @@ -4522,7 +4524,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__id = YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) + self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) load = kwargs.pop("load", None) if args: @@ -4549,7 +4551,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'state'] + return ['acl', 'interfaces', 'interface', 'state'] def _get_id(self): """ @@ -4574,7 +4576,7 @@ def _set_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """id must be of a type compatible with oc-if:interface-id""", @@ -4587,9 +4589,9 @@ def _set_id(self, v, load=False): self._set() def _unset_id(self): - self.__id = YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) + self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) - id = __builtin__.property(_get_id) + id = builtins.property(_get_id) _pyangbind_elements = {'id': id, } @@ -4615,8 +4617,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -4643,7 +4645,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'interface-ref', u'config'] + return ['acl', 'interfaces', 'interface', 'interface-ref', 'config'] def _get_interface(self): """ @@ -4670,7 +4672,7 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", @@ -4683,7 +4685,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_subinterface(self): @@ -4713,7 +4715,7 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", @@ -4726,10 +4728,10 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - interface = __builtin__.property(_get_interface, _set_interface) - subinterface = __builtin__.property(_get_subinterface, _set_subinterface) + interface = builtins.property(_get_interface, _set_interface) + subinterface = builtins.property(_get_subinterface, _set_subinterface) _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } @@ -4755,8 +4757,8 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -4783,7 +4785,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'interface-ref', u'state'] + return ['acl', 'interfaces', 'interface', 'interface-ref', 'state'] def _get_interface(self): """ @@ -4810,7 +4812,7 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", @@ -4823,7 +4825,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_subinterface(self): @@ -4853,7 +4855,7 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", @@ -4866,10 +4868,10 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - interface = __builtin__.property(_get_interface) - subinterface = __builtin__.property(_get_subinterface) + interface = builtins.property(_get_interface) + subinterface = builtins.property(_get_subinterface) _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } @@ -4923,7 +4925,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'interface-ref'] + return ['acl', 'interfaces', 'interface', 'interface-ref'] def _get_config(self): """ @@ -4998,8 +5000,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_interface_ref_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) _pyangbind_elements = {'config': config, 'state': state, } @@ -5025,7 +5027,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -5052,7 +5054,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'config'] + return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'config'] def _get_set_name(self): """ @@ -5075,7 +5077,7 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", @@ -5088,9 +5090,9 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - set_name = __builtin__.property(_get_set_name, _set_set_name) + set_name = builtins.property(_get_set_name, _set_set_name) _pyangbind_elements = {'set_name': set_name, } @@ -5116,7 +5118,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -5143,7 +5145,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'state'] + return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'state'] def _get_set_name(self): """ @@ -5166,7 +5168,7 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", @@ -5179,9 +5181,9 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - set_name = __builtin__.property(_get_set_name) + set_name = builtins.property(_get_set_name) _pyangbind_elements = {'set_name': set_name, } @@ -5207,9 +5209,9 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) load = kwargs.pop("load", None) if args: @@ -5236,7 +5238,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'acl-entries', u'acl-entry', u'state'] + return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'acl-entries', 'acl-entry', 'state'] def _get_sequence_id(self): """ @@ -5261,7 +5263,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", @@ -5274,7 +5276,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_matched_packets(self): @@ -5324,7 +5326,7 @@ def _set_matched_packets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_packets must be of a type compatible with yang:counter64""", @@ -5337,7 +5339,7 @@ def _set_matched_packets(self, v, load=False): self._set() def _unset_matched_packets(self): - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) def _get_matched_octets(self): @@ -5387,7 +5389,7 @@ def _set_matched_octets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_octets must be of a type compatible with yang:counter64""", @@ -5400,11 +5402,11 @@ def _set_matched_octets(self, v, load=False): self._set() def _unset_matched_octets(self): - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - sequence_id = __builtin__.property(_get_sequence_id) - matched_packets = __builtin__.property(_get_matched_packets) - matched_octets = __builtin__.property(_get_matched_octets) + sequence_id = builtins.property(_get_sequence_id) + matched_packets = builtins.property(_get_matched_packets) + matched_octets = builtins.property(_get_matched_octets) _pyangbind_elements = {'sequence_id': sequence_id, 'matched_packets': matched_packets, 'matched_octets': matched_octets, } @@ -5430,7 +5432,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) load = kwargs.pop("load", None) @@ -5458,7 +5460,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'acl-entries', u'acl-entry'] + return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'acl-entries', 'acl-entry'] def _get_sequence_id(self): """ @@ -5486,7 +5488,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", @@ -5499,7 +5501,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_state(self): @@ -5538,8 +5540,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) - sequence_id = __builtin__.property(_get_sequence_id) - state = __builtin__.property(_get_state) + sequence_id = builtins.property(_get_sequence_id) + state = builtins.property(_get_state) _pyangbind_elements = {'sequence_id': sequence_id, 'state': state, } @@ -5592,7 +5594,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'acl-entries'] + return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'acl-entries'] def _get_acl_entry(self): """ @@ -5630,7 +5632,7 @@ def _set_acl_entry(self, v, load=False): def _unset_acl_entry(self): self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=False) - acl_entry = __builtin__.property(_get_acl_entry) + acl_entry = builtins.property(_get_acl_entry) _pyangbind_elements = {'acl_entry': acl_entry, } @@ -5656,7 +5658,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -5686,7 +5688,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set'] + return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set'] def _get_set_name(self): """ @@ -5714,7 +5716,7 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", @@ -5727,7 +5729,7 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -5840,10 +5842,10 @@ def _set_acl_entries(self, v, load=False): def _unset_acl_entries(self): self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - set_name = __builtin__.property(_get_set_name, _set_set_name) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) - acl_entries = __builtin__.property(_get_acl_entries, _set_acl_entries) + set_name = builtins.property(_get_set_name, _set_set_name) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) + acl_entries = builtins.property(_get_acl_entries, _set_acl_entries) _pyangbind_elements = {'set_name': set_name, 'config': config, 'state': state, 'acl_entries': acl_entries, } @@ -5897,7 +5899,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets'] + return ['acl', 'interfaces', 'interface', 'ingress-acl-sets'] def _get_ingress_acl_set(self): """ @@ -5935,7 +5937,7 @@ def _set_ingress_acl_set(self, v, load=False): def _unset_ingress_acl_set(self): self.__ingress_acl_set = YANGDynClass(base=YANGListType("set_name",yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set, yang_name="ingress-acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='set-name', extensions=None), is_container='list', yang_name="ingress-acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - ingress_acl_set = __builtin__.property(_get_ingress_acl_set, _set_ingress_acl_set) + ingress_acl_set = builtins.property(_get_ingress_acl_set, _set_ingress_acl_set) _pyangbind_elements = {'ingress_acl_set': ingress_acl_set, } @@ -5961,7 +5963,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -5988,7 +5990,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'config'] + return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'config'] def _get_set_name(self): """ @@ -6011,7 +6013,7 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", @@ -6024,9 +6026,9 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - set_name = __builtin__.property(_get_set_name, _set_set_name) + set_name = builtins.property(_get_set_name, _set_set_name) _pyangbind_elements = {'set_name': set_name, } @@ -6052,7 +6054,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -6079,7 +6081,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'state'] + return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'state'] def _get_set_name(self): """ @@ -6102,7 +6104,7 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", @@ -6115,9 +6117,9 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - set_name = __builtin__.property(_get_set_name) + set_name = builtins.property(_get_set_name) _pyangbind_elements = {'set_name': set_name, } @@ -6143,9 +6145,9 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) load = kwargs.pop("load", None) if args: @@ -6172,7 +6174,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'acl-entries', u'acl-entry', u'state'] + return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'acl-entries', 'acl-entry', 'state'] def _get_sequence_id(self): """ @@ -6197,7 +6199,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", @@ -6210,7 +6212,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_matched_packets(self): @@ -6260,7 +6262,7 @@ def _set_matched_packets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_packets must be of a type compatible with yang:counter64""", @@ -6273,7 +6275,7 @@ def _set_matched_packets(self, v, load=False): self._set() def _unset_matched_packets(self): - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) def _get_matched_octets(self): @@ -6323,7 +6325,7 @@ def _set_matched_octets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_octets must be of a type compatible with yang:counter64""", @@ -6336,11 +6338,11 @@ def _set_matched_octets(self, v, load=False): self._set() def _unset_matched_octets(self): - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - sequence_id = __builtin__.property(_get_sequence_id) - matched_packets = __builtin__.property(_get_matched_packets) - matched_octets = __builtin__.property(_get_matched_octets) + sequence_id = builtins.property(_get_sequence_id) + matched_packets = builtins.property(_get_matched_packets) + matched_octets = builtins.property(_get_matched_octets) _pyangbind_elements = {'sequence_id': sequence_id, 'matched_packets': matched_packets, 'matched_octets': matched_octets, } @@ -6366,7 +6368,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) load = kwargs.pop("load", None) @@ -6394,7 +6396,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'acl-entries', u'acl-entry'] + return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'acl-entries', 'acl-entry'] def _get_sequence_id(self): """ @@ -6422,7 +6424,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", @@ -6435,7 +6437,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_state(self): @@ -6474,8 +6476,8 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) - sequence_id = __builtin__.property(_get_sequence_id) - state = __builtin__.property(_get_state) + sequence_id = builtins.property(_get_sequence_id) + state = builtins.property(_get_state) _pyangbind_elements = {'sequence_id': sequence_id, 'state': state, } @@ -6528,7 +6530,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'acl-entries'] + return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'acl-entries'] def _get_acl_entry(self): """ @@ -6566,7 +6568,7 @@ def _set_acl_entry(self, v, load=False): def _unset_acl_entry(self): self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=False) - acl_entry = __builtin__.property(_get_acl_entry) + acl_entry = builtins.property(_get_acl_entry) _pyangbind_elements = {'acl_entry': acl_entry, } @@ -6592,7 +6594,7 @@ def __init__(self, *args, **kwargs): self._path_helper = False self._extmethods = False - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -6622,7 +6624,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set'] + return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set'] def _get_set_name(self): """ @@ -6650,7 +6652,7 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", @@ -6663,7 +6665,7 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -6776,10 +6778,10 @@ def _set_acl_entries(self, v, load=False): def _unset_acl_entries(self): self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - set_name = __builtin__.property(_get_set_name, _set_set_name) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) - acl_entries = __builtin__.property(_get_acl_entries, _set_acl_entries) + set_name = builtins.property(_get_set_name, _set_set_name) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) + acl_entries = builtins.property(_get_acl_entries, _set_acl_entries) _pyangbind_elements = {'set_name': set_name, 'config': config, 'state': state, 'acl_entries': acl_entries, } @@ -6833,7 +6835,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface', u'egress-acl-sets'] + return ['acl', 'interfaces', 'interface', 'egress-acl-sets'] def _get_egress_acl_set(self): """ @@ -6871,7 +6873,7 @@ def _set_egress_acl_set(self, v, load=False): def _unset_egress_acl_set(self): self.__egress_acl_set = YANGDynClass(base=YANGListType("set_name",yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set, yang_name="egress-acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='set-name', extensions=None), is_container='list', yang_name="egress-acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - egress_acl_set = __builtin__.property(_get_egress_acl_set, _set_egress_acl_set) + egress_acl_set = builtins.property(_get_egress_acl_set, _set_egress_acl_set) _pyangbind_elements = {'egress_acl_set': egress_acl_set, } @@ -6901,7 +6903,7 @@ def __init__(self, *args, **kwargs): self.__egress_acl_sets = YANGDynClass(base=yc_egress_acl_sets_openconfig_acl__acl_interfaces_interface_egress_acl_sets, is_container='container', yang_name="egress-acl-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_interfaces_interface_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - self.__id = YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__interface_ref = YANGDynClass(base=yc_interface_ref_openconfig_acl__acl_interfaces_interface_interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) load = kwargs.pop("load", None) @@ -6929,7 +6931,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces', u'interface'] + return ['acl', 'interfaces', 'interface'] def _get_id(self): """ @@ -6957,7 +6959,7 @@ def _set_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """id must be of a type compatible with leafref""", @@ -6970,7 +6972,7 @@ def _set_id(self, v, load=False): self._set() def _unset_id(self): - self.__id = YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -7161,12 +7163,12 @@ def _set_egress_acl_sets(self, v, load=False): def _unset_egress_acl_sets(self): self.__egress_acl_sets = YANGDynClass(base=yc_egress_acl_sets_openconfig_acl__acl_interfaces_interface_egress_acl_sets, is_container='container', yang_name="egress-acl-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - id = __builtin__.property(_get_id, _set_id) - config = __builtin__.property(_get_config, _set_config) - state = __builtin__.property(_get_state, _set_state) - interface_ref = __builtin__.property(_get_interface_ref, _set_interface_ref) - ingress_acl_sets = __builtin__.property(_get_ingress_acl_sets, _set_ingress_acl_sets) - egress_acl_sets = __builtin__.property(_get_egress_acl_sets, _set_egress_acl_sets) + id = builtins.property(_get_id, _set_id) + config = builtins.property(_get_config, _set_config) + state = builtins.property(_get_state, _set_state) + interface_ref = builtins.property(_get_interface_ref, _set_interface_ref) + ingress_acl_sets = builtins.property(_get_ingress_acl_sets, _set_ingress_acl_sets) + egress_acl_sets = builtins.property(_get_egress_acl_sets, _set_egress_acl_sets) _pyangbind_elements = {'id': id, 'config': config, 'state': state, 'interface_ref': interface_ref, 'ingress_acl_sets': ingress_acl_sets, 'egress_acl_sets': egress_acl_sets, } @@ -7220,7 +7222,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl', u'interfaces'] + return ['acl', 'interfaces'] def _get_interface(self): """ @@ -7258,7 +7260,7 @@ def _set_interface(self, v, load=False): def _unset_interface(self): self.__interface = YANGDynClass(base=YANGListType("id",yc_interface_openconfig_acl__acl_interfaces_interface, yang_name="interface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - interface = __builtin__.property(_get_interface, _set_interface) + interface = builtins.property(_get_interface, _set_interface) _pyangbind_elements = {'interface': interface, } @@ -7314,7 +7316,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return [u'acl'] + return ['acl'] def _get_state(self): """ @@ -7428,9 +7430,9 @@ def _set_interfaces(self, v, load=False): def _unset_interfaces(self): self.__interfaces = YANGDynClass(base=yc_interfaces_openconfig_acl__acl_interfaces, is_container='container', yang_name="interfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - state = __builtin__.property(_get_state, _set_state) - acl_sets = __builtin__.property(_get_acl_sets, _set_acl_sets) - interfaces = __builtin__.property(_get_interfaces, _set_interfaces) + state = builtins.property(_get_state, _set_state) + acl_sets = builtins.property(_get_acl_sets, _set_acl_sets) + interfaces = builtins.property(_get_interfaces, _set_interfaces) _pyangbind_elements = {'state': state, 'acl_sets': acl_sets, 'interfaces': interfaces, } @@ -7536,7 +7538,7 @@ def _set_acl(self, v, load=False): def _unset_acl(self): self.__acl = YANGDynClass(base=yc_acl_openconfig_acl__acl, is_container='container', yang_name="acl", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - acl = __builtin__.property(_get_acl, _set_acl) + acl = builtins.property(_get_acl, _set_acl) _pyangbind_elements = {'acl': acl, } diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index 9b2d798aef57..714ddd37f5f9 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -42,7 +42,7 @@ def readJson(filename): data_dict = ast.literal_eval(json.dumps(data)) return data_dict except Exception as e: - print("error occurred while parsing json:", sys.exc_info()[1]) + print("error occurred while parsing json: {}".format(sys.exc_info()[1])) return None def db_connect_configdb(): diff --git a/src/sonic-config-engine/setup.py b/src/sonic-config-engine/setup.py index f08577234c45..8ddcb62d1ab0 100755 --- a/src/sonic-config-engine/setup.py +++ b/src/sonic-config-engine/setup.py @@ -6,29 +6,53 @@ import glob def get_test_suite(): - test_loader = unittest.TestLoader() - test_suite = test_loader.discover('tests', pattern='*.py') - return test_suite + test_loader = unittest.TestLoader() + test_suite = test_loader.discover('tests', pattern='*.py') + return test_suite -setup(name='sonic-config-engine', - version='1.0', - description='Utilities for generating SONiC configuration files', - author='Taoyu Li', - author_email='taoyl@microsoft.com', - url='https://github.com/Azure/sonic-buildimage', - py_modules=['portconfig', 'minigraph', 'openconfig_acl', 'sonic_device_util', 'config_samples', 'redis_bcc', 'lazy_re'], - scripts=['sonic-cfggen'], - install_requires=[ - 'ipaddr', - 'jinja2>=2.10', - 'lxml', - 'netaddr', - 'pyyaml', - 'pyangbind==0.6.0', - 'sonic-py-common' - ], - test_suite='setup.get_test_suite', - data_files=[ +setup( + name = 'sonic-config-engine', + version = '1.0', + description = 'Utilities for generating SONiC configuration files', + author='Taoyu Li', + author_email='taoyl@microsoft.com', + url = 'https://github.com/Azure/sonic-buildimage', + py_modules = [ + 'portconfig', + 'minigraph', + 'openconfig_acl', + 'config_samples', + 'redis_bcc', + 'lazy_re', + ], + scripts = [ + 'sonic-cfggen', + ], + install_requires = [ + 'future', + 'ipaddr', + 'jinja2>=2.10', + 'lxml', + 'netaddr', + 'pyyaml', + 'pyangbind==0.6.0', + 'sonic-py-common', + ], + test_suite = 'setup.get_test_suite', + data_files = [ ('/usr/share/sonic/templates', glob.glob('data/*')), - ], - ) + ], + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', + classifiers=[ + 'Intended Audience :: Developers', + 'Natural Language :: English', + "Programming Language :: Python :: 2", + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + ], +) + diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index b062fbda6b0d..ae1b5977d892 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -35,6 +35,7 @@ import yaml import jinja2 import netaddr import json +import contextlib from functools import partial from minigraph import minigraph_encoder from minigraph import parse_xml @@ -42,7 +43,7 @@ from minigraph import parse_device_desc_xml from minigraph import parse_asic_sub_role from portconfig import get_port_config, get_port_config_file_name, get_breakout_mode from sonic_py_common.device_info import get_platform, get_system_mac -from sonic_py_common.device_info import get_npu_id_from_name, is_multi_npu +from sonic_py_common.multi_asic import get_asic_id_from_name, is_multi_asic from config_samples import generate_sample_config from config_samples import get_available_config from swsssdk import SonicV2Connector, ConfigDBConnector, SonicDBConfig @@ -50,6 +51,10 @@ from redis_bcc import RedisBytecodeCache from collections import OrderedDict from natsort import natsorted +#TODO: Remove STR_TYPE once SONiC moves to Python 3.x +PY3x = sys.version_info >= (3, 0) +STR_TYPE = str if PY3x else unicode + def sort_by_port_index(value): if not value: return @@ -166,7 +171,7 @@ TODO(taoyl): Current version of config db only supports BGP admin states. if lookup_key != None: newData = {} for key in data.keys(): - if ((type(key) is unicode and lookup_key == key) or (type(key) is tuple and lookup_key in key)): + if ((type(key) is STR_TYPE and lookup_key == key) or (type(key) is tuple and lookup_key in key)): newData[ConfigDBConnector.serialize_key(key)] = data.pop(key) break return newData @@ -190,7 +195,7 @@ TODO(taoyl): Current version of config db only supports BGP admin states. def deep_update(dst, src): - for key, value in src.iteritems(): + for key, value in src.items(): if isinstance(value, dict): node = dst.setdefault(key, {}) deep_update(node, value) @@ -204,6 +209,45 @@ def sort_data(data): data[table] = OrderedDict(natsorted(data[table].items())) return data +@contextlib.contextmanager +def smart_open(filename=None, mode=None): + """ + Provide contextual file descriptor of filename if it is not a file descriptor + """ + smart_file = open(filename, mode) if not isinstance(filename, file) else filename + try: + yield smart_file + finally: + if not isinstance(filename, file): + smart_file.close() + +def _process_json(args, data): + """ + Process JSON file and update switch configuration data + """ + for json_file in args.json: + with open(json_file, 'r') as stream: + deep_update(data, FormatConverter.to_deserialized(json.load(stream))) + +def _get_jinja2_env(paths): + """ + Retreive Jinj2 env used to render configuration templates + """ + loader = jinja2.FileSystemLoader(paths) + redis_bcc = RedisBytecodeCache(SonicV2Connector(host='127.0.0.1')) + env = jinja2.Environment(loader=loader, trim_blocks=True, bytecode_cache=redis_bcc) + env.filters['sort_by_port_index'] = sort_by_port_index + env.filters['ipv4'] = is_ipv4 + env.filters['ipv6'] = is_ipv6 + env.filters['unique_name'] = unique_name + env.filters['pfx_filter'] = pfx_filter + env.filters['ip_network'] = ip_network + for attr in ['ip', 'network', 'prefixlen', 'netmask', 'broadcast']: + env.filters[attr] = partial(prefix_attr, attr) + # Pass the is_multi_asic function as global + env.globals['multi_asic'] = is_multi_asic + + return env def main(): parser=argparse.ArgumentParser(description="Render configuration file from minigraph data and jinja2 template.") @@ -221,14 +265,15 @@ def main(): parser.add_argument("-H", "--platform-info", help="read platform and hardware info", action='store_true') parser.add_argument("-s", "--redis-unix-sock-file", help="unix sock file for redis connection") group = parser.add_mutually_exclusive_group() - group.add_argument("-t", "--template", help="render the data with the template file") + group.add_argument("-t", "--template", help="render the data with the template file", action="append", default=[], + type=lambda opt_value: tuple(opt_value.split(',')) if ',' in opt_value else (opt_value, sys.stdout)) parser.add_argument("-T", "--template_dir", help="search base for the template files", action='store') group.add_argument("-v", "--var", help="print the value of a variable, support jinja2 expression") group.add_argument("--var-json", help="print the value of a variable, in json format") - group.add_argument("-w", "--write-to-db", help="write config into configdb", action='store_true') - group.add_argument("--print-data", help="print all data", action='store_true') group.add_argument("--preset", help="generate sample configuration from a preset template", choices=get_available_config()) group = parser.add_mutually_exclusive_group() + group.add_argument("--print-data", help="print all data", action='store_true') + group.add_argument("-w", "--write-to-db", help="write config into configdb", action='store_true') group.add_argument("-K", "--key", help="Lookup for a specific key") args = parser.parse_args() @@ -243,7 +288,7 @@ def main(): asic_name = args.namespace asic_id = None if asic_name is not None: - asic_id = get_npu_id_from_name(asic_name) + asic_id = get_asic_id_from_name(asic_name) # Load the database config for the namespace from global database json @@ -267,9 +312,7 @@ def main(): if brkout_table is not None: deep_update(data, {'BREAKOUT_CFG': brkout_table}) - for json_file in args.json: - with open(json_file, 'r') as stream: - deep_update(data, FormatConverter.to_deserialized(json.load(stream))) + _process_json(args, data) if args.minigraph != None: minigraph = args.minigraph @@ -297,7 +340,7 @@ def main(): if args.from_db: if args.namespace is None: - configdb = ConfigDBConnector(**db_kwargs) + configdb = ConfigDBConnector(use_unix_socket_path=True, **db_kwargs) else: configdb = ConfigDBConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs) @@ -328,28 +371,23 @@ def main(): hardware_data['DEVICE_METADATA']['localhost'].update(asic_id=asic_id) deep_update(data, hardware_data) - if args.template is not None: - template_file = os.path.abspath(args.template) - paths = ['/', '/usr/share/sonic/templates', os.path.dirname(template_file)] - if args.template_dir is not None: - template_dir = os.path.abspath(args.template_dir) - paths.append(template_dir) - loader = jinja2.FileSystemLoader(paths) - - redis_bcc = RedisBytecodeCache(SonicV2Connector(host='127.0.0.1')) - env = jinja2.Environment(loader=loader, trim_blocks=True, bytecode_cache=redis_bcc) - env.filters['sort_by_port_index'] = sort_by_port_index - env.filters['ipv4'] = is_ipv4 - env.filters['ipv6'] = is_ipv6 - env.filters['unique_name'] = unique_name - env.filters['pfx_filter'] = pfx_filter - env.filters['ip_network'] = ip_network - for attr in ['ip', 'network', 'prefixlen', 'netmask', 'broadcast']: - env.filters[attr] = partial(prefix_attr, attr) - # Pass the is_multi_npu function as global - env.globals['multi_asic'] = is_multi_npu - template = env.get_template(template_file) - print(template.render(sort_data(data))) + paths = ['/', '/usr/share/sonic/templates'] + if args.template_dir: + paths.append(os.path.abspath(args.template_dir)) + + if args.template: + for template_file, _ in args.template: + paths.append(os.path.dirname(os.path.abspath(template_file))) + env = _get_jinja2_env(paths) + sorted_data = sort_data(data) + for template_file, dest_file in args.template: + template = env.get_template(os.path.basename(template_file)) + template_data = template.render(sorted_data) + if dest_file == "config-db": + deep_update(data, FormatConverter.to_deserialized(json.loads(template_data))) + else: + with smart_open(dest_file, 'w') as df: + print(template_data, file=df) if args.var != None: template = jinja2.Template('{{' + args.var + '}}') @@ -363,7 +401,7 @@ def main(): if args.write_to_db: if args.namespace is None: - configdb = ConfigDBConnector(**db_kwargs) + configdb = ConfigDBConnector(use_unix_socket_path=True, **db_kwargs) else: configdb = ConfigDBConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs) diff --git a/src/sonic-config-engine/sonic_device_util.py b/src/sonic-config-engine/sonic_device_util.py deleted file mode 100644 index ddfa751250c5..000000000000 --- a/src/sonic-config-engine/sonic_device_util.py +++ /dev/null @@ -1,220 +0,0 @@ -#!/usr/bin/env python -import os -import yaml -import subprocess -import re -from natsort import natsorted -import glob -from swsssdk import ConfigDBConnector, SonicDBConfig - -DOCUMENTATION = ''' ---- -module: sonic_device_util -version_added: "1.9" -short_description: Retrieve device related facts for a device. -description: - - Retrieve device related facts from config files. -''' - -''' -TODO: this file shall be renamed and moved to other places in future -to have it shared with multiple applications. -''' -SONIC_DEVICE_PATH = '/usr/share/sonic/device' -NPU_NAME_PREFIX = 'asic' -NAMESPACE_PATH_GLOB = '/run/netns/*' -ASIC_CONF_FILENAME = 'asic.conf' -FRONTEND_ASIC_SUB_ROLE = 'FrontEnd' -BACKEND_ASIC_SUB_ROLE = 'BackEnd' -def get_machine_info(): - if not os.path.isfile('/host/machine.conf'): - return None - machine_vars = {} - with open('/host/machine.conf') as machine_file: - for line in machine_file: - tokens = line.split('=') - if len(tokens) < 2: - continue - machine_vars[tokens[0]] = tokens[1].strip() - return machine_vars - -def get_npu_id_from_name(npu_name): - if npu_name.startswith(NPU_NAME_PREFIX): - return npu_name[len(NPU_NAME_PREFIX):] - else: - return None - -def get_asic_conf_file_path(platform): - asic_conf_path_candidates = [] - asic_conf_path_candidates.append(os.path.join('/usr/share/sonic/platform', ASIC_CONF_FILENAME)) - if platform is not None: - asic_conf_path_candidates.append(os.path.join(SONIC_DEVICE_PATH, platform, ASIC_CONF_FILENAME)) - for asic_conf_file_path in asic_conf_path_candidates: - if os.path.isfile(asic_conf_file_path): - return asic_conf_file_path - return None - -def get_num_npus(): - platform = get_platform_info(get_machine_info()) - asic_conf_file_path = get_asic_conf_file_path(platform) - if asic_conf_file_path is None: - return 1 - with open(asic_conf_file_path) as asic_conf_file: - for line in asic_conf_file: - tokens = line.split('=') - if len(tokens) < 2: - continue - if tokens[0].lower() == 'num_asic': - num_npus = tokens[1].strip() - return int(num_npus) - -def get_namespaces(): - """ - In a multi NPU platform, each NPU is in a Linux Namespace. - This method returns list of all the Namespace present on the device - """ - ns_list = [] - for path in glob.glob(NAMESPACE_PATH_GLOB): - ns = os.path.basename(path) - ns_list.append(ns) - return natsorted(ns_list) - -def get_hwsku(): - config_db = ConfigDBConnector() - config_db.connect() - metadata = config_db.get_table('DEVICE_METADATA') - return metadata['localhost']['hwsku'] - -def get_platform(): - if not os.path.isfile('/host/machine.conf'): - return '' - - with open('/host/machine.conf') as machine_conf: - for line in machine_conf: - tokens = line.split('=') - if tokens[0].strip() == 'onie_platform' or tokens[0].strip() == 'aboot_platform': - return tokens[1].strip() - return '' - -def is_multi_npu(): - num_npus = get_num_npus() - return (num_npus > 1) - -def get_all_namespaces(): - """ - In case of Multi-Asic platform, Each ASIC will have a linux network namespace created. - So we loop through the databases in different namespaces and depending on the sub_role - decide whether this is a front end ASIC/namespace or a back end one. - """ - front_ns = [] - back_ns = [] - num_npus = get_num_npus() - SonicDBConfig.load_sonic_global_db_config() - - if is_multi_npu(): - for npu in range(num_npus): - namespace = "{}{}".format(NPU_NAME_PREFIX, npu) - config_db = ConfigDBConnector(use_unix_socket_path=True, namespace=namespace) - config_db.connect() - - metadata = config_db.get_table('DEVICE_METADATA') - if metadata['localhost']['sub_role'] == FRONTEND_ASIC_SUB_ROLE: - front_ns.append(namespace) - elif metadata['localhost']['sub_role'] == BACKEND_ASIC_SUB_ROLE: - back_ns.append(namespace) - - return {'front_ns':front_ns, 'back_ns':back_ns} - -def get_platform_info(machine_info): - if machine_info != None: - if machine_info.has_key('onie_platform'): - return machine_info['onie_platform'] - elif machine_info.has_key('aboot_platform'): - return machine_info['aboot_platform'] - return None - -def get_sonic_version_info(): - if not os.path.isfile('/etc/sonic/sonic_version.yml'): - return None - data = {} - with open('/etc/sonic/sonic_version.yml') as stream: - if yaml.__version__ >= "5.1": - data = yaml.full_load(stream) - else: - data = yaml.load(stream) - return data - -def valid_mac_address(mac): - return bool(re.match("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$", mac)) - -def get_system_mac(namespace=None): - version_info = get_sonic_version_info() - - if (version_info['asic_type'] == 'mellanox'): - # With Mellanox ONIE release(2019.05-5.2.0012) and above - # "onie_base_mac" was added to /host/machine.conf: - # onie_base_mac=e4:1d:2d:44:5e:80 - # So we have another way to get the mac address besides decode syseeprom - # By this can mitigate the dependency on the hw-management service - base_mac_key = "onie_base_mac" - machine_vars = get_machine_info() - if machine_vars is not None and base_mac_key in machine_vars: - mac = machine_vars[base_mac_key] - mac = mac.strip() - if valid_mac_address(mac): - return mac - - hw_mac_entry_cmds = [ "sudo decode-syseeprom -m" ] - elif (version_info['asic_type'] == 'marvell'): - # Try valid mac in eeprom, else fetch it from eth0 - platform = get_platform_info(get_machine_info()) - hwsku = get_machine_info()['onie_machine'] - profile_cmd = 'cat' + SONIC_DEVICE_PATH + '/' + platform +'/'+ hwsku +'/profile.ini | grep switchMacAddress | cut -f2 -d=' - hw_mac_entry_cmds = [ profile_cmd, "sudo decode-syseeprom -m", "ip link show eth0 | grep ether | awk '{print $2}'" ] - else: - mac_address_cmd = "cat /sys/class/net/eth0/address" - if namespace is not None: - mac_address_cmd = "sudo ip netns exec {} {}".format(namespace, mac_address_cmd) - - hw_mac_entry_cmds = [mac_address_cmd] - - for get_mac_cmd in hw_mac_entry_cmds: - proc = subprocess.Popen(get_mac_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (mac, err) = proc.communicate() - if err: - continue - mac = mac.strip() - if valid_mac_address(mac): - break - - if not valid_mac_address(mac): - return None - - # Align last byte of MAC if necessary - if version_info and version_info['asic_type'] == 'centec': - last_byte = mac[-2:] - aligned_last_byte = format(int(int(last_byte, 16) + 1), '02x') - mac = mac[:-2] + aligned_last_byte - return mac - -# -# Function to obtain the routing-stack being utilized. Function is not -# platform-specific; it's being placed in this file temporarily till a more -# suitable location is identified as part of upcoming refactoring efforts. -# -def get_system_routing_stack(): - command = "sudo docker ps | grep bgp | awk '{print$2}' | cut -d'-' -f3 | cut -d':' -f1" - - try: - proc = subprocess.Popen(command, - stdout=subprocess.PIPE, - shell=True, - stderr=subprocess.STDOUT) - stdout = proc.communicate()[0] - proc.wait() - result = stdout.rstrip('\n') - - except OSError, e: - raise OSError("Cannot detect routing-stack") - - return result diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini index 3fe912c98c45..5b2786fd8aa8 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini +++ b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-0.ini @@ -1,9 +1,9 @@ -# name lanes alias asic_port_name -Ethernet0 33,34,35,36 Ethernet1/1 Eth0-ASIC0 -Ethernet4 29,30,31,32 Ethernet1/2 Eth1-ASIC0 -Ethernet8 41,42,43,44 Ethernet1/3 Eth2-ASIC0 -Ethernet12 37,38,39,40 Ethernet1/4 Eth3-ASIC0 -Ethernet-BP0 13,14,15,16 Ethernet-BP0 Eth4-ASIC0 -Ethernet-BP4 17,18,19,20 Ethernet-BP4 Eth5-ASIC0 -Ethernet-BP8 21,22,23,24 Ethernet-BP8 Eth6-ASIC0 -Ethernet-BP12 25,26,27,28 Ethernet-BP12 Eth7-ASIC0 \ No newline at end of file +# name lanes alias index asic_port_name role +Ethernet0 33,34,35,36 Ethernet1/1 0 Eth0-ASIC0 Ext +Ethernet4 29,30,31,32 Ethernet1/2 1 Eth1-ASIC0 Ext +Ethernet8 41,42,43,44 Ethernet1/3 2 Eth2-ASIC0 Ext +Ethernet12 37,38,39,40 Ethernet1/4 3 Eth3-ASIC0 Ext +Ethernet-BP0 13,14,15,16 Ethernet-BP0 0 Eth4-ASIC0 Int +Ethernet-BP4 17,18,19,20 Ethernet-BP4 1 Eth5-ASIC0 Int +Ethernet-BP8 21,22,23,24 Ethernet-BP8 2 Eth6-ASIC0 Int +Ethernet-BP12 25,26,27,28 Ethernet-BP12 3 Eth7-ASIC0 Int \ No newline at end of file diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-1.ini b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-1.ini index c496e0712a49..9764ede9736a 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-1.ini +++ b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-1.ini @@ -1,9 +1,9 @@ -# name lanes alias asic_port_name -Ethernet16 33,34,35,36 Ethernet1/5 Eth0-ASIC1 -Ethernet20 29,30,31,32 Ethernet1/6 Eth1-ASIC1 -Ethernet24 41,42,43,44 Ethernet1/7 Eth2-ASIC1 -Ethernet28 37,38,39,40 Ethernet1/8 Eth3-ASIC1 -Ethernet-BP16 13,14,15,16 Ethernet-BP16 Eth4-ASIC1 -Ethernet-BP20 17,18,19,20 Ethernet-BP20 Eth5-ASIC1 -Ethernet-BP24 21,22,23,24 Ethernet-BP24 Eth6-ASIC1 -Ethernet-BP28 25,26,27,28 Ethernet-BP28 Eth7-ASIC1 \ No newline at end of file +# name lanes alias index asic_port_name role +Ethernet16 33,34,35,36 Ethernet1/5 4 Eth0-ASIC1 Ext +Ethernet20 29,30,31,32 Ethernet1/6 5 Eth1-ASIC1 Ext +Ethernet24 41,42,43,44 Ethernet1/7 6 Eth2-ASIC1 Ext +Ethernet28 37,38,39,40 Ethernet1/8 7 Eth3-ASIC1 Ext +Ethernet-BP16 13,14,15,16 Ethernet-BP16 4 Eth4-ASIC1 Int +Ethernet-BP20 17,18,19,20 Ethernet-BP20 5 Eth5-ASIC1 Int +Ethernet-BP24 21,22,23,24 Ethernet-BP24 6 Eth6-ASIC1 Int +Ethernet-BP28 25,26,27,28 Ethernet-BP28 7 Eth7-ASIC1 Int \ No newline at end of file diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-2.ini b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-2.ini index 4ae0575835a7..b3bc03dbe915 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-2.ini +++ b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-2.ini @@ -1,9 +1,9 @@ -# name lanes alias asic_port_name -Ethernet-BP256 61,62,63,64 Ethernet-BP256 Eth0-ASIC2 -Ethernet-BP260 57,58,59,60 Ethernet-BP260 Eth1-ASIC2 -Ethernet-BP264 53,54,55,56 Ethernet-BP264 Eth2-ASIC2 -Ethernet-BP268 49,50,51,52 Ethernet-BP268 Eth3-ASIC2 -Ethernet-BP272 45,46,47,48 Ethernet-BP272 Eth4-ASIC2 -Ethernet-BP276 41,42,43,44 Ethernet-BP276 Eth5-ASIC2 -Ethernet-BP280 37,38,39,40 Ethernet-BP280 Eth6-ASIC2 -Ethernet-BP284 33,34,35,36 Ethernet-BP284 Eth7-ASIC2 \ No newline at end of file +# name lanes alias index asic_port_name role +Ethernet-BP256 61,62,63,64 Ethernet-BP256 8 Eth0-ASIC2 Int +Ethernet-BP260 57,58,59,60 Ethernet-BP260 9 Eth1-ASIC2 Int +Ethernet-BP264 53,54,55,56 Ethernet-BP264 10 Eth2-ASIC2 Int +Ethernet-BP268 49,50,51,52 Ethernet-BP268 11 Eth3-ASIC2 Int +Ethernet-BP272 45,46,47,48 Ethernet-BP272 12 Eth4-ASIC2 Int +Ethernet-BP276 41,42,43,44 Ethernet-BP276 13 Eth5-ASIC2 Int +Ethernet-BP280 37,38,39,40 Ethernet-BP280 14 Eth6-ASIC2 Int +Ethernet-BP284 33,34,35,36 Ethernet-BP284 15 Eth7-ASIC2 Int \ No newline at end of file diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-3.ini b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-3.ini index 8f45ed14946e..2fb7f4ae6ad0 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-3.ini +++ b/src/sonic-config-engine/tests/multi_npu_data/sample_port_config-3.ini @@ -1,9 +1,9 @@ -# name lanes alias asic_port_name -Ethernet-BP384 29,30,31,32 Ethernet-BP384 Eth0-ASIC3 -Ethernet-BP388 25,26,27,28 Ethernet-BP388 Eth1-ASIC3 -Ethernet-BP392 21,22,23,24 Ethernet-BP392 Eth2-ASIC3 -Ethernet-BP396 17,18,19,20 Ethernet-BP396 Eth3-ASIC3 -Ethernet-BP400 13,14,15,16 Ethernet-BP400 Eth4-ASIC3 -Ethernet-BP404 9,10,11,12 Ethernet-BP404 Eth5-ASIC3 -Ethernet-BP408 5,6,7,8 Ethernet-BP408 Eth6-ASIC3 -Ethernet-BP412 1,2,3,4 Ethernet-BP412 Eth7-ASIC3 \ No newline at end of file +# name lanes alias index asic_port_name role +Ethernet-BP384 29,30,31,32 Ethernet-BP384 16 Eth0-ASIC3 Int +Ethernet-BP388 25,26,27,28 Ethernet-BP388 17 Eth1-ASIC3 Int +Ethernet-BP392 21,22,23,24 Ethernet-BP392 18 Eth2-ASIC3 Int +Ethernet-BP396 17,18,19,20 Ethernet-BP396 19 Eth3-ASIC3 Int +Ethernet-BP400 13,14,15,16 Ethernet-BP400 20 Eth4-ASIC3 Int +Ethernet-BP404 9,10,11,12 Ethernet-BP404 21 Eth5-ASIC3 Int +Ethernet-BP408 5,6,7,8 Ethernet-BP408 22 Eth6-ASIC3 Int +Ethernet-BP412 1,2,3,4 Ethernet-BP412 23 Eth7-ASIC3 Int \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample-template-1.json.j2 b/src/sonic-config-engine/tests/sample-template-1.json.j2 new file mode 100644 index 000000000000..96051b502fb7 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-template-1.json.j2 @@ -0,0 +1,4 @@ +{ + "jk1_1": "{{ key1_1 }}", + "jk1_2": "{{ key1_2 }}" +} diff --git a/src/sonic-config-engine/tests/sample-template-2.json.j2 b/src/sonic-config-engine/tests/sample-template-2.json.j2 new file mode 100644 index 000000000000..3de91ab36edb --- /dev/null +++ b/src/sonic-config-engine/tests/sample-template-2.json.j2 @@ -0,0 +1,4 @@ +{ + "jk2_1": "{{ key2_1 }}", + "jk2_2": "{{ key2_2 }}" +} diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index 35d8f8343796..acfcd4a6a74b 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -200,6 +200,15 @@ switch-01t1 port1 + + DeviceInterfaceLink + true + 10000 + switch-t0 + fortyGigE0/12 + switch-02t1 + port1 + diff --git a/src/sonic-config-engine/tests/t0-sample-graph.xml b/src/sonic-config-engine/tests/t0-sample-graph.xml index 5e4a68db0e87..237a2ff0f532 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph.xml @@ -401,6 +401,13 @@ switch-t0 fortyGigE0/4 + + DeviceInterfaceLink + Servers100 + eth0 + switch-t0 + fortyGigE0/100 + diff --git a/src/sonic-config-engine/tests/test2.j2 b/src/sonic-config-engine/tests/test2.j2 new file mode 100644 index 000000000000..df36b83cf382 --- /dev/null +++ b/src/sonic-config-engine/tests/test2.j2 @@ -0,0 +1 @@ +{{ key1 }} diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index cd6372dccdae..fcdb7e9f2475 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -1,4 +1,5 @@ from unittest import TestCase +import json import subprocess import os @@ -13,14 +14,24 @@ def setUp(self): self.sample_graph = os.path.join(self.test_dir, 'sample_graph.xml') self.sample_graph_t0 = os.path.join(self.test_dir, 't0-sample-graph.xml') self.sample_graph_simple = os.path.join(self.test_dir, 'simple-sample-graph.xml') + self.sample_graph_simple_case = os.path.join(self.test_dir, 'simple-sample-graph-case.xml') self.sample_graph_metadata = os.path.join(self.test_dir, 'simple-sample-graph-metadata.xml') self.sample_graph_pc_test = os.path.join(self.test_dir, 'pc-test-graph.xml') self.sample_graph_bgp_speaker = os.path.join(self.test_dir, 't0-sample-bgp-speaker.xml') self.sample_device_desc = os.path.join(self.test_dir, 'device.xml') self.port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini') + self.output_file = os.path.join(self.test_dir, 'output') + self.output2_file = os.path.join(self.test_dir, 'output2') + + def tearDown(self): + try: + os.remove(self.output_file) + os.remove(self.output2_file) + except OSError: + pass def run_script(self, argument, check_stderr=False): - print '\n Running sonic-cfggen ' + argument + print('\n Running sonic-cfggen ' + argument) if check_stderr: output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True) else: @@ -28,9 +39,9 @@ def run_script(self, argument, check_stderr=False): linecount = output.strip().count('\n') if linecount <= 0: - print ' Output: ' + output.strip() + print(' Output: ' + output.strip()) else: - print ' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output)) + print(' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output))) return output def test_dummy_run(self): @@ -106,6 +117,30 @@ def test_render_template(self): output = self.run_script(argument) self.assertEqual(output.strip(), 'value1\nvalue2') + def test_template_batch_mode(self): + argument = '-y ' + os.path.join(self.test_dir, 'test.yml') + argument += ' -a \'{"key1":"value"}\'' + argument += ' -t ' + os.path.join(self.test_dir, 'test.j2') + ',' + self.output_file + argument += ' -t ' + os.path.join(self.test_dir, 'test2.j2') + ',' + self.output2_file + output = self.run_script(argument) + assert(os.path.exists(self.output_file)) + assert(os.path.exists(self.output2_file)) + with open(self.output_file) as tf: + self.assertEqual(tf.read().strip(), 'value1\nvalue2') + with open(self.output2_file) as tf: + self.assertEqual(tf.read().strip(), 'value') + + def test_template_json_batch_mode(self): + data = {"key1_1":"value1_1", "key1_2":"value1_2", "key2_1":"value2_1", "key2_2":"value2_2"} + argument = " -a '{0}'".format(repr(data).replace('\'', '"')) + argument += ' -t ' + os.path.join(self.test_dir, 'sample-template-1.json.j2') + ",config-db" + argument += ' -t ' + os.path.join(self.test_dir, 'sample-template-2.json.j2') + ",config-db" + argument += ' --print-data' + output = self.run_script(argument) + output_data = json.loads(output) + for key, value in data.items(): + self.assertEqual(output_data[key.replace("key", "jk")], value) + # FIXME: This test depends heavily on the ordering of the interfaces and # it is not at all intuitive what that ordering should be. Could make it # more robust by adding better parsing logic. @@ -114,14 +149,14 @@ def test_minigraph_acl(self): output = self.run_script(argument, True) self.assertEqual(output.strip(), "Warning: Ignoring Control Plane ACL NTP_ACL without type\n" "{'NTP_ACL': {'services': ['NTP'], 'type': 'CTRLPLANE', 'policy_desc': 'NTP_ACL', 'stage': 'ingress'}, " - "'EVERFLOW': {'stage': 'ingress', 'type': 'MIRROR', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet4'], 'policy_desc': 'EVERFLOW'}, " - "'EVERFLOW_EGRESS': {'stage': 'egress', 'type': 'MIRROR', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet4'], 'policy_desc': 'EVERFLOW_EGRESS'}, " + "'EVERFLOW': {'stage': 'ingress', 'type': 'MIRROR', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet4', 'Ethernet100'], 'policy_desc': 'EVERFLOW'}, " + "'EVERFLOW_EGRESS': {'stage': 'egress', 'type': 'MIRROR', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet4', 'Ethernet100'], 'policy_desc': 'EVERFLOW_EGRESS'}, " "'ROUTER_PROTECT': {'services': ['SSH', 'SNMP'], 'type': 'CTRLPLANE', 'policy_desc': 'ROUTER_PROTECT', 'stage': 'ingress'}, " "'DATAACLINGRESS': {'stage': 'ingress', 'type': 'L3', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04'], 'policy_desc': 'DATAACLINGRESS'}, " "'SNMP_ACL': {'services': ['SNMP'], 'type': 'CTRLPLANE', 'policy_desc': 'SNMP_ACL', 'stage': 'ingress'}, " "'SSH_ACL': {'services': ['SSH'], 'type': 'CTRLPLANE', 'policy_desc': 'SSH_ACL', 'stage': 'ingress'}, " "'DATAACLEGRESS': {'stage': 'egress', 'type': 'L3', 'ports': ['PortChannel01', 'PortChannel02'], 'policy_desc': 'DATAACLEGRESS'}, " - "'EVERFLOWV6': {'stage': 'ingress', 'type': 'MIRRORV6', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet4'], 'policy_desc': 'EVERFLOWV6'}}") + "'EVERFLOWV6': {'stage': 'ingress', 'type': 'MIRRORV6', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet4', 'Ethernet100'], 'policy_desc': 'EVERFLOWV6'}}") # everflow portion is not used # def test_minigraph_everflow(self): @@ -190,11 +225,12 @@ def test_minigraph_extra_neighbors(self): argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v DEVICE_NEIGHBOR' output = self.run_script(argument) self.assertEqual(output.strip(), \ - "{'Ethernet116': {'name': 'ARISTA02T1', 'port': 'Ethernet1/1'}, " - "'Ethernet124': {'name': 'ARISTA04T1', 'port': 'Ethernet1/1'}, " - "'Ethernet112': {'name': 'ARISTA01T1', 'port': 'Ethernet1/1'}, " - "'Ethernet4': {'name': 'Servers0', 'port': 'eth0'}, " - "'Ethernet120': {'name': 'ARISTA03T1', 'port': 'Ethernet1/1'}}") + "{'Ethernet124': {'name': 'ARISTA04T1', 'port': 'Ethernet1/1'}, " + "'Ethernet120': {'name': 'ARISTA03T1', 'port': 'Ethernet1/1'}, " + "'Ethernet4': {'name': 'Servers0', 'port': 'eth0'}, " + "'Ethernet116': {'name': 'ARISTA02T1', 'port': 'Ethernet1/1'}, " + "'Ethernet100': {'name': 'Servers100', 'port': 'eth0'}, " + "'Ethernet112': {'name': 'ARISTA01T1', 'port': 'Ethernet1/1'}}") def test_minigraph_port_description(self): argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet124\']"' @@ -235,6 +271,44 @@ def test_minigraph_ethernet_interfaces(self): output = self.run_script(argument) self.assertEqual(output.strip(), "{'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '100000', 'description': 'Interface description'}") + def test_minigraph_neighbor_interfaces(self): + argument = '-m "' + self.sample_graph_simple_case + '" -p "' + self.port_config + '" -v "PORT"' + output = self.run_script(argument) + + self.assertEqual(output.strip(), \ + "{'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000'}, " + "'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'fortyGigE0/4', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100'}, " + "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000'}, " + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " + "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}}") + def test_minigraph_extra_ethernet_interfaces(self): argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORT"' output = self.run_script(argument) @@ -306,7 +380,7 @@ def test_minigraph_bgp_mon(self): def test_minigraph_sub_port_interfaces(self, check_stderr=True): try: - print '\n Change device type to %s' % (BACKEND_TOR_ROUTER) + print('\n Change device type to %s' % (BACKEND_TOR_ROUTER)) if check_stderr: output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_TOR_ROUTER, self.sample_graph_simple), stderr=subprocess.STDOUT, shell=True) else: @@ -339,7 +413,7 @@ def test_minigraph_sub_port_interfaces(self, check_stderr=True): # VLAN_SUB_INTERFACE argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN_SUB_INTERFACE' output = self.run_script(argument) - print output.strip() + print(output.strip()) self.assertEqual(output.strip(), \ "{('PortChannel01.10', '10.0.0.56/31'): {}, " "'Ethernet0.10': {'admin_status': 'up'}, " @@ -349,7 +423,7 @@ def test_minigraph_sub_port_interfaces(self, check_stderr=True): "('Ethernet0.10', 'FC00::75/126'): {}}") finally: - print '\n Change device type back to %s' % (TOR_ROUTER) + print('\n Change device type back to %s' % (TOR_ROUTER)) if check_stderr: output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, self.sample_graph_simple), stderr=subprocess.STDOUT, shell=True) else: diff --git a/src/sonic-config-engine/tests/test_cfggen_platformJson.py b/src/sonic-config-engine/tests/test_cfggen_platformJson.py index f94fcb4ab89b..dedddadde1cd 100644 --- a/src/sonic-config-engine/tests/test_cfggen_platformJson.py +++ b/src/sonic-config-engine/tests/test_cfggen_platformJson.py @@ -17,7 +17,7 @@ def setUp(self): self.hwsku_json = os.path.join(self.test_dir, 'sample_hwsku.json') def run_script(self, argument, check_stderr=False): - print '\n Running sonic-cfggen ' + argument + print('\n Running sonic-cfggen ' + argument) if check_stderr: output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True) else: @@ -25,9 +25,9 @@ def run_script(self, argument, check_stderr=False): linecount = output.strip().count('\n') if linecount <= 0: - print ' Output: ' + output.strip() + print(' Output: ' + output.strip()) else: - print ' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output)) + print(' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output))) return output def test_dummy_run(self): diff --git a/src/sonic-config-engine/tests/test_cfggen_t2_chassis_fe.py b/src/sonic-config-engine/tests/test_cfggen_t2_chassis_fe.py index f6de92121115..c13575d25690 100644 --- a/src/sonic-config-engine/tests/test_cfggen_t2_chassis_fe.py +++ b/src/sonic-config-engine/tests/test_cfggen_t2_chassis_fe.py @@ -13,7 +13,7 @@ def setUp(self): self.t2_chassis_fe_port_config = os.path.join(self.test_dir, 't2-chassis-fe-port-config.ini') def run_script(self, argument, check_stderr=False): - print '\n Running sonic-cfggen ' + argument + print('\n Running sonic-cfggen ' + argument) if check_stderr: output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True) else: @@ -21,9 +21,9 @@ def run_script(self, argument, check_stderr=False): linecount = output.strip().count('\n') if linecount <= 0: - print ' Output: ' + output.strip() + print(' Output: ' + output.strip()) else: - print ' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output)) + print(' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output))) return output def test_minigraph_t2_chassis_fe_type(self): diff --git a/src/sonic-config-engine/tests/test_frr.py b/src/sonic-config-engine/tests/test_frr.py index dd41e1711760..e43fcb95789b 100644 --- a/src/sonic-config-engine/tests/test_frr.py +++ b/src/sonic-config-engine/tests/test_frr.py @@ -28,9 +28,9 @@ def run_script(self, argument, check_stderr=False): linecount = output.strip().count('\n') if linecount <= 0: - print ' Output: ' + output.strip() + print(' Output: ' + output.strip()) else: - print ' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output)) + print(' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output))) return output def run_diff(self, file1, file2): diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index 1cdfcc91fccb..583d7c55b701 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -22,7 +22,7 @@ def setUp(self): self.output_file = os.path.join(self.test_dir, 'output') def run_script(self, argument): - print 'CMD: sonic-cfggen ' + argument + print('CMD: sonic-cfggen ' + argument) return subprocess.check_output(self.script_file + ' ' + argument, shell=True) def run_diff(self, file1, file2): diff --git a/src/sonic-config-engine/tests/test_j2files_t2_chassis_fe.py b/src/sonic-config-engine/tests/test_j2files_t2_chassis_fe.py index a3c50b8a263d..776d362c9514 100644 --- a/src/sonic-config-engine/tests/test_j2files_t2_chassis_fe.py +++ b/src/sonic-config-engine/tests/test_j2files_t2_chassis_fe.py @@ -23,7 +23,7 @@ def tearDown(self): pass def run_script(self, argument): - print 'CMD: sonic-cfggen ' + argument + print('CMD: sonic-cfggen ' + argument) return subprocess.check_output(self.script_file + ' ' + argument, shell=True) def run_diff(self, file1, file2): diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index b77f0859584a..b1b6024df8b5 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -11,7 +11,7 @@ def setUp(self): self.port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini') def run_script(self, argument, check_stderr=False): - print '\n Running sonic-cfggen ' + argument + print('\n Running sonic-cfggen ' + argument) if check_stderr: output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True) else: @@ -19,9 +19,9 @@ def run_script(self, argument, check_stderr=False): linecount = output.strip().count('\n') if linecount <= 0: - print ' Output: ' + output.strip() + print(' Output: ' + output.strip()) else: - print ' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output)) + print(' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output))) return output def test_dummy_run(self): diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 4b05541daa8f..77e79a2b5fe1 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -24,7 +24,7 @@ def setUp(self): self.port_config.append(os.path.join(self.test_data_dir, "sample_port_config-{}.ini".format(asic))) def run_script(self, argument, check_stderr=False): - print '\n Running sonic-cfggen ' + argument + print('\n Running sonic-cfggen ' + argument) if check_stderr: output = subprocess.check_output(self.script_file + ' ' + argument, stderr=subprocess.STDOUT, shell=True) else: @@ -32,9 +32,9 @@ def run_script(self, argument, check_stderr=False): linecount = output.strip().count('\n') if linecount <= 0: - print ' Output: ' + output.strip() + print(' Output: ' + output.strip()) else: - print ' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output)) + print(' Output: ({0} lines, {1} bytes)'.format(linecount + 1, len(output))) return output def run_diff(self, file1, file2): @@ -108,7 +108,7 @@ def test_metadata_ntp(self): #NTP data is present only in the host config for asic in range(NUM_ASIC): output = json.loads(self.run_script_for_asic(argument, asic, self.port_config[asic])) - print "Log:asic{} sku {}".format(asic,output) + print("Log:asic{} sku {}".format(asic,output)) self.assertDictEqual(output, {}) def test_mgmt_port(self): @@ -137,27 +137,40 @@ def test_backend_asic_portchannels(self): def test_frontend_asic_portchannel_mem(self): argument = "-m {} -p {} -n asic0 --var-json \"PORTCHANNEL_MEMBER\"".format(self.sample_graph, self.port_config[0]) output = json.loads(self.run_script(argument)) - self.assertListEqual(output.keys(), \ + self.assertListEqual(list(output.keys()), \ ['PortChannel4002|Ethernet-BP8', 'PortChannel0002|Ethernet0', 'PortChannel0002|Ethernet4', 'PortChannel4002|Ethernet-BP12', 'PortChannel4001|Ethernet-BP0', 'PortChannel4001|Ethernet-BP4']) def test_backend_asic_portchannels_mem(self): argument = "-m {} -p {} -n asic3 --var-json \"PORTCHANNEL_MEMBER\"".format(self.sample_graph, self.port_config[3]) output = json.loads(self.run_script(argument)) - self.assertListEqual(output.keys(), \ + self.assertListEqual(list(output.keys()), \ ['PortChannel4013|Ethernet-BP384', 'PortChannel4014|Ethernet-BP392', 'PortChannel4014|Ethernet-BP396', 'PortChannel4013|Ethernet-BP388']) def test_frontend_asic_portchannel_intf(self): argument = "-m {} -p {} -n asic0 --var-json \"PORTCHANNEL_INTERFACE\"".format(self.sample_graph, self.port_config[0]) output = json.loads(self.run_script(argument)) - self.assertListEqual(output.keys(), \ + self.assertListEqual(list(output.keys()), \ ['PortChannel4001|10.1.0.1/31', 'PortChannel0002|FC00::1/126', 'PortChannel4002|10.1.0.3/31', 'PortChannel0002', 'PortChannel0002|10.0.0.0/31', 'PortChannel4001', 'PortChannel4002']) def test_backend_asic_portchannel_intf(self): argument = "-m {} -p {} -n asic3 --var-json \"PORTCHANNEL_INTERFACE\"".format(self.sample_graph, self.port_config[3]) output = json.loads(self.run_script(argument)) - self.assertListEqual(output.keys(), \ + self.assertListEqual(list(output.keys()), \ ['PortChannel4013', 'PortChannel4013|10.1.0.2/31', 'PortChannel4014', 'PortChannel4014|10.1.0.6/31']) + def test_frontend_asic_ports(self): + argument = "-m {} -p {} -n asic0 --var-json \"PORT\"".format(self.sample_graph, self.port_config[0]) + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, \ + {"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet12": { "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet-BP0": { "admin_status": "up", "alias": "Ethernet-BP0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP4": { "admin_status": "up", "alias": "Ethernet-BP4", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP8": { "admin_status": "up", "alias": "Ethernet-BP8", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP12": { "admin_status": "up", "alias": "Ethernet-BP12", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) + def test_frontend_asic_device_neigh(self): argument = "-m {} -p {} -n asic0 --var-json \"DEVICE_NEIGHBOR\"".format(self.sample_graph, self.port_config[0]) output = json.loads(self.run_script(argument)) diff --git a/src/sonic-daemon-base/setup.py b/src/sonic-daemon-base/setup.py deleted file mode 100644 index 397af04b87dc..000000000000 --- a/src/sonic-daemon-base/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -from setuptools import setup - -setup( - name='sonic-daemon-base', - version='1.0', - description='Sonic daemon base package', - license='Apache 2.0', - author='SONiC Team', - author_email='linuxnetdev@microsoft.com', - url='https://github.com/Azure/sonic-platform-daemons', - maintainer='Kevin Wang', - maintainer_email='kevinw@mellanox.com', - packages=[ - 'sonic_daemon_base', - ], - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: No Input/Output (Daemon)', - 'Intended Audience :: Developers', - 'Intended Audience :: Information Technology', - 'Intended Audience :: System Administrators', - 'License :: OSI Approved :: Apache Software License', - 'Natural Language :: English', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python :: 2.7', - 'Topic :: System :: Hardware', - ], - keywords='SONiC sonic PLATFORM platform DAEMON daemon', -) - diff --git a/src/sonic-daemon-base/sonic_daemon_base/daemon_base.py b/src/sonic-daemon-base/sonic_daemon_base/daemon_base.py deleted file mode 100644 index ee0fa673e44c..000000000000 --- a/src/sonic-daemon-base/sonic_daemon_base/daemon_base.py +++ /dev/null @@ -1,217 +0,0 @@ -#!/usr/bin/env python2 - -try: - import imp - import signal - import subprocess - import os - import sys - import syslog -except ImportError, e: - raise ImportError (str(e) + " - required module not found") - -# -# Constants ==================================================================== -# -REDIS_TIMEOUT_MSECS = 0 - -# Platform root directory inside docker -PLATFORM_ROOT_DOCKER = '/usr/share/sonic/platform' -SONIC_CFGGEN_PATH = '/usr/local/bin/sonic-cfggen' -SONIC_ENV_FILE = '/etc/sonic/sonic-environment' -PLATFORM_ENVVAR = 'PLATFORM' -HWSKU_ENVVAR = 'HWSKU' -HWSKU_KEY = 'DEVICE_METADATA.localhost.hwsku' -PLATFORM_KEY = 'DEVICE_METADATA.localhost.platform' - -# Port config information -PORT_CONFIG = 'port_config.ini' -PLATFORM_JSON = 'platform.json' - -EEPROM_MODULE_NAME = 'eeprom' -EEPROM_CLASS_NAME = 'board' - -# -# Helper functions ============================================================= -# - -def db_connect(db_name): - from swsscommon import swsscommon - return swsscommon.DBConnector(db_name, - REDIS_TIMEOUT_MSECS, - True) - -# -# Helper classes =============================================================== -# - -class Logger(object): - def __init__(self, syslog_identifier = None): - self.syslog = syslog - if syslog_identifier is None: - self.syslog.openlog() - else: - self.syslog.openlog(ident=syslog_identifier, logoption=self.syslog.LOG_NDELAY, facility=self.syslog.LOG_DAEMON) - - def __del__(self): - self.syslog.closelog() - - def log_error(self, msg, also_print_to_console=False): - self.syslog.syslog(self.syslog.LOG_ERR, msg) - - if also_print_to_console: - print msg - - def log_warning(self, msg, also_print_to_console=False): - self.syslog.syslog(self.syslog.LOG_WARNING, msg) - - if also_print_to_console: - print msg - - def log_notice(self, msg, also_print_to_console=False): - self.syslog.syslog(self.syslog.LOG_NOTICE, msg) - - if also_print_to_console: - print msg - - def log_info(self, msg, also_print_to_console=False): - self.syslog.syslog(self.syslog.LOG_INFO, msg) - - if also_print_to_console: - print msg - - def log_debug(self, msg, also_print_to_console=False): - self.syslog.syslog(self.syslog.LOG_DEBUG, msg) - - if also_print_to_console: - print msg - -# -# Daemon ======================================================================= -# - -class DaemonBase(object): - def __init__(self): - # Register our signal handlers - '''all daemons inherit from daemon_base class, and for - signal handling functionality they register the signal_handler() by - overriding the siganl_handler() in daemon_base by their own - implmentation. - But some sonic_platform instances also can invoke the daemon_base - constructor while trying to instantiate the common utilities - for example - platform_chassis = sonic_platform.platform.Platform().get_chassis() - This will cause the re registration of signal_handler which will - cause base class signal_handler() to be invoked when the daemon - gets a signal, whereas the derived class signal_handler should have - been invoked. The if checks will not allow the re registration - of signal handler ''' - if not signal.getsignal(signal.SIGHUP): - signal.signal(signal.SIGHUP, self.signal_handler) - if not signal.getsignal(signal.SIGINT): - signal.signal(signal.SIGINT, self.signal_handler) - if not signal.getsignal(signal.SIGTERM): - signal.signal(signal.SIGTERM, self.signal_handler) - - # Signal handler - def signal_handler(self, sig, frame): - if sig == signal.SIGHUP: - syslog.syslog(syslog.LOG_INFO, "Caught SIGHUP - ignoring...") - elif sig == signal.SIGINT: - syslog.syslog(syslog.LOG_INFO, "Caught SIGINT - exiting...") - sys.exit(128 + sig) - elif sig == signal.SIGTERM: - syslog.syslog(syslog.LOG_INFO, "Caught SIGTERM - exiting...") - sys.exit(128 + sig) - else: - syslog.syslog(syslog.LOG_WARNING, "Caught unhandled signal '" + sig + "'") - - # Returns platform and hwsku - def get_platform_and_hwsku(self): - try: - platform = hwsku = None - if os.path.exists(SONIC_ENV_FILE): - with open(SONIC_ENV_FILE, "r") as env_file: - for line in env_file: - if PLATFORM_ENVVAR in line: - platform = line.split('=')[1] - if HWSKU_ENVVAR in line: - hwsku = line.split('=')[1] - - if not platform: - proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-H', '-v', PLATFORM_KEY], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=False) - stdout, stderr = proc.communicate() - assert not stderr and not proc.returncode, "Failed to detect platform: %s, rc: %s" % (stderr, proc.returncode) - platform = stdout.rstrip('\n') - - if not hwsku: - proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-d', '-v', HWSKU_KEY], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=False) - stdout, stderr = proc.communicate() - assert not stderr and not proc.returncode, "Failed to detect hwsku: %s, rc: %s" % (stderr, proc.returncode) - hwsku = stdout.rstrip('\n') - except OSError, e: - raise OSError("Failed to detect platform: %s" % (str(e))) - - return (platform, hwsku) - - # Returns path to platform and hwsku - def get_path_to_platform_and_hwsku(self): - # Get platform and hwsku - (platform, hwsku) = self.get_platform_and_hwsku() - - # Load platform module from source - platform_path = PLATFORM_ROOT_DOCKER - hwsku_path = "/".join([platform_path, hwsku]) - - return (platform_path, hwsku_path) - - # Returns path to port config file - def get_path_to_port_config_file(self): - # Get platform and hwsku path - (platform_path, hwsku_path) = self.get_path_to_platform_and_hwsku() - - # First check for the presence of the new 'platform.json' file - port_config_file_path = "/".join([platform_path, PLATFORM_JSON]) - if not os.path.isfile(port_config_file_path): - - # platform.json doesn't exist. Try loading the legacy 'port_config.ini' file - port_config_file_path = "/".join([hwsku_path, PORT_CONFIG]) - if not os.path.isfile(port_config_file_path): - raise IOError("Failed to detect port config file: %s" % (port_config_file_path)) - - return port_config_file_path - - # Loads platform specific psuutil module from source - def load_platform_util(self, module_name, class_name): - platform_util = None - - # Get path to platform and hwsku - (platform_path, hwsku_path) = self.get_path_to_platform_and_hwsku() - - try: - module_file = "/".join([platform_path, "plugins", module_name + ".py"]) - module = imp.load_source(module_name, module_file) - except IOError, e: - raise IOError("Failed to load platform module '%s': %s" % (module_name, str(e))) - - try: - platform_util_class = getattr(module, class_name) - # board class of eeprom requires 4 paramerters, need special treatment here. - if module_name == EEPROM_MODULE_NAME and class_name == EEPROM_CLASS_NAME: - platform_util = platform_util_class('','','','') - else: - platform_util = platform_util_class() - except AttributeError, e: - raise AttributeError("Failed to instantiate '%s' class: %s" % (class_name, str(e))) - - return platform_util - - # Runs daemon - def run(self): - raise NotImplementedError() diff --git a/src/sonic-daemon-base/sonic_daemon_base/task_base.py b/src/sonic-daemon-base/sonic_daemon_base/task_base.py deleted file mode 100644 index e1738ffba213..000000000000 --- a/src/sonic-daemon-base/sonic_daemon_base/task_base.py +++ /dev/null @@ -1,50 +0,0 @@ -import multiprocessing -import os -import signal -import threading - - -# -# ProcessTaskBase ===================================================================== -# -class ProcessTaskBase(object): # TODO: put this class to swss-platform-common - def __init__(self): - self.task_process = None - self.task_stopping_event = multiprocessing.Event() - - def task_worker(self): - pass - - def task_run(self): - if self.task_stopping_event.is_set(): - return - - self.task_process = multiprocessing.Process(target=self.task_worker) - self.task_process.start() - - def task_stop(self): - self.task_stopping_event.set() - os.kill(self.task_process.pid, signal.SIGKILL) - - -# -# ThreadTaskBase ===================================================================== -# -class ThreadTaskBase(object): # TODO: put this class to swss-platform-common; - def __init__(self): - self.task_thread = None - self.task_stopping_event = threading.Event() - - def task_worker(self): - pass - - def task_run(self): - if self.task_stopping_event.is_set(): - return - - self.task_thread = threading.Thread(target=self.task_worker) - self.task_thread.start() - - def task_stop(self): - self.task_stopping_event.set() - self.task_thread.join() diff --git a/src/sonic-host-service/Makefile b/src/sonic-host-service/Makefile new file mode 100644 index 000000000000..53eaa4cd510a --- /dev/null +++ b/src/sonic-host-service/Makefile @@ -0,0 +1,41 @@ +################################################################################ +# # +# Copyright 2020 Dell Inc. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# # +################################################################################ + +TOPDIR := $(abspath .) +MAIN_TARGET = sonic-host-service_1.0.0_all.deb +INSTALL := /usr/bin/install + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + dpkg-buildpackage -us -uc -b + mv ../$(MAIN_TARGET) $(DEST)/ + +SOURCES := $(wildcard '*.*') $(wildcard 'host_modules/*.py') +install: $(SOURCES) + # Scripts for host service + $(INSTALL) -d $(DESTDIR)/usr/lib/sonic_host_service/host_modules + $(INSTALL) -D $(TOPDIR)/sonic_host_server.py $(DESTDIR)/usr/lib/sonic_host_service + $(INSTALL) -D $(TOPDIR)/host_modules/*.py $(DESTDIR)/usr/lib/sonic_host_service/host_modules + + # D-Bus permissions configuration + $(INSTALL) -d $(DESTDIR)/etc/dbus-1/system.d + $(INSTALL) -D $(TOPDIR)/org.sonic.hostservice.conf $(DESTDIR)/etc/dbus-1/system.d + + # systemd unit + $(INSTALL) -d $(DESTDIR)/lib/systemd/system + $(INSTALL) -D $(TOPDIR)/sonic-hostservice.service $(DESTDIR)/lib/systemd/system + diff --git a/src/sonic-host-service/debian/.gitignore b/src/sonic-host-service/debian/.gitignore new file mode 100644 index 000000000000..9a07690ac277 --- /dev/null +++ b/src/sonic-host-service/debian/.gitignore @@ -0,0 +1,4 @@ +.debhelper +sonic-host-service.* +sonic-host-service/ +files diff --git a/src/sonic-host-service/debian/changelog b/src/sonic-host-service/debian/changelog new file mode 100644 index 000000000000..5c512fe009e8 --- /dev/null +++ b/src/sonic-host-service/debian/changelog @@ -0,0 +1,5 @@ +sonic-host-service (1.0.0) UNRELEASED; urgency=low + + * Initial release. + + -- Nirenjan Krishnan Mon, 22 Jun 2020 00:00:00 +0000 diff --git a/src/sonic-host-service/debian/compat b/src/sonic-host-service/debian/compat new file mode 100644 index 000000000000..ec635144f600 --- /dev/null +++ b/src/sonic-host-service/debian/compat @@ -0,0 +1 @@ +9 diff --git a/src/sonic-host-service/debian/control b/src/sonic-host-service/debian/control new file mode 100644 index 000000000000..57d126af60dd --- /dev/null +++ b/src/sonic-host-service/debian/control @@ -0,0 +1,15 @@ +Source: sonic-host-service +Maintainer: Nirenjan Krishnan +Build-Depends: debhelper (>= 8.0.0), + dh-systemd +Vcs-Git: https://github.com/Azure/sonic-buildimage +Homepage: https://github.com/Azure/SONiC/ +Standards-Version: 3.9.3 +Section: net + +Package: sonic-host-service +Priority: extra +Architecture: all +Depends: python3-systemd, python3-dbus, python3-gi, ${misc:Depends} +Description: SONiC Host Service + diff --git a/src/sonic-host-service/debian/rules b/src/sonic-host-service/debian/rules new file mode 100755 index 000000000000..eaed7a19038d --- /dev/null +++ b/src/sonic-host-service/debian/rules @@ -0,0 +1,9 @@ +#!/usr/bin/make -f +%: + dh $@ --with systemd --parallel + +override_dh_auto_clean: +override_dh_auto_test: +override_dh_auto_build: +override_dh_auto_install: + make install DESTDIR=debian/sonic-host-service diff --git a/src/sonic-host-service/host_modules/host_service.py b/src/sonic-host-service/host_modules/host_service.py new file mode 100644 index 000000000000..48f55ae0623c --- /dev/null +++ b/src/sonic-host-service/host_modules/host_service.py @@ -0,0 +1,34 @@ +"""Base class for host modules""" + +import dbus.service +import dbus + +BUS_NAME_BASE = 'org.SONiC.HostService' +BUS_PATH = '/org/SONiC/HostService' + +def bus_name(mod_name): + """Return the bus name for the service""" + return BUS_NAME_BASE + '.' + mod_name + +def bus_path(mod_name): + """Return the bus path for the service""" + return BUS_PATH + '/' + mod_name + +method = dbus.service.method + +class HostService(dbus.service.Object): + """Service class for top level DBus endpoint""" + def __init__(self, mod_name): + self.bus = dbus.SystemBus() + self.bus_name = dbus.service.BusName(BUS_NAME_BASE, self.bus) + super(HostService, self).__init__(self.bus_name, BUS_PATH) + +class HostModule(dbus.service.Object): + """Base class for all host modules""" + def __init__(self, mod_name): + self.bus = dbus.SystemBus() + self.bus_name = dbus.service.BusName(bus_name(mod_name), self.bus) + super(HostModule, self).__init__(self.bus_name, bus_path(mod_name)) + +def register(): + return HostService, "host_service" diff --git a/src/sonic-host-service/org.sonic.hostservice.conf b/src/sonic-host-service/org.sonic.hostservice.conf new file mode 100644 index 000000000000..08599007d9ba --- /dev/null +++ b/src/sonic-host-service/org.sonic.hostservice.conf @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/src/sonic-host-service/sonic-hostservice.service b/src/sonic-host-service/sonic-hostservice.service new file mode 100644 index 000000000000..7717022285b5 --- /dev/null +++ b/src/sonic-host-service/sonic-hostservice.service @@ -0,0 +1,15 @@ +[Unit] +Description=SONiC Host Service + +[Service] +Type=dbus +BusName=org.SONiC.HostService + +ExecStart=/usr/bin/python3 -u /usr/lib/sonic_host_service/sonic_host_server.py + +Restart=on-failure +RestartSec=10 +TimeoutStopSec=3 + +[Install] +WantedBy=multi-user.target diff --git a/src/sonic-host-service/sonic_host_server.py b/src/sonic-host-service/sonic_host_server.py new file mode 100755 index 000000000000..9232209f7dc1 --- /dev/null +++ b/src/sonic-host-service/sonic_host_server.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +"""Host Service to handle docker-to-host communication""" + +import os +import os.path +import glob +import importlib +import sys + +import dbus +import dbus.service +import dbus.mainloop.glib + +from gi.repository import GObject + +def register_modules(): + """Register all host modules""" + mod_path = os.path.join(os.path.dirname(__file__), 'host_modules') + sys.path.append(mod_path) + for mod_file in glob.glob(os.path.join(mod_path, '*.py')): + if os.path.isfile(mod_file) and not mod_file.endswith('__init__.py'): + mod_name = os.path.basename(mod_file)[:-3] + module = importlib.import_module(mod_name) + + register_cb = getattr(module, 'register', None) + if not register_cb: + raise Exception('Missing register function for ' + mod_name) + + register_dbus(register_cb) + +def register_dbus(register_cb): + """Register DBus handlers for individual modules""" + handler_class, mod_name = register_cb() + handlers[mod_name] = handler_class(mod_name) + +# Create a main loop reactor +GObject.threads_init() +dbus.mainloop.glib.threads_init() +dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) +loop = GObject.MainLoop() +handlers = {} + +class SignalManager(object): + ''' This is used to manage signals received (e.g. SIGINT). + When stopping a process (systemctl stop [service]), systemd sends + a SIGTERM signal. + ''' + shutdown = False + def __init__(self): + ''' Install signal handlers. + + SIGTERM is invoked when systemd wants to stop the daemon. + For example, "systemctl stop mydaemon.service" + or, "systemctl restart mydaemon.service" + + ''' + import signal + signal.signal(signal.SIGTERM, self.sigterm_hdlr) + + def sigterm_hdlr(self, _signum, _frame): + self.shutdown = True + loop.quit() + +sigmgr = SignalManager() +register_modules() + +# Only run if we actually have some handlers +if handlers: + import systemd.daemon + systemd.daemon.notify("READY=1") + + while not sigmgr.shutdown: + loop.run() + if sigmgr.shutdown: + break + + systemd.daemon.notify("STOPPING=1") +else: + print("No handlers to register, quitting...") diff --git a/src/sonic-platform-common b/src/sonic-platform-common index be1cc2475e65..433dd1ae9d3f 160000 --- a/src/sonic-platform-common +++ b/src/sonic-platform-common @@ -1 +1 @@ -Subproject commit be1cc2475e65b764f7aab44785a779cc3d011ee9 +Subproject commit 433dd1ae9d3f9f45b048fbbe402e8fd2944d85e0 diff --git a/src/sonic-platform-daemons b/src/sonic-platform-daemons index 49d145cdbc63..80661c7ecee3 160000 --- a/src/sonic-platform-daemons +++ b/src/sonic-platform-daemons @@ -1 +1 @@ -Subproject commit 49d145cdbc63a3c9fd36fa413a0a23ff85aeaf5b +Subproject commit 80661c7ecee3acf67cbd52ea4341b6ed33544a6f diff --git a/src/sonic-py-common/.gitignore b/src/sonic-py-common/.gitignore new file mode 100644 index 000000000000..5f621ff9e2ab --- /dev/null +++ b/src/sonic-py-common/.gitignore @@ -0,0 +1,13 @@ +**/*.pyc + +# Distribution / packaging +*.egg-info/ +.eggs/ +build/ +dist/ + +# Unit test / coverage reports +.cache +.coverage +coverage.xml +htmlcov/ diff --git a/src/sonic-py-common/pytest.ini b/src/sonic-py-common/pytest.ini new file mode 100644 index 000000000000..777811f8f489 --- /dev/null +++ b/src/sonic-py-common/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +addopts = --cov=sonic_py_common --cov-report html --cov-report term --cov-report xml diff --git a/src/sonic-py-common/setup.cfg b/src/sonic-py-common/setup.cfg new file mode 100644 index 000000000000..b7e478982ccf --- /dev/null +++ b/src/sonic-py-common/setup.cfg @@ -0,0 +1,2 @@ +[aliases] +test=pytest diff --git a/src/sonic-py-common/setup.py b/src/sonic-py-common/setup.py index b1294472624e..f56ad96b04fd 100644 --- a/src/sonic-py-common/setup.py +++ b/src/sonic-py-common/setup.py @@ -27,6 +27,13 @@ packages=[ 'sonic_py_common', ], + setup_requires= [ + 'pytest-runner' + ], + tests_require=[ + 'pytest', + 'mock==3.0.5' # For python 2. Version >=4.0.0 drops support for py2 + ], classifiers=[ 'Intended Audience :: Developers', 'Operating System :: Linux', @@ -35,5 +42,6 @@ 'Programming Language :: Python', ], keywords='SONiC sonic PYTHON python COMMON common', + test_suite = 'setup.get_test_suite' ) diff --git a/src/sonic-py-common/sonic_py_common/device_info.py b/src/sonic-py-common/sonic_py_common/device_info.py index 99f818b0f27e..b5aefc397fe8 100644 --- a/src/sonic-py-common/sonic_py_common/device_info.py +++ b/src/sonic-py-common/sonic_py_common/device_info.py @@ -6,7 +6,7 @@ import yaml from natsort import natsorted -# TODD: Replace with swsscommon +# TODO: Replace with swsscommon from swsssdk import ConfigDBConnector, SonicDBConfig USR_SHARE_SONIC_PATH = "/usr/share/sonic" diff --git a/src/sonic-py-common/sonic_py_common/interface.py b/src/sonic-py-common/sonic_py_common/interface.py new file mode 100644 index 000000000000..9136b71f7804 --- /dev/null +++ b/src/sonic-py-common/sonic_py_common/interface.py @@ -0,0 +1,43 @@ +""" + Dictionary of SONIC interface name prefixes. Each entry in the format + "Human readable interface string":"Sonic interface prefix" + Currently this is a static mapping, but in future could be stored as metadata in DB. +""" + +SONIC_INTERFACE_PREFIXES = { + "Ethernet-FrontPanel": "Ethernet", + "PortChannel": "PortChannel", + "Vlan": "Vlan", + "Loopback": "Loopback", + "Ethernet-Backplane": "Ethernet-BP" +} + +def front_panel_prefix(): + """ + Retrieves the SONIC front panel interface name prefix. + """ + return SONIC_INTERFACE_PREFIXES["Ethernet-FrontPanel"] + +def backplane_prefix(): + """ + Retrieves the SONIC backplane interface name prefix. + """ + return SONIC_INTERFACE_PREFIXES["Ethernet-Backplane"] + +def portchannel_prefix(): + """ + Retrieves the SONIC PortChannel interface name prefix. + """ + return SONIC_INTERFACE_PREFIXES["PortChannel"] + +def vlan_prefix(): + """ + Retrieves the SONIC Vlan interface name prefix. + """ + return SONIC_INTERFACE_PREFIXES["Vlan"] + +def loopback_prefix(): + """ + Retrieves the SONIC Loopback interface name prefix. + """ + return SONIC_INTERFACE_PREFIXES["Loopback"] diff --git a/src/sonic-py-common/sonic_py_common/multi_asic.py b/src/sonic-py-common/sonic_py_common/multi_asic.py new file mode 100644 index 000000000000..78bc6d72ba90 --- /dev/null +++ b/src/sonic-py-common/sonic_py_common/multi_asic.py @@ -0,0 +1,346 @@ +import glob +import os + +from natsort import natsorted +from swsssdk import ConfigDBConnector +from swsssdk import SonicDBConfig +from swsssdk import SonicV2Connector + +from .device_info import CONTAINER_PLATFORM_PATH +from .device_info import HOST_DEVICE_PATH +from .device_info import get_platform + +ASIC_NAME_PREFIX = 'asic' +NAMESPACE_PATH_GLOB = '/run/netns/*' +ASIC_CONF_FILENAME = 'asic.conf' +FRONTEND_ASIC_SUB_ROLE = 'FrontEnd' +BACKEND_ASIC_SUB_ROLE = 'BackEnd' +EXTERNAL_PORT = 'Ext' +INTERNAL_PORT = 'Int' +PORT_CHANNEL_CFG_DB_TABLE = 'PORTCHANNEL' +PORT_CFG_DB_TABLE = 'PORT' +BGP_NEIGH_CFG_DB_TABLE = 'BGP_NEIGHBOR' +NEIGH_DEVICE_METADATA_CFG_DB_TABLE = 'DEVICE_NEIGHBOR_METADATA' +DEFAULT_NAMESPACE = '' +PORT_ROLE = 'role' + + +def connect_config_db_for_ns(namespace=DEFAULT_NAMESPACE): + """ + The function connects to the config DB for a given namespace and + returns the handle + If no namespace is provided, it will connect to the db in the + default namespace. + In case of multi ASIC, the default namespace is the database + instance running the on the host + + Returns: + handle to the config_db for a namespace + """ + SonicDBConfig.load_sonic_global_db_config() + config_db = ConfigDBConnector(namespace=namespace) + config_db.connect() + return config_db + + +def connect_to_all_dbs_for_ns(namespace=DEFAULT_NAMESPACE): + """ + The function connects to the DBs for a given namespace and + returns the handle + If no namespace is provided, it will connect to the db in the + default namespace. + In case of multi ASIC, the default namespace is the + database instance running the on the host + In case of single ASIC, the namespace has to be DEFAULT_NAMESPACE + + Returns: + handle to all the dbs for a namespaces + """ + SonicDBConfig.load_sonic_global_db_config() + db = SonicV2Connector(namespace=namespace) + for db_id in db.get_db_list(): + db.connect(db_id) + return db + + +def get_asic_conf_file_path(): + """ + Retrieves the path to the ASIC conguration file on the device + + Returns: + A string containing the path to the ASIC conguration file on success, + None on failure + """ + asic_conf_path_candidates = [] + + asic_conf_path_candidates.append(os.path.join(CONTAINER_PLATFORM_PATH, + ASIC_CONF_FILENAME)) + + platform = get_platform() + if platform: + asic_conf_path_candidates.append(os.path.join( + HOST_DEVICE_PATH, platform, ASIC_CONF_FILENAME)) + + for asic_conf_file_path in asic_conf_path_candidates: + if os.path.isfile(asic_conf_file_path): + return asic_conf_file_path + + return None + + +def get_num_asics(): + """ + Retrieves the num of asics present in the multi ASIC platform + + Returns: + Num of asics + """ + asic_conf_file_path = get_asic_conf_file_path() + + if asic_conf_file_path is None: + return 1 + + with open(asic_conf_file_path) as asic_conf_file: + for line in asic_conf_file: + tokens = line.split('=') + if len(tokens) < 2: + continue + if tokens[0].lower() == 'num_asic': + num_asics = tokens[1].strip() + return int(num_asics) + + +def is_multi_asic(): + """ + Checks if the device is multi asic or not + + Returns: + True: if the num of asic is more than 1 + """ + num_asics = get_num_asics() + + return (num_asics > 1) + + +def get_asic_id_from_name(asic_name): + """ + Get the asic id from the asic name for multi-asic platforms + In single ASIC platforms, it would fail and throw an exception. + + Returns: + asic id. + """ + if asic_name.startswith(ASIC_NAME_PREFIX): + return asic_name[len(ASIC_NAME_PREFIX):] + else: + raise ValueError('Unknown asic namespace name {}'.format(asic_name)) + + +def get_namespaces_from_linux(): + """ + In a multi asic platform, each ASIC is in a Linux Namespace. + This method returns list of all the Namespace present on the device + + Note: It is preferable to use this function only when config_db is not + available. When configdb is available use get_all_namespaces() + + Returns: + List of the namespaces present in the system + """ + ns_list = [] + for path in glob.glob(NAMESPACE_PATH_GLOB): + ns = os.path.basename(path) + ns_list.append(ns) + return natsorted(ns_list) + + +def get_all_namespaces(): + """ + In case of Multi-Asic platform, Each ASIC will have a linux network namespace created. + So we loop through the databases in different namespaces and depending on the sub_role + decide whether this is a front end ASIC/namespace or a back end one. + """ + front_ns = [] + back_ns = [] + num_asics = get_num_asics() + + if is_multi_asic(): + for asic in range(num_asics): + namespace = "{}{}".format(ASIC_NAME_PREFIX, asic) + config_db = connect_config_db_for_ns(namespace) + + metadata = config_db.get_table('DEVICE_METADATA') + if metadata['localhost']['sub_role'] == FRONTEND_ASIC_SUB_ROLE: + front_ns.append(namespace) + elif metadata['localhost']['sub_role'] == BACKEND_ASIC_SUB_ROLE: + back_ns.append(namespace) + + return {'front_ns': front_ns, 'back_ns': back_ns} + + +def get_namespace_list(namespace=None): + if not is_multi_asic(): + ns_list = [DEFAULT_NAMESPACE] + return ns_list + + if namespace is None: + # there are few commands that needs to work even if the + # config db is not present. So get the namespaces + # list from linux + ns_list = get_namespaces_from_linux() + else: + ns_list = [namespace] + + return ns_list + + +def get_port_table(namespace=None): + """ + Retrieves the ports from all the asic present on the devices + + Returns: + a dict of all the ports + """ + all_ports = {} + ns_list = get_namespace_list(namespace) + + for ns in ns_list: + ports = get_port_table_for_asic(ns) + all_ports.update(ports) + + return all_ports + + +def get_port_table_for_asic(namespace): + + config_db = connect_config_db_for_ns(namespace) + ports = config_db.get_table(PORT_CFG_DB_TABLE) + return ports + + +def get_namespace_for_port(port_name): + + ns_list = get_namespace_list() + port_namespace = None + + for ns in ns_list: + ports = get_port_table_for_asic(ns) + if port_name in ports: + port_namespace = ns + break + + if port_namespace is None: + raise ValueError('Unknown port name {}'.format(port_name)) + + return port_namespace + + +def get_port_role(port_name, namespace=None): + + ports_config = get_port_table(namespace) + if port_name not in ports_config: + raise ValueError('Unknown port name {}'.format(port_name)) + + if PORT_ROLE not in ports_config[port_name]: + return EXTERNAL_PORT + + role = ports_config[port_name][PORT_ROLE] + return role + + +def is_port_internal(port_name, namespace=None): + + role = get_port_role(port_name, namespace) + + if role == INTERNAL_PORT: + return True + + return False + + +def get_external_ports(port_names, namespace=None): + external_ports = set() + ports_config = get_port_table(namespace) + for port in port_names: + if port in ports_config: + if (PORT_ROLE not in ports_config[port] or + ports_config[port][PORT_ROLE] == EXTERNAL_PORT): + external_ports.add(port) + return external_ports + + +def is_port_channel_internal(port_channel, namespace=None): + + if not is_multi_asic(): + return False + + ns_list = get_namespace_list(namespace) + + for ns in ns_list: + config_db = connect_config_db_for_ns(ns) + port_channels = config_db.get_table(PORT_CHANNEL_CFG_DB_TABLE) + + if port_channel in port_channels: + if 'members' in port_channels[port_channel]: + members = port_channels[port_channel]['members'] + if is_port_internal(members[0], namespace): + return True + + return False + + +def is_bgp_session_internal(bgp_neigh_ip, namespace=None): + + if not is_multi_asic(): + return False + + ns_list = get_namespace_list(namespace) + + for ns in ns_list: + + config_db = connect_config_db_for_ns(ns) + bgp_sessions = config_db.get_table(BGP_NEIGH_CFG_DB_TABLE) + if bgp_neigh_ip not in bgp_sessions: + continue + + bgp_neigh_name = bgp_sessions[bgp_neigh_ip]['name'] + neighbor_metadata = config_db.get_table( + NEIGH_DEVICE_METADATA_CFG_DB_TABLE) + + if ((neighbor_metadata) and + (neighbor_metadata[bgp_neigh_name]['type'].lower() == + ASIC_NAME_PREFIX)): + return True + else: + return False + return False + +def get_front_end_namespaces(): + """ + Get the namespaces in the platform. For multi-asic devices we get the namespaces + mapped to asic which have front-panel interfaces. For single ASIC device it is the + DEFAULT_NAMESPACE which maps to the linux host. + + Returns: + a list of namespaces + """ + namespaces = [DEFAULT_NAMESPACE] + if is_multi_asic(): + ns_list = get_all_namespaces() + namespaces = ns_list['front_ns'] + + return namespaces + + +def get_asic_index_from_namespace(namespace): + """ + Get asic index from the namespace name. + With single ASIC platform, return asic_index 0, which is mapped to the only asic present. + + Returns: + asic_index as an integer. + """ + if is_multi_asic(): + return int(get_asic_id_from_name(namespace)) + + return 0 diff --git a/src/sonic-daemon-base/sonic_daemon_base/__init__.py b/src/sonic-py-common/tests/__init__.py similarity index 100% rename from src/sonic-daemon-base/sonic_daemon_base/__init__.py rename to src/sonic-py-common/tests/__init__.py diff --git a/src/sonic-py-common/tests/device_info_test.py b/src/sonic-py-common/tests/device_info_test.py new file mode 100644 index 000000000000..f3b14b0a5f13 --- /dev/null +++ b/src/sonic-py-common/tests/device_info_test.py @@ -0,0 +1,75 @@ +import os +import sys + +# TODO: Remove this if/else block once we no longer support Python 2 +if sys.version_info.major == 3: + from unittest import mock +else: + # Expect the 'mock' package for python 2 + # https://pypi.python.org/pypi/mock + import mock + +from sonic_py_common import device_info + + +# TODO: Remove this if/else block once we no longer support Python 2 +if sys.version_info.major == 3: + BUILTINS = "builtins" +else: + BUILTINS = "__builtin__" + +MACHINE_CONF_CONTENTS = """\ +onie_version=2016.11-5.1.0008-9600 +onie_vendor_id=33049 +onie_machine_rev=0 +onie_arch=x86_64 +onie_config_version=1 +onie_build_date="2017-04-26T11:01+0300" +onie_partition_type=gpt +onie_kernel_version=4.10.11 +onie_firmware=auto +onie_switch_asic=mlnx +onie_skip_ethmgmt_macs=yes +onie_machine=mlnx_msn2700 +onie_platform=x86_64-mlnx_msn2700-r0""" + +EXPECTED_GET_MACHINE_INFO_RESULT = { + 'onie_arch': 'x86_64', + 'onie_skip_ethmgmt_macs': 'yes', + 'onie_platform': 'x86_64-mlnx_msn2700-r0', + 'onie_machine_rev': '0', + 'onie_version': '2016.11-5.1.0008-9600', + 'onie_machine': 'mlnx_msn2700', + 'onie_config_version': '1', + 'onie_partition_type': 'gpt', + 'onie_build_date': '"2017-04-26T11:01+0300"', + 'onie_switch_asic': 'mlnx', + 'onie_vendor_id': '33049', + 'onie_firmware': 'auto', + 'onie_kernel_version': '4.10.11' +} + + +class TestDeviceInfo(object): + @classmethod + def setup_class(cls): + print("SETUP") + + def test_get_machine_info(self): + with mock.patch("os.path.isfile") as mock_isfile: + mock_isfile.return_value = True + open_mocked = mock.mock_open(read_data=MACHINE_CONF_CONTENTS) + with mock.patch("{}.open".format(BUILTINS), open_mocked): + result = device_info.get_machine_info() + assert result == EXPECTED_GET_MACHINE_INFO_RESULT + open_mocked.assert_called_once_with("/host/machine.conf") + + def test_get_platform(self): + with mock.patch("sonic_py_common.device_info.get_machine_info") as get_machine_info_mocked: + get_machine_info_mocked.return_value = EXPECTED_GET_MACHINE_INFO_RESULT + result = device_info.get_platform() + assert result == "x86_64-mlnx_msn2700-r0" + + @classmethod + def teardown_class(cls): + print("TEARDOWN") diff --git a/src/sonic-restapi b/src/sonic-restapi index ed640ac1f917..d821e5a9d85f 160000 --- a/src/sonic-restapi +++ b/src/sonic-restapi @@ -1 +1 @@ -Subproject commit ed640ac1f917f52c2298c0b799fb6a6cfbecccb4 +Subproject commit d821e5a9d85f346942e694698b8b75b5bddea902 diff --git a/src/sonic-sairedis b/src/sonic-sairedis index c810e5ffbd2d..f0b1e5472f9e 160000 --- a/src/sonic-sairedis +++ b/src/sonic-sairedis @@ -1 +1 @@ -Subproject commit c810e5ffbd2ddb505fee0363bc3d1d30181dd1ac +Subproject commit f0b1e5472f9ecfc1892f6919abaedf563245d9ef diff --git a/src/sonic-snmpagent b/src/sonic-snmpagent index c702a57608e4..1a2b62a93028 160000 --- a/src/sonic-snmpagent +++ b/src/sonic-snmpagent @@ -1 +1 @@ -Subproject commit c702a57608e42fa40f0ea86f82870514eab4c1b7 +Subproject commit 1a2b62a93028642ad77ce8c0f356d093850d0343 diff --git a/src/sonic-swss b/src/sonic-swss index d2bab10efe05..c4949a20a27f 160000 --- a/src/sonic-swss +++ b/src/sonic-swss @@ -1 +1 @@ -Subproject commit d2bab10efe05e8ec209fd5a360778a2d7c8d7f54 +Subproject commit c4949a20a27fcbbe7bbf17cc6fd0a95304584fcb diff --git a/src/sonic-swss-common b/src/sonic-swss-common index ed9c497316e7..49a7c9d87e36 160000 --- a/src/sonic-swss-common +++ b/src/sonic-swss-common @@ -1 +1 @@ -Subproject commit ed9c497316e73bc5d4a6dfbe9f3507d5e92c15f3 +Subproject commit 49a7c9d87e364e2ebad1072ad1eb185ce85ac4de diff --git a/src/sonic-utilities b/src/sonic-utilities index 9700e45322a4..17fb3781b2cb 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 9700e45322a4a58076e5cef604ed15803ffb9314 +Subproject commit 17fb3781b2cb7dfb845faa9f16bc17ccd0069649 diff --git a/src/sonic-yang-models/tests/yang_model_tests/yangModelTesting.py b/src/sonic-yang-models/tests/yang_model_tests/yangModelTesting.py index d36416adcae7..e1b106a17a3f 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/yangModelTesting.py +++ b/src/sonic-yang-models/tests/yang_model_tests/yangModelTesting.py @@ -43,7 +43,9 @@ def __init__(self, tests, yangDir, jsonFile): 'LeafRef': ['Leafref', 'non-existing'], 'When': ['When condition', 'not satisfied'], 'Pattern': ['pattern', 'does not satisfy'], - 'None': [''] + 'Mandatory': ['required element', 'Missing'], + 'Verify': ['verified'], + 'None': [] } self.ExceptionTests = { @@ -118,12 +120,23 @@ def __init__(self, tests, yangDir, jsonFile): 'LOOPBACK_IPPREFIX_PORT_MUST_CONDITION_FALSE': { 'desc': 'Loopback Ip-prefix port-name must condition failure.', 'eStr': self.defaultYANGFailure['Must'] + }, + 'INCORRECT_VLAN_NAME': { + 'desc': 'INCORRECT VLAN_NAME FIELD IN VLAN TABLE.', + 'eStr': self.defaultYANGFailure['Pattern'] + } + } + + self.SpecialTests = { + 'ALL_VLAN_TEST': { + 'desc': 'VLAN TEST.', + 'eStr': self.defaultYANGFailure['None'] } } self.tests = tests if (self.tests == None): - self.tests = self.ExceptionTests.keys() + self.tests = self.ExceptionTests.keys()+self.SpecialTests.keys() self.yangDir = yangDir self.jsonFile = jsonFile self.testNum = 1 @@ -166,6 +179,8 @@ def run(self): test = test.strip() if test in self.ExceptionTests: ret = ret + self.runExceptionTest(test); + elif test in self.SpecialTests: + ret = ret + self.runSpecialTest(test); except Exception as e: printExceptionDetails() raise e @@ -224,7 +239,9 @@ def runExceptionTest(self, test): s = self.loadConfigData(jInput) eStr = self.ExceptionTests[test]['eStr'] log.debug(eStr) - if (sum(1 for str in eStr if str not in s) == 0): + if len(eStr) == 0 and s != "": + raise Exception("{} in not empty".format(s)) + elif (sum(1 for str in eStr if str not in s) == 0): log.info(desc + " Passed\n") return PASS except Exception as e: @@ -232,6 +249,37 @@ def runExceptionTest(self, test): log.info(desc + " Failed\n") return FAIL + """ + Run Special Tests + """ + def runSpecialTest(self, test): + try: + if test == 'ALL_VLAN_TEST': + return self.runVlanSpecialTest(test); + except Exception as e: + printExceptionDetails() + log.info(desc + " Failed\n") + return FAIL + + def runVlanSpecialTest(self, test): + try: + desc = self.SpecialTests[test]['desc'] + self.logStartTest(desc) + jInput = json.loads(self.readJsonInput(test)) + # check all Vlan from 1 to 4094 + for i in xrange(4095): + vlan = 'Vlan'+str(i) + jInput["sonic-vlan:sonic-vlan"]["sonic-vlan:VLAN"]["VLAN_LIST"]\ + [0]["vlan_name"] = vlan + log.debug(jInput) + s = self.loadConfigData(json.dumps(jInput)) + if s!="": + raise Exception("{} in not empty".format(s)) + return PASS + except Exception as e: + printExceptionDetails() + log.info(desc + " Failed\n") + return FAIL # End of Class """ diff --git a/src/sonic-yang-models/tests/yang_model_tests/yangTest.json b/src/sonic-yang-models/tests/yang_model_tests/yangTest.json index 2f85d0259bfa..b42d1cf24cf2 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/yangTest.json +++ b/src/sonic-yang-models/tests/yang_model_tests/yangTest.json @@ -37,6 +37,38 @@ } }, + "ALL_VLAN_TEST": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [{ + "vlan_name": "Vlan1-4094", + "description": "server_vlan", + "dhcp_servers": [ + "10.186.72.56" + ], + "mtu": "9100", + "admin_status": "up" + }] + } + } + }, + + "INCORRECT_VLAN_NAME": { + "sonic-vlan:sonic-vlan": { + "sonic-vlan:VLAN": { + "VLAN_LIST": [{ + "vlan_name": "Vlan8090", + "description": "server_vlan", + "dhcp_servers": [ + "10.186.72.56" + ], + "mtu": "9100", + "admin_status": "up" + }] + } + } + }, + "VLAN_WITH_NON_EXIST_PORT": { "sonic-vlan:sonic-vlan": { "sonic-vlan:VLAN_MEMBER": { @@ -484,6 +516,7 @@ "PORT_LIST": [{ "port_name": "Ethernet8", "alias": "eth8", + "lanes": "65", "description": "Ethernet8", "speed": 25000, "mtu": 9000, @@ -492,6 +525,7 @@ { "port_name": "Ethernet9", "alias": "eth9", + "lanes": "71", "description": "Ethernet9", "speed": 25000, "mtu": 9000, @@ -520,6 +554,7 @@ "PORT_LIST": [{ "port_name": "Ethernet8", "alias": "eth8", + "lanes": "65", "description": "Ethernet8", "speed": 25000, "mtu": 9000, diff --git a/src/sonic-yang-models/yang-models/sonic-vlan.yang b/src/sonic-yang-models/yang-models/sonic-vlan.yang index 4c3aecaf8106..d05d2a39e6d8 100644 --- a/src/sonic-yang-models/yang-models/sonic-vlan.yang +++ b/src/sonic-yang-models/yang-models/sonic-vlan.yang @@ -128,7 +128,7 @@ module sonic-vlan { leaf vlan_name { type string { - pattern 'Vlan([0-9]{1,3}|[0-3][0-9]{4}|[4][0][0-8][0-9]|[4][0][9][0-4])'; + pattern 'Vlan([0-9]{1,3}|[1-3][0-9]{3}|[4][0][0-8][0-9]|[4][0][9][0-4])'; } } diff --git a/src/sonic-ztp b/src/sonic-ztp index c959371ece3b..dd025bc25757 160000 --- a/src/sonic-ztp +++ b/src/sonic-ztp @@ -1 +1 @@ -Subproject commit c959371ece3baebff2d3d748aba863de87b1d0a8 +Subproject commit dd025bc25757d8d83c92246bb7b45b9b35a0371b diff --git a/src/systemd-sonic-generator/systemd-sonic-generator.c b/src/systemd-sonic-generator/systemd-sonic-generator.c index e801fcb229d2..1052e2db622a 100644 --- a/src/systemd-sonic-generator/systemd-sonic-generator.c +++ b/src/systemd-sonic-generator/systemd-sonic-generator.c @@ -498,7 +498,6 @@ static int get_num_of_asic() { Determines if the current platform is single or multi-ASIC ***/ FILE *fp; - FILE *env_fp; char *line = NULL; char* token; char* platform; @@ -546,15 +545,6 @@ static int get_num_of_asic() { free(line); } } - - /*set environment variable NUM_ASIC */ - env_fp = fopen("/etc/environment", "a"); - if (env_fp == NULL) { - fprintf(stderr, "Failed to open environment file\n"); - exit(EXIT_FAILURE); - } - fprintf(env_fp, "NUM_ASIC=%d\n", num_asic); - fclose(env_fp); return num_asic; }