-# Returns true if rebooted via PCU
-def reboot_old(nodename, dryrun):
- pcu = plc.getpcu(nodename)
- if not pcu:
- plc.nodePOD(nodename)
- return False
- # Try the PCU first
- logger.debug("Trying PCU %s %s" % (pcu['hostname'], pcu['model']))
-
- # APC Masterswitch (Berkeley)
- if pcu['model'] == "APC Masterswitch":
- err = apc_reboot(pcu['ip'], pcu['username'],pcu['password'],
- pcu[nodename], pcu['protocol'], dryrun)
-
- # DataProbe iPal (many sites)
- elif pcu['protocol'] == "telnet" and pcu['model'].find("IP-4") >= 0:
- err = ipal_reboot(pcu['ip'],pcu['password'], pcu[nodename], dryrun)
-
- # BayTech DS4-RPC
- elif pcu['protocol'] == "ssh" and \
- (pcu['model'].find("Baytech") >= 0 or pcu['model'].find("DS4") >= 0):
- err = baytech_reboot(pcu['ip'], pcu['username'],pcu['password'], pcu[nodename], dryrun)
-
- # BlackBox PSExxx-xx (e.g. PSE505-FR)
- elif pcu['protocol'] == "http" and (pcu['model'] == "bbpse"):
- err = bbpse_reboot(pcu['ip'], pcu['username'], pcu['password'], pcu[nodename],80, dryrun)
-
- # x10toggle
- elif pcu['protocol'] == "ssh" and (pcu['model'] == "x10toggle"):
- err = x10toggle_reboot(pcu['ip'], pcu['username'],pcu['password'], pcu[nodename], dryrun)
-
- #
- elif pcu['protocol'] == "racadm" and (pcu['model'] == "RAC"):
- err = racadm_reboot(pcu['ip'], pcu['username'],pcu['password'], pcu_[nodename], dryrun)
-
- # Unknown or unsupported
- else:
- err = errno.EPROTONOSUPPORT
- return False
- return True
-
-