Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yang] Fixing groupings when grouping is in the same module file #9880

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/sonic-yang-mgmt/sonic_yang_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)), \
Expand Down
38 changes: 3 additions & 35 deletions src/sonic-yang-models/yang-models/sonic-lldp.yang
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module sonic-lldp {
grouping lldp_mode_config {
leaf enabled {
type boolean;
default true;
description
"Enable/Disable LLDP";
}
Expand Down Expand Up @@ -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;
}
}

Expand All @@ -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;
}
}
}
Expand Down