From: Stephen Soltesz Date: Thu, 27 Aug 2009 18:50:13 +0000 (+0000) Subject: not sure how these got past. remove monitor module references from pcucontrol. X-Git-Tag: Monitor-3.0-20~7 X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=commitdiff_plain;h=4c13f1b5fbe5e9f3eaf32cf7ba7571f1fb900618 not sure how these got past. remove monitor module references from pcucontrol. convert unicode strings into standard strings. --- diff --git a/pcucontrol/reboot.py b/pcucontrol/reboot.py index 30c7cb5..d8fdb27 100755 --- a/pcucontrol/reboot.py +++ b/pcucontrol/reboot.py @@ -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 diff --git a/pcucontrol/util/command.py b/pcucontrol/util/command.py index 47627b4..6f112fb 100644 --- a/pcucontrol/util/command.py +++ b/pcucontrol/util/command.py @@ -77,8 +77,8 @@ class CMD: print "Interrupted, exiting..." sys.exit(1) except Exception, err: - from monitor.common import email_exception - email_exception() + #from monitor.common import email_exception + #email_exception() return ("", str(err)) def system(self, cmd, timeout=COMMAND_TIMEOUT*2):