
8: Device Ports
SLB™ Branch Office Manager User Guide
161
pList = []
if numPorts == 24 or numPorts == 40:
# Adjust port numbering for SLC8024 and SLC8040
skipPorts = True
numPorts = nu 8
# Loop through device ports, connect and try to detect the prompt
while devicePort <= numPorts:
if skipPorts and devicePort >= 9 and devicePort <= 16:
devicePort = devi 1
pList.append('')
continue
print("Scanning device port", devicePort, "...")
port = str(devicePort)
p=pexpect.spawn('portsession', ['-p', port])
# Login (if required), and wait for the first prompt
p.sendline("")
gotPrompt = False
slcDevice = False
cnt = 1
while not gotPrompt:
i = p.expect([pexpect.TIMEOUT, pexpect.EOF,
'login:', 'Error: (.*)\r\n',
'>'], timeout=10)
if i == 0: # Timeout
cnt = cnt + 1
if cnt == 3:
print("Timeout waiting to connect to DP", devicePort, ".")
p.terminate(True)
p.wait()
break
# may need to send a CR to get prompt
p.send("\r")
elif i == 1: # EOF
print("portsession on DP ", devicePort, "unexpectedly
terminated.")
break
elif i == 2: # login prompt
p.sendline("sysadmin")
p.expect("Password:")
p.sendline("PASS")
slcDevice = True
gotPrompt = True
elif i == 3: # error from portsession
print(p.match.group(1).decode('utf-8'))
p.terminate(True)
p.wait()
break
elif i == 4: # prompt
gotPrompt = True
# end if while not gotPrompt:
Содержание 100-120 VAC SLB
Страница 114: ...8 Device Ports SLB Branch Office Manager User Guide 114 Figure 8 4 Device Ports Settings ...
Страница 131: ...8 Device Ports SLB Branch Office Manager User Guide 131 Figure 8 10 Devices Power Outlets ...
Страница 174: ...9 USB Port SLB Branch Office Manager User Guide 174 Figure 9 3 Devices USB Modem ...
Страница 227: ...12 Maintenance SLB Branch Office Manager User Guide 227 Figure 12 1 Maintenance Firmware Configurations ...