On 17.01.2017 10:50, Mo wrote:
Hi, is there any result code or documentation of trac-admin?
It seems that it does not send result codes.

I have a cronjob doing the "changeset added" every 5 minutes after synchronizing git. If Trac returns errors in this while I need to buffer the changesets in order to retry later. But I can't see a way to check if "trac-admin changeset added" was successful.
trac-admin does set the exit status / error level in theory. This seems to work for me for simple things.
"trac-admin  env help" sets it to 0.
"trac-admin  env WRONG" sets it to 2.
https://trac.edgewall.org/browser/trunk/trac/admin/console.py?rev=15259&marks=112,132,629,644,651#L101

But "trac-admin env changeset added WRONG WRONG" prints "Repository 'WRONG' not found", while also setting the error level to 0. Indeed there's no attempt to return anything indicating the printed error here:
https://trac.edgewall.org/browser/trunk/trac/versioncontrol/admin.py?rev=15259&marks=96,97#L91
Also the errors are printed to stdout, not sterr.
Sounds like a bug (or missing feature) to me.

But I'm not familiar with that cmd.Cmd.onecmd() mechanism, and if it's even possible to pass an error status through there.
https://docs.python.org/2/library/cmd.html#cmd.Cmd.onecmd

Best regards,
Peter

--
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/trac-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to