"nova-manage db online_data_migrations" exit code is strange

Bug #1695965 reported by Chris Friesen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Wishlist
Unassigned

Bug Description

If I'm reading the code right, the return value for "nova-manage db online_data_migrations" will be 1 if we actually performed some migrations and 0 if we performed no migrations, either because there were no remaining migrations or because the migration code raised an exception.

This seems less than useful for someone attempting to script repeated calls to this with --max-count set. The caller needs to parse the output to determine whether or not it was successful.

I think it would make more sense to have the return code as follows:

0 -- no errors and completed
1 -- one of the migrations raised an exception, needs manual action
2 -- no errors but not yet complete, need to call again

since it would allow for an automated retry based solely on the exit code.

At the very least, the return code should be nonzero for the case where one of the migrations raised an exception, and 0 for the case where no exception was raised.

Chris Friesen (cbf123)
description: updated
description: updated
Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :

Chris, I'm not seeing this as a bug, rather some possible code improvement. Closing it as Invalid/Wishlist and just open a change for reviews, that's it :-)

Changed in nova:
status: New → Invalid
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.