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

Add following APIs and test cases: #44

Merged
merged 2 commits into from
Feb 13, 2020

Conversation

li-pingmao
Copy link
Collaborator

- get Yang module's prefix
- get the datanode's data type
- get the data type of the node that leafref node points to

- What I did
Add following APIs and test cases:
- get Yang module's prefix
- get the datanode's data type
- get the data type of the node that leafref node points to

- How I did it

  • Added APIs to src/sonic-yang-mgmt/sonic_yang.py
  • Added pytest cases

- How to verify it
pytest, test cases added to test_SonicYang.json to test prefix, data node type, and leafref data type

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

    - get Yang module's prefix
    - get the datanode's data type
    - get the data type of the node that leafref node points to
self.fail(e)
return prefix
else:
return module.prefix()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Ping

Actually, This prefix is not the one which is used in leafref. This is the prefix defined for each module, where as we need the prefix which is used in import statement. Import statement can use a name which is different then module prefix.
For example in sonic-acl, we can have port leafref.

 path "/port:sonic-port/port:PORT/port:PORT_LIST/port:port_name;"

Here port prefix comes from import statement:

	import sonic-port {
		prefix port;<<<<<<<
		revision-date 2019-07-01;
	}

Whereas, this API will return below prefix:

module sonic-port{
	namespace "http://github.com/Azure/sonic-port";
	prefix sonic-port;<<<<<<<<< [We can write any name here]

src/sonic-yang-mgmt/sonic_yang.py Show resolved Hide resolved
- get_leafref_path()
- get_leafref_type_schema()
Copy link
Collaborator

@praveen-li praveen-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

if subtype.type().base() != ly.LY_TYPE_LEAFREF:
return None
else:
return subtype.type().info().lref().path()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives value of leafref, right?

{"xpath":"/sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlanid='111'][port='Ethernet0']/port", "data_type":"LY_TYPE_STRING"},
{"xpath":"/sonic-vlan:sonic-vlan/VLAN_MEMBER/VLAN_MEMBER_LIST[vlanid='111'][port='Ethernet0']/vlanid", "data_type":"LY_TYPE_UINT16"}
],
"leafref_type_schema":[
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really useful, good.

@zhenggen-xu zhenggen-xu merged commit 04242e7 into zhenggen-xu:sonic-cfg-mgmt Feb 13, 2020
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Aug 9, 2022
…onic-net#10406)

#### Why I did it
To take the following into sonic-buildimage
36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (sonic-net#587)

[sonic-swss-common](https://github.com/Azure/sonic-swss-common)
```
36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (sonic-net#587)
556f4ad Add SAI copy action to ACL schema (sonic-net#591)
db18c3a Fix bitwidth of mac address in SAI ACL schema (sonic-net#590)
e9442bb [ConfigDBPipeConnector]: Added set_entry API (sonic-net#586)
6c007c0 Update README for gmock (sonic-net#562)
```

[sonic-linkmgrd](https://github.com/Azure/sonic-linkmgrd)
```
83dfc99 Enforce uniform file/class naming convention (zhenggen-xu#52)
83004bf Shutdown ICMP heartbeats when default route state is missing and ToR is in `auto` mode (zhenggen-xu#44)
b81ea31 Add `LinkProberStateMachineActiveActive`  (zhenggen-xu#47)
c43cf7a Decrease link probing interval after switchover to better determine the overhead of a toggle (zhenggen-xu#43)
2239fbe Enhance clang format (zhenggen-xu#46)
```
#### How I did it
* Advanced submodules pointers

#### How to verify it
1. make configure PLATFORM=mellanox
2. make target/sonic-mellanox.bin
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Aug 9, 2022
#### Why I did it

Submodule update for sonic-dbsyncd with following change:
```
0d67faf 2022-07-28 | Replace pyswsssdk with sonic-py-common (zhenggen-xu#45) [Hua Liu]
265c833 2022-01-11 | Updated the Azure pipeline for Code Coverage (zhenggen-xu#44) [abdosi]
6548116 2021-04-04 | [ci]: add proper azp [Guohan Lu]
43b9dab 2021-04-04 | [pytest]: add pytest.ini [Guohan Lu]
```

#### How I did it

#### How to verify it

#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106

#### Description for the changelog
Submodule update for sonic-dbsyncd with following change:
```
0d67faf 2022-07-28 | Replace pyswsssdk with sonic-py-common (zhenggen-xu#45) [Hua Liu]
265c833 2022-01-11 | Updated the Azure pipeline for Code Coverage (zhenggen-xu#44) [abdosi]
6548116 2021-04-04 | [ci]: add proper azp [Guohan Lu]
43b9dab 2021-04-04 | [pytest]: add pytest.ini [Guohan Lu]
```

#### A picture of a cute animal (not mandatory but encouraged)

Co-authored-by: liuh-80 <azureuser@liuh-dev-vm-02.5fg3zjdzj2xezlx1yazx5oxkzd.hx.internal.cloudapp.net>
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Oct 17, 2022
praveen-li pushed a commit to praveen-li/sonic-buildimage that referenced this pull request Dec 23, 2022
[sonic-linkmgrd][202012] submodule update

3523738 Jing Zhang      Sun Apr 3 20:54:40 2022 -0700   Reset link prober state when default route is back zhenggen-xu#56
8282e78 Jing Zhang      Fri Apr 15 15:59:34 2022 -0700  Keep incrementing sequence number when link prober is suspended and shutdown zhenggen-xu#55 (zhenggen-xu#65)
8246eb8 Jing Zhang      Thu Apr 14 18:49:36 2022 -0700  Shutdown ICMP heartbeats when default route state is missing and ToR is in auto mode zhenggen-xu#44 (zhenggen-xu#59)

sign-off: Jing Zhang zhangjing@microsoft.com
zhenggen-xu pushed a commit that referenced this pull request May 24, 2024
sonic-dhcp-relay
5ae186f Yaqiang Zhu Tue Dec 19 12:05:15 2023 -0500 [counter] Clear counter table when init (#45)
40c6877 Jing Zhang Fri Nov 10 12:41:23 2023 -0800 [CodeQL] fix unmet dependency for build-swss-common (#44)

sonic-dhcpmon
7c55e50 StormLiangMS Thu Sep 14 09:57:06 2023 +0800 Merge pull request #13 from jcaiMR/dev/jcai_master_interface_counter
085a087 jcaiMR Mon Sep 11 09:17:03 2023 +0000 refine counting logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants