- node_ids = values['node_ids']
- ports = values['ports']
- nid2port = {}
- i = 0
-
- for id in node_ids:
- nid2port[id] = ports[i]
- i += 1
-
- # ####
- # TODO: check port status above for whether or not to try...
- # ####
- # DataProbe iPal (many sites)
- if continue_probe and values['model'].find("Dataprobe IP-41x/IP-81x") >= 0:
- if values['portstatus']['23'] == "open":
- rb_ret = reboot.ipal_reboot(pcu_name(values),
- values['password'],
- nid2port[values['node_id']],
- True)
- else:
- rb_ret = "Unsupported_Port"
-
-
- # APC Masterswitch (Berkeley)
- elif continue_probe and values['model'].find("APC AP79xx/Masterswitch") >= 0:
- if values['portstatus']['22'] == "open" or \
- values['portstatus']['23'] == "open":
- rb_ret = reboot.apc_reboot(pcu_name(values),
- values['username'],
- values['password'],
- nid2port[values['node_id']],
- values['portstatus'],
- True)
- else:
- rb_ret = "Unsupported_Port"
- # BayTech DS4-RPC
- elif continue_probe and values['model'].find("Baytech DS4-RPC") >= 0:
- if values['portstatus']['22'] == "open":
- rb_ret = reboot.baytech_reboot(pcu_name(values),
- values['username'],
- values['password'],
- nid2port[values['node_id']],
- True)
- else:
- rb_ret = "Unsupported_Port"
-
-
- # iLO
- elif continue_probe and values['model'].find("HP iLO") >= 0:
- if values['portstatus']['22'] == "open":
- rb_ret = reboot.ilo_reboot(pcu_name(values),
- values['username'],
- values['password'],
- True)
- else:
- rb_ret = "Unsupported_Port"
-
- # DRAC ssh
- elif continue_probe and values['model'].find("Dell RAC") >= 0:
- if values['portstatus']['22'] == "open":
- rb_ret = reboot.drac_reboot(pcu_name(values),
- values['username'],
- values['password'],
- True)
- else:
- rb_ret = "Unsupported_Port"
-
-
- # BlackBox PSExxx-xx (e.g. PSE505-FR)
- elif continue_probe and \
- (values['model'].find("BlackBox PS5xx") >= 0 or
- values['model'].find("ePowerSwitch 1/4/8x") >=0 ):
- if values['portstatus']['80'] == "open":
- rb_ret = reboot.bbpse_reboot(pcu_name(values),
- values['username'],
- values['password'],
- nid2port[values['node_id']],
- 80,
- True)
- else:
- rb_ret = "Unsupported_PCU"
-
- # x10toggle
- elif continue_probe and values['protocol'] == "ssh" and \
- values['model'] == "x10toggle":
- rb_ret = reboot.x10toggle_reboot(pcu_name(values),
- values['username'],
- values['password'],
- nid2port[values['node_id']],
- True)
- # ????
- elif continue_probe and values['protocol'] == "racadm" and \
- values['model'] == "RAC":
- rb_ret = reboot.racadm_reboot(pcu_name(values),
- values['username'],
- values['password'],
- nid2port[values['node_id']],
- True)
- elif continue_probe:
- rb_ret = "Unsupported_PCU"
-
- elif continue_probe == False:
- if 'portstatus' in values:
- rb_ret = "NetDown"
- else:
- rb_ret = "Not_Run"