Changeset 10892 in genesis for tools/check-batch-cmd
- Timestamp:
- May 16, 2012, 10:49:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/check-batch-cmd
r10434 r10892 18 18 import pysnmp 19 19 from pysnmp.entity.rfc3413.oneliner import cmdgen 20 import netsnmp 20 21 21 22 def snmp_test(): … … 109 110 elif line.startswith('Elan-mmcr'): 110 111 datadump['board'] = 'net45xx' 111 #for iface_key in datadump['autogen_iface_keys']:112 #ifacedump = datadump[iface_key]113 #if ifacedump.has_key('ns_ip') and ifacedump['ns_ip']:114 #addr = ifacedump['ns_ip'].split('/')[0]115 # print "## Bridge IP: %(ns_ip)s at %(interface)s" % ifacedump116 #try:117 #socket.create_connection((addr,80),2)118 #bridge_type = get_bridge_type(addr)119 #datadump[iface_key]['bridge_type'] = bridge_type120 #except (socket.timeout, socket.error) as e:121 #print "### %s (%s)" % (e, addr)122 #except paramiko.AuthenticationException:123 #print "### Conection failed (invalid username/password)"124 #except CmdError, e:125 #print "### Command error: %s" % e112 for iface_key in datadump['autogen_iface_keys']: 113 ifacedump = datadump[iface_key] 114 if ifacedump.has_key('ns_ip') and ifacedump['ns_ip']: 115 addr = ifacedump['ns_ip'].split('/')[0] 116 print "## Bridge IP: %(ns_ip)s at %(autogen_ifname)s" % ifacedump 117 try: 118 socket.create_connection((addr,80),2) 119 bridge_type = get_bridge_type(addr) 120 datadump[iface_key]['bridge_type'] = bridge_type 121 except (socket.timeout, socket.error) as e: 122 print "### %s (%s)" % (e, addr) 123 except paramiko.AuthenticationException: 124 print "### Conection failed (invalid username/password)" 125 except CmdError, e: 126 print "### Command error: %s" % e 126 127 gformat.store_yaml(datadump) 127 128
Note:
See TracChangeset
for help on using the changeset viewer.