summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ee532b2)
convert unicode strings into standard strings.
'pcu_id', 'model',
'node_ids', 'ports', ]:
if field in plc_pcu_dict:
'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)
else:
raise Exception("No such field %s in PCU object" % field)
traceback.print_exc()
return "EOF connection reset" + str(err)
except Exception, err:
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
raise Exception(err)
from pcucontrol.util import command
print "Interrupted, exiting..."
sys.exit(1)
except Exception, err:
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):
return ("", str(err))
def system(self, cmd, timeout=COMMAND_TIMEOUT*2):