I'm trying to get the chassis MAC address from a switch, and I'm having some sort of RPC/YAML problem. Can someone help me troubleshoot this please?
Thanks,
Jason
from jnpr.junos import Device
from jnpr.junos.factory.factory_loader import FactoryLoader
import yaml
import pprint
yaml_data="""
---
junos_chassis_mac_address_table:
rpc: get-chassis-mac-addresses
item: chassis-mac-information
view: junos_chassis_mac_address_view
key: slot
junos_chassis_mac_address_view:
fields:
slot: slot
mac_address: mac-address
mac_count: count
"""
dev = Device(host='xxx', user='xxx', password='xxx')
dev.open()
globals().update(FactoryLoader().load(yaml.load(yaml_data)))
mac = junos_chassis_mac_address_view(dev)
mac.get()
print mac.keys()
print mac.values()
dev.close()