Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: client/cros/power_strip.py

Issue 6627029: Refactor site_power_status, power_strip modules into client/cros. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/cros/power_status.py ('k') | client/site_tests/power_ARMSettings/power_ARMSettings.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import telnetlib, threading, time 5 import telnetlib, threading, time
6 6
7 # Controls Server Technology CW-16V1-C20M switched CDUs over Telnet 7 # Controls Server Technology CW-16V1-C20M switched CDUs over Telnet
8 # Opens a new connection for every command to 8 # Opens a new connection for every command to
9 # avoid threading and address space conflicts 9 # avoid threading and address space conflicts
10 10
(...skipping 21 matching lines...) Expand all
32 def _do_command(self, command, outlet=1): 32 def _do_command(self, command, outlet=1):
33 tn = telnetlib.Telnet(self.host) 33 tn = telnetlib.Telnet(self.host)
34 tn.read_until('Username: ') 34 tn.read_until('Username: ')
35 tn.write(self.user + '\n') 35 tn.write(self.user + '\n')
36 tn.read_until('Password: ') 36 tn.read_until('Password: ')
37 tn.write(self.password + '\n') 37 tn.write(self.password + '\n')
38 tn.read_until('Switched CDU: ') 38 tn.read_until('Switched CDU: ')
39 tn.write('%s .a%d\n' % (command, outlet)) 39 tn.write('%s .a%d\n' % (command, outlet))
40 tn.read_some() 40 tn.read_some()
41 tn.close() 41 tn.close()
OLDNEW
« no previous file with comments | « client/cros/power_status.py ('k') | client/site_tests/power_ARMSettings/power_ARMSettings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698