)]}'
{"gate/post_test_hook.sh":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3afe868b472689d202bb70a40a79277f46968181","unresolved":false,"context_lines":[{"line_number":12,"context_line":"    for i in `seq 30`; do"},{"line_number":13,"context_line":"        $MANAGE $* db archive_deleted_rows --verbose --max_rows 1000 --before \"$(date -d tomorrow)\""},{"line_number":14,"context_line":"        RET\u003d$?"},{"line_number":15,"context_line":"        if [[ $RET -gt 1 ]]; then"},{"line_number":16,"context_line":"            echo Archiving failed with result $RET"},{"line_number":17,"context_line":"            return $RET"},{"line_number":18,"context_line":"        elif [[ $RET -eq 0 ]]; then"}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_1fff4d34","line":15,"range":{"start_line":15,"start_character":19,"end_line":15,"end_character":22},"updated":"2019-08-21 20:28:19.000000000","message":"ohhhh, missed that this is letting 1 through","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c9917ca12334a869358ca785a78016dced05b144","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    RET\u003d$?"},{"line_number":28,"context_line":"    if [[ $RET -eq 0 ]]; then"},{"line_number":29,"context_line":"        echo Purge successful"},{"line_number":30,"context_line":"    else"},{"line_number":31,"context_line":"        echo Purge failed with result $RET"},{"line_number":32,"context_line":"        return $RET"},{"line_number":33,"context_line":"    fi"},{"line_number":34,"context_line":"}"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_1f3aed32","line":32,"range":{"start_line":30,"start_character":0,"end_line":32,"end_character":19},"updated":"2019-08-21 20:18:57.000000000","message":"If this function is going under set -e, this bit is unreachable.","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"fbaf28bdbff29f7a14d8b94e07b228f1f9574053","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    RET\u003d$?"},{"line_number":28,"context_line":"    if [[ $RET -eq 0 ]]; then"},{"line_number":29,"context_line":"        echo Purge successful"},{"line_number":30,"context_line":"    else"},{"line_number":31,"context_line":"        echo Purge failed with result $RET"},{"line_number":32,"context_line":"        return $RET"},{"line_number":33,"context_line":"    fi"},{"line_number":34,"context_line":"}"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_3f7fa9df","line":32,"range":{"start_line":30,"start_character":0,"end_line":32,"end_character":19},"in_reply_to":"7faddb67_1f3aed32","updated":"2019-08-21 20:24:26.000000000","message":"Ah, yeah. I guess an alternative could be to check the return value of the function and exit accordingly if fail.","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c9917ca12334a869358ca785a78016dced05b144","unresolved":false,"context_lines":[{"line_number":44,"context_line":"conf\u003d\"--config-file $NOVA_CONF --config-file $cell_conf\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"# This needs to go before \u0027set -e\u0027 because otherwise the intermediate runs of"},{"line_number":47,"context_line":"# \u0027nova-manage db archive_deleted_rows\u0027 returning 1 (normal and expected) would"},{"line_number":48,"context_line":"# cause this script to exit and fail."},{"line_number":49,"context_line":"archive_deleted_rows $conf"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_ffd031f9","line":47,"range":{"start_line":47,"start_character":52,"end_line":47,"end_character":73},"updated":"2019-08-21 20:18:57.000000000","message":"eh?\n\nWhen does the command return 1 that we *don\u0027t* want this script to fail?","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"652a869cdbb7759c091abc984753d6986cc66602","unresolved":false,"context_lines":[{"line_number":44,"context_line":"conf\u003d\"--config-file $NOVA_CONF --config-file $cell_conf\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"# This needs to go before \u0027set -e\u0027 because otherwise the intermediate runs of"},{"line_number":47,"context_line":"# \u0027nova-manage db archive_deleted_rows\u0027 returning 1 (normal and expected) would"},{"line_number":48,"context_line":"# cause this script to exit and fail."},{"line_number":49,"context_line":"archive_deleted_rows $conf"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_8ad2195b","line":47,"range":{"start_line":47,"start_character":52,"end_line":47,"end_character":73},"in_reply_to":"7faddb67_3fcd692f","updated":"2019-08-21 20:47:35.000000000","message":"\u003e Unfortunately I don\u0027t see this documented in our doc though:\n \u003e \n \u003e https://docs.openstack.org/nova/latest/cli/nova-manage.html#nova-database\n\nhttps://review.opendev.org/#/c/677819/","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"3afe868b472689d202bb70a40a79277f46968181","unresolved":false,"context_lines":[{"line_number":44,"context_line":"conf\u003d\"--config-file $NOVA_CONF --config-file $cell_conf\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"# This needs to go before \u0027set -e\u0027 because otherwise the intermediate runs of"},{"line_number":47,"context_line":"# \u0027nova-manage db archive_deleted_rows\u0027 returning 1 (normal and expected) would"},{"line_number":48,"context_line":"# cause this script to exit and fail."},{"line_number":49,"context_line":"archive_deleted_rows $conf"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_bff9594e","line":47,"range":{"start_line":47,"start_character":52,"end_line":47,"end_character":73},"in_reply_to":"7faddb67_3fcd692f","updated":"2019-08-21 20:28:19.000000000","message":"Sorry, I misread the main loop.","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"fbaf28bdbff29f7a14d8b94e07b228f1f9574053","unresolved":false,"context_lines":[{"line_number":44,"context_line":"conf\u003d\"--config-file $NOVA_CONF --config-file $cell_conf\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"# This needs to go before \u0027set -e\u0027 because otherwise the intermediate runs of"},{"line_number":47,"context_line":"# \u0027nova-manage db archive_deleted_rows\u0027 returning 1 (normal and expected) would"},{"line_number":48,"context_line":"# cause this script to exit and fail."},{"line_number":49,"context_line":"archive_deleted_rows $conf"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_3fcd692f","line":47,"range":{"start_line":47,"start_character":52,"end_line":47,"end_character":73},"in_reply_to":"7faddb67_ffd031f9","updated":"2019-08-21 20:24:26.000000000","message":"It actually returns 1 for any batch where \"there is more to do\". The pattern is you run it while 1 and then when it returns 0 it means you\u0027re done. See https://github.com/openstack/nova/blob/6ddfad59354d3a7cb77319e378922c35f6c769d9/nova/cmd/manage.py#L498-L507\n\nUnfortunately I don\u0027t see this documented in our doc though:\n\nhttps://docs.openstack.org/nova/latest/cli/nova-manage.html#nova-database","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"44e7a08a3ee7b7e5939c788c5f7df8e0ea47afe8","unresolved":false,"context_lines":[{"line_number":44,"context_line":"conf\u003d\"--config-file $NOVA_CONF --config-file $cell_conf\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"# This needs to go before \u0027set -e\u0027 because otherwise the intermediate runs of"},{"line_number":47,"context_line":"# \u0027nova-manage db archive_deleted_rows\u0027 returning 1 (normal and expected) would"},{"line_number":48,"context_line":"# cause this script to exit and fail."},{"line_number":49,"context_line":"archive_deleted_rows $conf"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"7faddb67_df4695a7","line":47,"range":{"start_line":47,"start_character":52,"end_line":47,"end_character":73},"in_reply_to":"7faddb67_ffd031f9","updated":"2019-08-21 20:22:58.000000000","message":"The return codes are: 0 if nothing was archived, 1 if some number of rows were archived, 2 if max_rows is invalid, 3 if no connection could be established to the API DB, 4 if before date is invalid. If automating, this should be run continuously while the result is 1, stopping at 0.\n\n(of course we don\u0027t document the return codes in the docs...)","commit_id":"f32671359edc7f87c9f77e58d81e0b4d88bffdbe"}]}
