Log in to ask questions, share your expertise, or stay connected to content you value. Don’t have a login? Learn how to become a member.
devlist
01
import
sys
02
from
getpass
03
jnpr.junos
Device
04
jnpr.junos.op.xcvr
XcvrTable
05
06
=
[
'mx240.chi'
,
'mx480.chi'
'mx80.chi'
'srx3400.chi'
]
07
user
raw_input
(
'username: '
)
08
passwd
getpass(
'password: '
09
10
for
host
in
devlist:
11
sys.stdout.write(
'connecting to %s ... '
%
host)
12
sys.stdout.flush()
13
14
dev
Device(host,user
user,password
passwd)
15
dev.
open
()
16
print
'ok.'
17
18
# --------------------------------------------------
19
# actual code processing the Device goes here ...
20
21
22
dev.close()