@@ -0,0 +1,811 @@
+#!/usr/bin/python%0A%0A''' use vty service to get output '''%0A%0Afrom onepk_helper import NetworkDevice%0Afrom onep.vty import VtyService%0Aimport yaml%0Aimport sys%0A%0ACMDS = %5B'terminal length 0', 'show version'%5D%0A%0Adef main(args):%0A    ''' main '''%0A    rtrs = yaml.load(file(args%5B0%5D).read())%0A    for rtr in rtrs:%0A        ndev = NetworkDevice(**rtr)%0A        ndev.connect()%0A%0A        print %22Connection established to: %25s%22 %25 ndev.net_element.properties.sys_name%0A        vty_svc = VtyService(ndev.net_element)%0A        vty_svc.open()%0A        for cmd in CMDS:%0A            out = vty_service.write(cmd)%0A            print out%0A%0A        ndev.disconnect()%0A%0Aif __name__ == '__main__':%0A    try:%0A        sys.exit(main(sys.argv%5B1:%5D))%0A    except KeyboardInterrupt, e:%0A        print %3E%3E sys.stderr, %22Exiting on user request.%5Cn%22%0A        sys.exit(1)%0A

add 6-3