diff --git a/src/sonic-yang-mgmt/sonic_yang_ext.py b/src/sonic-yang-mgmt/sonic_yang_ext.py index d99b805328eb..aa36ee0a1951 100644 --- a/src/sonic-yang-mgmt/sonic_yang_ext.py +++ b/src/sonic-yang-mgmt/sonic_yang_ext.py @@ -330,11 +330,11 @@ def _fillLeafDictUses(self, uses_s, table, leafDict): # Assume ':' means reference to another module if ':' in uses['@name']: prefix = uses['@name'].split(':')[0].strip() - uses_module = self._findYangModuleFromPrefix(prefix, table_module) + uses_module_name = self._findYangModuleFromPrefix(prefix, table_module) else: - uses_module = table_module + uses_module_name = table_module['@name'] grouping = uses['@name'].split(':')[-1].strip() - leafs = self.preProcessedYang['grouping'][uses_module][grouping] + leafs = self.preProcessedYang['grouping'][uses_module_name][grouping] self._fillLeafDict(leafs, leafDict) except Exception as e: self.sysLog(msg="_fillLeafDictUses failed:{}".format(str(e)), \ diff --git a/src/sonic-yang-models/yang-models/sonic-lldp.yang b/src/sonic-yang-models/yang-models/sonic-lldp.yang index d1b04f28e93b..a3620f30fe67 100644 --- a/src/sonic-yang-models/yang-models/sonic-lldp.yang +++ b/src/sonic-yang-models/yang-models/sonic-lldp.yang @@ -28,6 +28,7 @@ module sonic-lldp { grouping lldp_mode_config { leaf enabled { type boolean; + default true; description "Enable/Disable LLDP"; } @@ -99,24 +100,7 @@ module sonic-lldp { "Suppress sending of System Capabilities TLV in LLDP frames"; } - leaf enabled { - type boolean; - default true; - description - "Enable/Disable LLDP"; - } - - leaf mode { - type enumeration { - enum RECEIVE; - enum TRANSMIT; - } - - description - "RX/TX mode for LLDP frames"; - } - - //uses lldp_mode_config; + uses lldp_mode_config; } } @@ -132,23 +116,7 @@ module sonic-lldp { "Reference of port on which LLDP to be configured."; } - leaf enabled { - type boolean; - default true; - description - "Enable/Disable LLDP"; - } - - leaf mode { - type enumeration { - enum RECEIVE; - enum TRANSMIT; - } - - description - "RX/TX mode for LLDP frames"; - } - //uses lldp_mode_config; + uses lldp_mode_config; } } }