Hi,
I am using pyroute2 functionality to fetch the namespace information. In linux Machine.
bash# ip netns ls
vdhd (id: 4)
atrt (id: 3)
prtest (id: 2)
rc_fd (id: 1)
wtest (id: 0)
main
I would like to fetch the id's of namespace using pyroute2 IPDB functionality with out referring the values()
The below code prints the namespace names configures in kernel.
# Get the Namespace Information from kernel
namespace_list = []
namespace_list = netns.listnetns()
print namespace_list
The below code prints the namespace ID present in the interface, but i would like to fetch directly.(Is there a way).
ipden = pyroute2.IPDB(nl=pyroute2.NetNS(name))
for x in ipden.by_name.values():
print x.link_netnsid
Thanks
Daren