+ print "act_record['stage'] == %s " % act_record['stage']
+
+ # avoid end records, and nmreset records
+ # reboot_node_failed, is set below, so don't reboot repeatedly.
+
+ if 'monitor-end-record' not in act_record['stage'] and \
+ 'nmreset' not in act_record['stage'] and \
+ 'reboot_node_failed' not in act_record:
+
+ if "DOWN" in act_record['log'] and \
+ 'pcu_ids' in act_record['plcnode'] and \
+ len(act_record['plcnode']['pcu_ids']) > 0:
+
+ print "%s" % act_record['log'],
+ print "%15s" % (['reboot_node'],)
+ # Set node to re-install
+ plc.nodeBootState(act_record['nodename'], "rins")
+ try:
+ ret = reboot_node({'hostname': act_record['nodename']})
+ except Exception, exc:
+ print "exception on reboot_node:"
+ import traceback
+ print traceback.print_exc()
+ ret = False
+
+ if ret: # and ( 'reboot_node_failed' not in act_record or act_record['reboot_node_failed'] == False):
+ # Reboot Succeeded
+ print "reboot succeeded for %s" % act_record['nodename']
+ act_record2 = {}
+ act_record2.update(act_record)
+ act_record2['action'] = ['reboot_node']
+ act_record2['stage'] = "reboot_node"
+ act_record2['reboot_node_failed'] = False
+ act_record2['email_pcu'] = False
+
+ if nodename not in self.act_all:
+ self.act_all[nodename] = []
+ print "inserting 'reboot_node' record into act_all"
+ self.act_all[nodename].insert(0,act_record2)
+
+ # return None to avoid further action
+ print "Taking no further action"
+ return None
+ else:
+ print "reboot failed for %s" % act_record['nodename']
+ # set email_pcu to also send pcu notice for this record.
+ act_record['reboot_node_failed'] = True
+ act_record['email_pcu'] = True