On Tue, Mar 8, 2016, at 06:16 AM, Finucane, Stephen wrote: > I'm working on a fix [1] for bug #1538227, "Failed `nova-manage db > sync` returns exitcode of 0" [2]. Having done this, I've noted that > there seems to be no consistent policy around (a) what return codes to > use (if any), and (b) whether to use logging or printing. Are there > any guidelines on this in Nova (or any OpenStack project, for that > matter) and, if not, do we need some? This is important for me as I'm > adding a new return code to said executable and I've been asked for > provide some rationale for my choice of code [3] > > FWIW, I think the returns codes don't matter so much so long as they > always return non-zero for failed/error cases and don't change (without > good reason) once they do so. I also think output should be done via > print, per the recommendations of the Python documentation [4], but > some consitency in output would be appreciated.
I commented on the review as well, but after thinking on this some more I'm inclined to have it return an exitcode of 1 for a generic failure and we could later get into splitting the return code based on exception type or some other distinct property of failures. > > Cheers, > Stephen > > [1] https://review.openstack.org/#/c/289308/2 > [2] https://bugs.launchpad.net/nova/+bug/1538227 > [3] https://review.openstack.org/#/c/289308/2/nova/cmd/manage.py > [4] https://docs.python.org/3.3/howto/logging.html#when-to-use-logging > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: > [email protected]?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev __________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
