Hm, let me check it out and get back to you. We had some migrations that exited in failure, but with a non-0 exit status during our release. I'll see if I can reproduce this this week.
-Ben On Monday, October 26, 2015 at 11:21:17 AM UTC-7, Tim Graham wrote: > > The place you linked to is ignoring CommandError when parsing arguments. > I'm not sure under what conditions this happens (if at all) -- the Django > tests don't cover it. > > As far as I know, BaseCommand already does sys.exit(1) when there's an > unhandled exception: > https://github.com/django/django/blob/df0a446fd4c864c003e4f941b5b7abd6f10c9427/django/core/management/base.py#L289-L300 > > Could you clarify how to reproduce the problem you're seeing? > > On Monday, October 26, 2015 at 2:01:17 PM UTC-4, bliy...@rentlytics.com > wrote: >> >> Is it ok if I do a PR on this? This seems like it would be really useful >> for automation. >> >> -Ben >> >> On Thursday, October 22, 2015 at 2:20:18 AM UTC-7, Ben Liyanage wrote: >>> >>> Hey, >>> >>> What do you guys think about this feature request? >>> >>> > On CommandError, sys.exit(1) >>> >>> It would be pretty easy to do the sys.exit(1) right here: >>> >>> >>> https://github.com/django/django/blob/df0a446fd4c864c003e4f941b5b7abd6f10c9427/django/core/management/__init__.py#L289 >>> >>> This would allow you to fail an automated build when migrations (or any >>> other management command) failed. Currently I see no way of doing that. >>> >>> Beyond that, I noticed that the sys.exit(1) is not very consistently >>> applied on the makemigrations management command (for example, it is not >>> called when the --merge parameter is supplied). >>> >>> I can do the PR for the CommandError thing (unless anyone sees a reason >>> not to, or that would not work/there is a better place to put it). >>> >>> -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/794a8e8b-2938-4cae-9245-9bdf056ae6ca%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.