Alon Bar-Lev has posted comments on this change.
Change subject: Handling errors in daemonAdapter
......................................................................
Patch Set 10:
(3 comments)
....................................................
File init/daemonAdapter
Line 57: self._args = parser.parse_args(sys.argv[1:])
Line 58:
Line 59: def _log(self, msg):
Line 60: if self._args and self._args.syslog:
Line 61: syslog.syslog(msg)
Please check what happens if there is \n in msg, you probably need to loop.
Line 62: else:
Line 63: sys.stderr.write(msg)
Line 64:
Line 65: def execute(self):
Line 59: def _log(self, msg):
Line 60: if self._args and self._args.syslog:
Line 61: syslog.syslog(msg)
Line 62: else:
Line 63: sys.stderr.write(msg)
"%s\n" msg?
Line 64:
Line 65: def execute(self):
Line 66: try:
Line 67: os.nice(config.getint('vars', 'vdsm_nice'))
Line 102: os.execve(cmd[0], cmd, env)
Line 103: return 0
Line 104:
Line 105: except Exception as e:
Line 106: self._log("Error in daemonAdapater: %s" % e)
don't you want to print stack trace?
Line 107: return 1
Line 108:
Line 109:
Line 110: if __name__ == '__main__':
--
To view, visit http://gerrit.ovirt.org/18810
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib515b01f06331d744b40236af5a1b12a16c37871
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches