From 130b64b59e5dd4e2b0fc307940de873aef45b989 Mon Sep 17 00:00:00 2001
From: Stephen Soltesz <soltesz@cs.princeton.edu>
Date: Wed, 7 Nov 2007 19:52:12 +0000
Subject: [PATCH] Added new squence for apc_reboot()

---
 reboot.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/reboot.py b/reboot.py
index 46486e2..581f71b 100755
--- a/reboot.py
+++ b/reboot.py
@@ -160,6 +160,16 @@ def apc_reboot(ip, username, password, port, protocol, dryrun):
 
 	transport = None
 
+	# TODO: I may need to differentiate between different models of APC
+	# hardware...
+	# 	for instance, the original code didn't work for:
+	# 		planetdev03.fm.intel.com
+	#			American Power Conversion               
+	#					Network Management Card AOS      v3.3.0
+	#			(c) Copyright 2005 All Rights Reserved  
+	#					Rack PDU APP                     v3.3.1
+
+
 	try:
 		#if "ssh" in protocol:
 		if "22" in protocol and protocol['22'] == "open":
@@ -194,7 +204,11 @@ def apc_reboot(ip, username, password, port, protocol, dryrun):
 		# 4- Power Supply Status
 
 		# 3- Outlet Control/Config
-		telnet_answer(transport, "\r\n> ", "3")
+		telnet_answer(transport, "\r\n> ", "2")
+		telnet_answer(transport, "\r\n> ", "1")
+
+		# 3- Outlet Control/Config
+		#telnet_answer(transport, "\r\n> ", "3")
 
 		# 1- Outlet 1
 		# 2- Outlet 2
-- 
2.47.0