'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)
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
elif "ePowerSwitch" in modelname:
return ePowerSwitchNew
elif "IPMI" in modelname:
- return IPMI
+ return OpenIPMI
elif "BlackBoxPSMaverick" in modelname:
return BlackBoxPSMaverick
elif "PM211MIP" in modelname:
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)