not sure how these got past. remove monitor module references from pcucontrol.
[monitor.git] / pcucontrol / reboot.py
index 5744141..d8fdb27 100755 (executable)
@@ -57,7 +57,11 @@ class PCU(object):
                                                'pcu_id', 'model', 
                                                'node_ids', 'ports', ]:
                        if field in plc_pcu_dict:
-                               self.__setattr__(field, plc_pcu_dict[field])
+                               if type(u"") == type(plc_pcu_dict[field]):
+                                       # NOTE: if is a unicode string, convert it.
+                                       self.__setattr__(field, str(plc_pcu_dict[field]))
+                               else:
+                                       self.__setattr__(field, plc_pcu_dict[field])
                        else:
                                raise Exception("No such field %s in PCU object" % field)
 
@@ -327,8 +331,8 @@ class PCUControl(PCUModel,PCURecord):
                        traceback.print_exc()
                        return "EOF connection reset" + str(err)
                except Exception, err:
-                       from monitor.common import email_exception
-                       email_exception(self.host)
+                       #from monitor.common import email_exception
+                       #email_exception(self.host)
                        raise Exception(err)
 
 from pcucontrol.util import command
@@ -365,7 +369,7 @@ def model_to_object(modelname):
        elif "ePowerSwitch" in modelname:
                return ePowerSwitchNew
        elif "IPMI" in modelname:
-               return IPMI
+               return OpenIPMI
        elif "BlackBoxPSMaverick" in modelname:
                return BlackBoxPSMaverick
        elif "PM211MIP" in modelname:
@@ -452,7 +456,8 @@ def reboot_test_new(nodename, values, verbose, dryrun):
                values.update(values['plc_pcu_stats'])
 
        try:
-               modelname = convert_oldmodelname_to_newmodelname(values['model'], values['pcu_id'])
+               #modelname = convert_oldmodelname_to_newmodelname(values['model'], values['pcu_id'])
+               modelname = values['model']
                if modelname:
                        object = eval('%s(values, verbose)' % modelname)
                        rb_ret = object.reboot(values[nodename], dryrun)