)]}'
{"tools/migrate-db.sh":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8e03e6193cbf6f1fa90c497d1a38d22f068235f6","unresolved":false,"context_lines":[{"line_number":19,"context_line":"    # Usage: getflag help -\u003e 0"},{"line_number":20,"context_line":"    local flag\u003d\"$1\""},{"line_number":21,"context_line":"    for opt in ${OPTS[*]}; do"},{"line_number":22,"context_line":"\tif [ \"$opt\" \u003d\u003d \"--${flag}\" ]; then"},{"line_number":23,"context_line":"\t    return 0"},{"line_number":24,"context_line":"\tfi"},{"line_number":25,"context_line":"    done"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3f79a3b5_80b3494e","line":22,"range":{"start_line":22,"start_character":0,"end_line":22,"end_character":1},"updated":"2018-09-17 21:44:56.000000000","message":"Oh the tabs....","commit_id":"9620e168cc98a65915048accfd99db93571aec70"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8e03e6193cbf6f1fa90c497d1a38d22f068235f6","unresolved":false,"context_lines":[{"line_number":99,"context_line":"\t# Data found"},{"line_number":100,"context_line":"\treturn 0"},{"line_number":101,"context_line":"    else"},{"line_number":102,"context_line":"\t# No data found, but schema intact"},{"line_number":103,"context_line":"\treturn 1"},{"line_number":104,"context_line":"    fi"},{"line_number":105,"context_line":"}"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"3f79a3b5_e0aa3dd0","line":103,"range":{"start_line":102,"start_character":1,"end_line":103,"end_character":9},"updated":"2018-09-17 21:44:56.000000000","message":"A bit confusing since we also return 1 for no schema above. Maybe it doesn\u0027t matter based on how this is used.","commit_id":"9620e168cc98a65915048accfd99db93571aec70"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"52a85ca6092f1950718a324d4caed44ddf00cc71","unresolved":false,"context_lines":[{"line_number":99,"context_line":"\t# Data found"},{"line_number":100,"context_line":"\treturn 0"},{"line_number":101,"context_line":"    else"},{"line_number":102,"context_line":"\t# No data found, but schema intact"},{"line_number":103,"context_line":"\treturn 1"},{"line_number":104,"context_line":"    fi"},{"line_number":105,"context_line":"}"},{"line_number":106,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"3f79a3b5_a0b76521","line":103,"range":{"start_line":102,"start_character":1,"end_line":103,"end_character":9},"in_reply_to":"3f79a3b5_e0aa3dd0","updated":"2018-09-17 21:48:29.000000000","message":"Intentional since no-schema and no-data are equivalent for our purposes.","commit_id":"9620e168cc98a65915048accfd99db93571aec70"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8e03e6193cbf6f1fa90c497d1a38d22f068235f6","unresolved":false,"context_lines":[{"line_number":141,"context_line":"    for var in $required; do"},{"line_number":142,"context_line":"        value\u003d$(eval echo \"\\$$var\")"},{"line_number":143,"context_line":"        if [ -z \"$value\" ]; then"},{"line_number":144,"context_line":"        echo \"A value for $var was not provided but is required\""},{"line_number":145,"context_line":"        return 2"},{"line_number":146,"context_line":"        fi"},{"line_number":147,"context_line":"    done"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"3f79a3b5_207ef569","line":145,"range":{"start_line":144,"start_character":8,"end_line":145,"end_character":16},"updated":"2018-09-17 21:44:56.000000000","message":"indent","commit_id":"9620e168cc98a65915048accfd99db93571aec70"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"34aa08be40a045d91c6d9b6df231fe2f869adc4e","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        command\u003d\"mysql --skip-column-names\""},{"line_number":70,"context_line":"    fi"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    $command -h$host -u$user -p$pass $db $* 2\u003e/dev/null"},{"line_number":73,"context_line":"}"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"function check_db() {"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3f79a3b5_fdf7378b","line":72,"range":{"start_line":72,"start_character":44,"end_line":72,"end_character":55},"updated":"2018-09-18 13:00:49.000000000","message":"You\u0027re doing this because passing -p to the mysql command line client produces a warning about passing the password in plaintext. However, this is going to mask series errors that may occur when executing the input file.\n\nOne alternate that may assuage your desire for clean output but be safer in not hiding real errors would be to direct stderr to a local .migrate-db.mysql.out file instead just so the user can see if there were any errors in processing the input file.","commit_id":"17202805a615dc0360429d5673b4332279587c5f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d179022288134812459744478172edcd5554a24d","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        command\u003d\"mysql --skip-column-names\""},{"line_number":70,"context_line":"    fi"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    $command -h$host -u$user -p$pass $db $* 2\u003e/dev/null"},{"line_number":73,"context_line":"}"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"function check_db() {"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3f79a3b5_6f984e1a","line":72,"range":{"start_line":72,"start_character":44,"end_line":72,"end_character":55},"in_reply_to":"3f79a3b5_fdf7378b","updated":"2018-09-18 13:44:05.000000000","message":"Actually that\u0027s not it. I don\u0027t recall seeing that warning/error. I did it because many of the things we\u0027re checking will fail with \"no such database\" or whatever until everything is ready.","commit_id":"17202805a615dc0360429d5673b4332279587c5f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b94bcecb885d167e5796022631b4f5a1572c72af","unresolved":false,"context_lines":[{"line_number":141,"context_line":"    for var in $required; do"},{"line_number":142,"context_line":"        value\u003d$(eval echo \"\\$$var\")"},{"line_number":143,"context_line":"        if [ -z \"$value\" ]; then"},{"line_number":144,"context_line":"        echo \"A value for $var was not provided but is required\""},{"line_number":145,"context_line":"        return 2"},{"line_number":146,"context_line":"        fi"},{"line_number":147,"context_line":"    done"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"3f79a3b5_e0d8fd7f","line":145,"range":{"start_line":144,"start_character":8,"end_line":145,"end_character":16},"updated":"2018-09-17 21:45:33.000000000","message":"indent","commit_id":"17202805a615dc0360429d5673b4332279587c5f"}],"tools/mysql-migrate-db.sh":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42c60cf2f7929f27201629e92a40803d51e01651","unresolved":false,"context_lines":[{"line_number":16,"context_line":"declare -a ARGS"},{"line_number":17,"context_line":"declare -a OPTS"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"function getflag() {"},{"line_number":20,"context_line":"    # Return true if --$flag is present on the command line"},{"line_number":21,"context_line":"    # Usage: getflag help -\u003e 0"},{"line_number":22,"context_line":"    local flag\u003d\"$1\""},{"line_number":23,"context_line":"    for opt in ${OPTS[*]}; do"},{"line_number":24,"context_line":"        if [ \"$opt\" \u003d\u003d \"--${flag}\" ]; then"},{"line_number":25,"context_line":"            return 0"},{"line_number":26,"context_line":"        fi"},{"line_number":27,"context_line":"    done"},{"line_number":28,"context_line":"    return 1"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"function parse_argv() {"},{"line_number":32,"context_line":"    # Parse command line arguments into positional arguments and"},{"line_number":33,"context_line":"    # option flags. Store each in $ARGS, $OPTS."},{"line_number":34,"context_line":"    # Usage: parse_argv $*"},{"line_number":35,"context_line":"    for item in $*; do"},{"line_number":36,"context_line":"        if echo $item | grep -q -- \u0027^--\u0027; then"},{"line_number":37,"context_line":"            OPTS+\u003d($item)"},{"line_number":38,"context_line":"        else"},{"line_number":39,"context_line":"            ARGS+\u003d($item)"},{"line_number":40,"context_line":"        fi"},{"line_number":41,"context_line":"    done"},{"line_number":42,"context_line":"}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"function db_var() {"},{"line_number":45,"context_line":"    # Return an attribute of database config based on the symbolic"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_79e014cd","line":42,"range":{"start_line":19,"start_character":0,"end_line":42,"end_character":1},"updated":"2018-09-18 17:56:27.000000000","message":"getopt[s]?","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d4b050462875ab6f628156cb13d36e7c30bec4bf","unresolved":false,"context_lines":[{"line_number":16,"context_line":"declare -a ARGS"},{"line_number":17,"context_line":"declare -a OPTS"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"function getflag() {"},{"line_number":20,"context_line":"    # Return true if --$flag is present on the command line"},{"line_number":21,"context_line":"    # Usage: getflag help -\u003e 0"},{"line_number":22,"context_line":"    local flag\u003d\"$1\""},{"line_number":23,"context_line":"    for opt in ${OPTS[*]}; do"},{"line_number":24,"context_line":"        if [ \"$opt\" \u003d\u003d \"--${flag}\" ]; then"},{"line_number":25,"context_line":"            return 0"},{"line_number":26,"context_line":"        fi"},{"line_number":27,"context_line":"    done"},{"line_number":28,"context_line":"    return 1"},{"line_number":29,"context_line":"}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"function parse_argv() {"},{"line_number":32,"context_line":"    # Parse command line arguments into positional arguments and"},{"line_number":33,"context_line":"    # option flags. Store each in $ARGS, $OPTS."},{"line_number":34,"context_line":"    # Usage: parse_argv $*"},{"line_number":35,"context_line":"    for item in $*; do"},{"line_number":36,"context_line":"        if echo $item | grep -q -- \u0027^--\u0027; then"},{"line_number":37,"context_line":"            OPTS+\u003d($item)"},{"line_number":38,"context_line":"        else"},{"line_number":39,"context_line":"            ARGS+\u003d($item)"},{"line_number":40,"context_line":"        fi"},{"line_number":41,"context_line":"    done"},{"line_number":42,"context_line":"}"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"function db_var() {"},{"line_number":45,"context_line":"    # Return an attribute of database config based on the symbolic"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_14676526","line":42,"range":{"start_line":19,"start_character":0,"end_line":42,"end_character":1},"in_reply_to":"3f79a3b5_79e014cd","updated":"2018-09-18 18:34:27.000000000","message":"I hate using getopt in bash","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42c60cf2f7929f27201629e92a40803d51e01651","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    local whichdb\u003d\"$1\""},{"line_number":59,"context_line":"    shift"},{"line_number":60,"context_line":"    local command\u003dmysql"},{"line_number":61,"context_line":"    if [ \"$2\" ]; then"},{"line_number":62,"context_line":"        command\u003d${1:-mysql}"},{"line_number":63,"context_line":"        shift"},{"line_number":64,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_54263dbc","line":61,"range":{"start_line":61,"start_character":4,"end_line":61,"end_character":21},"updated":"2018-09-18 17:56:27.000000000","message":"So if the *third* argument exists, you assume the *second* argument is `command`? In that case, L74 is definitely wrong.","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42c60cf2f7929f27201629e92a40803d51e01651","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        command\u003d\"mysql --skip-column-names\""},{"line_number":72,"context_line":"    fi"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    $command -h$host -u$user -p$pass $db $* 2\u003e$LAST_MYSQL_ERR"},{"line_number":75,"context_line":"}"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"function check_db() {"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_994970b9","line":74,"range":{"start_line":74,"start_character":41,"end_line":74,"end_character":43},"updated":"2018-09-18 17:56:27.000000000","message":"The input may be such that it never matters, but I think this should be \"$@\" (including the double quotes). Otherwise tokens with spaces get separated.\n\nhttps://stackoverflow.com/questions/2761723/what-is-the-difference-between-and-in-shell-scripts\n\n[Later] Also this means that L61 will always trigger when the sql has more than one token in it, which you don\u0027t want.","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d4b050462875ab6f628156cb13d36e7c30bec4bf","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        command\u003d\"mysql --skip-column-names\""},{"line_number":72,"context_line":"    fi"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    $command -h$host -u$user -p$pass $db $* 2\u003e$LAST_MYSQL_ERR"},{"line_number":75,"context_line":"}"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"function check_db() {"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_f47189df","line":74,"range":{"start_line":74,"start_character":41,"end_line":74,"end_character":43},"in_reply_to":"3f79a3b5_994970b9","updated":"2018-09-18 18:34:27.000000000","message":"No, this is a list of tables, none of which can have spaces. Can\u0027t be in quotes or the command won\u0027t see them separately.","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42c60cf2f7929f27201629e92a40803d51e01651","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    local inv"},{"line_number":85,"context_line":"    local inv_count"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    if ! echo \"SELECT DATABASE()\" | mysql_command $whichdb \u003e/dev/null 2\u003e\u00261; then"},{"line_number":88,"context_line":"        echo \"Failed to connect to $whichdb database\""},{"line_number":89,"context_line":"        return 2"},{"line_number":90,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_d974c8d2","line":87,"range":{"start_line":87,"start_character":34,"end_line":87,"end_character":35},"updated":"2018-09-18 17:56:27.000000000","message":"Maybe I\u0027m missing something, but I don\u0027t think any of these pipes are right. The mysql_command function is expecting the sql command as cli args, not on stdin. So this should be\n\n if ! mysql_command $whichdb \"SELECT_DATABASE()\" \u003e/dev/null 2\u003e\u00261; then","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d4b050462875ab6f628156cb13d36e7c30bec4bf","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    local inv"},{"line_number":85,"context_line":"    local inv_count"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    if ! echo \"SELECT DATABASE()\" | mysql_command $whichdb \u003e/dev/null 2\u003e\u00261; then"},{"line_number":88,"context_line":"        echo \"Failed to connect to $whichdb database\""},{"line_number":89,"context_line":"        return 2"},{"line_number":90,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_b47791d1","line":87,"range":{"start_line":87,"start_character":34,"end_line":87,"end_character":35},"in_reply_to":"3f79a3b5_d974c8d2","updated":"2018-09-18 18:34:27.000000000","message":"No it shouldn\u0027t. The mysql command expects sql on stdin, not as args. Maybe you should try running this to see? I\u0027ve run it a lot :)","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42c60cf2f7929f27201629e92a40803d51e01651","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        return 2"},{"line_number":90,"context_line":"    fi"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    inv\u003d$(echo \"SELECT COUNT(id) FROM inventories\" |"},{"line_number":93,"context_line":"              mysql_command $whichdb)"},{"line_number":94,"context_line":"    if [ $? -ne 0 ]; then"},{"line_number":95,"context_line":"        # No schema"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_1940005f","line":92,"range":{"start_line":92,"start_character":38,"end_line":92,"end_character":49},"updated":"2018-09-18 17:56:27.000000000","message":"I wonder if resource providers would be a technically tighter way to check for data, as it\u0027s possible for providers to be inventoryless.\n\nThat said, IRL there should never be resource providers without inventories, so it\u0027s probably fine.","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d4b050462875ab6f628156cb13d36e7c30bec4bf","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        return 2"},{"line_number":90,"context_line":"    fi"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    inv\u003d$(echo \"SELECT COUNT(id) FROM inventories\" |"},{"line_number":93,"context_line":"              mysql_command $whichdb)"},{"line_number":94,"context_line":"    if [ $? -ne 0 ]; then"},{"line_number":95,"context_line":"        # No schema"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_1440c55e","line":92,"range":{"start_line":92,"start_character":38,"end_line":92,"end_character":49},"in_reply_to":"3f79a3b5_1940005f","updated":"2018-09-18 18:34:27.000000000","message":"inventories means it\u0027s more than trivially populated, but could also have no instances. I think that\u0027s what I\u0027m trying to discover here...","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42c60cf2f7929f27201629e92a40803d51e01651","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"function migrate_data() {"},{"line_number":110,"context_line":"    # Actually migrate data from a source to destination symbolic"},{"line_number":111,"context_line":"    # database.  Sets +e during the migration and explodes if anything"},{"line_number":112,"context_line":"    # fails."},{"line_number":113,"context_line":"    # Usage: migrate_data NOVA_API PLACEMENT"},{"line_number":114,"context_line":"    local source\u003d\"$1\""}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_99289098","line":111,"range":{"start_line":111,"start_character":17,"end_line":111,"end_character":24},"updated":"2018-09-18 17:56:27.000000000","message":"?","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d4b050462875ab6f628156cb13d36e7c30bec4bf","unresolved":false,"context_lines":[{"line_number":108,"context_line":""},{"line_number":109,"context_line":"function migrate_data() {"},{"line_number":110,"context_line":"    # Actually migrate data from a source to destination symbolic"},{"line_number":111,"context_line":"    # database.  Sets +e during the migration and explodes if anything"},{"line_number":112,"context_line":"    # fails."},{"line_number":113,"context_line":"    # Usage: migrate_data NOVA_API PLACEMENT"},{"line_number":114,"context_line":"    local source\u003d\"$1\""}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_3445c16f","line":111,"range":{"start_line":111,"start_character":17,"end_line":111,"end_character":24},"in_reply_to":"3f79a3b5_99289098","updated":"2018-09-18 18:34:27.000000000","message":"Removed in the latest rev, will remove this too.","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"42c60cf2f7929f27201629e92a40803d51e01651","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    echo \"To actually migrate, run me with --migrate\""},{"line_number":240,"context_line":"fi"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"rm -f $LAST_MYSQL_ERR"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_74ec9928","line":242,"range":{"start_line":242,"start_character":0,"end_line":242,"end_character":21},"updated":"2018-09-18 17:56:27.000000000","message":"You should do this with an exit trap.","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d4b050462875ab6f628156cb13d36e7c30bec4bf","unresolved":false,"context_lines":[{"line_number":239,"context_line":"    echo \"To actually migrate, run me with --migrate\""},{"line_number":240,"context_line":"fi"},{"line_number":241,"context_line":""},{"line_number":242,"context_line":"rm -f $LAST_MYSQL_ERR"}],"source_content_type":"text/x-sh","patch_set":4,"id":"3f79a3b5_b450f12d","line":242,"range":{"start_line":242,"start_character":0,"end_line":242,"end_character":21},"in_reply_to":"3f79a3b5_74ec9928","updated":"2018-09-18 18:34:27.000000000","message":"I wanted to leave it unless we make it all the way out of here because it\u0027s useful for debug.","commit_id":"60200f5c0e530ed79e2329b372014b98dc328a06"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ae96efba5ef19f115881e149421f5dc38494b80","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        command\u003d\"mysql --skip-column-names\""},{"line_number":75,"context_line":"    fi"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    $command -h$host -u$user -p$pass $db $* 2\u003e$LAST_MYSQL_ERR"},{"line_number":78,"context_line":"}"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"function check_db() {"}],"source_content_type":"text/x-sh","patch_set":7,"id":"3f79a3b5_61fe04b0","line":77,"updated":"2018-09-19 16:15:57.000000000","message":"Cool, thanks for adding that error log.","commit_id":"324f8fc98b98c6fca8136366c6df253a5e9436b9"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"9cf19b9006b3481f1faefb116933f1dae9304b53","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    local inv_count"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    if ! echo \"SELECT DATABASE()\" | mysql_command $whichdb \u003e/dev/null 2\u003e\u00261; then"},{"line_number":91,"context_line":"        echo \"Failed to connect to $whichdb database\""},{"line_number":92,"context_line":"        return 2"},{"line_number":93,"context_line":"    fi"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-sh","patch_set":7,"id":"3f79a3b5_db20129d","line":91,"updated":"2018-09-20 11:02:34.000000000","message":"$ ./mysql-migrate-db.sh\nFailed to connect to NOVA_API database\nFailed to connect to PLACEMENT database\nUnable to proceed without connection to nova database\n\nShould we dump the real detail error (cat $LAST_MYSQL_ERR)in here?\n\nlike:\nERROR 1045 (28000): Access denied for user \u0027root\u0027@\u0027localhost\u0027 (using password: YES)\nor:\nERROR 1049 (42000): Unknown database \u0027placement\u0027\n\nThe admin or user can find the reason quickly.","commit_id":"324f8fc98b98c6fca8136366c6df253a5e9436b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69dbd9cc096262d3255fc16cc02800f793311c6d","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    local inv_count"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    if ! echo \"SELECT DATABASE()\" | mysql_command $whichdb \u003e/dev/null 2\u003e\u00261; then"},{"line_number":91,"context_line":"        echo \"Failed to connect to $whichdb database\""},{"line_number":92,"context_line":"        return 2"},{"line_number":93,"context_line":"    fi"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-sh","patch_set":7,"id":"3f79a3b5_13b16d01","line":91,"in_reply_to":"3f79a3b5_1ea438b8","updated":"2018-09-21 18:06:58.000000000","message":"If not this, at least put something in the help text that error logs are stored in that file.","commit_id":"324f8fc98b98c6fca8136366c6df253a5e9436b9"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"4054ea158329c3248550b097fd25bc8be262e252","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    local inv_count"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    if ! echo \"SELECT DATABASE()\" | mysql_command $whichdb \u003e/dev/null 2\u003e\u00261; then"},{"line_number":91,"context_line":"        echo \"Failed to connect to $whichdb database\""},{"line_number":92,"context_line":"        return 2"},{"line_number":93,"context_line":"    fi"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-sh","patch_set":7,"id":"3f79a3b5_1ea438b8","line":91,"in_reply_to":"3f79a3b5_db20129d","updated":"2018-09-20 12:11:39.000000000","message":"That\u0027s a good idea","commit_id":"324f8fc98b98c6fca8136366c6df253a5e9436b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69dbd9cc096262d3255fc16cc02800f793311c6d","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        cat $LAST_MYSQL_ERR"},{"line_number":125,"context_line":"        return 1"},{"line_number":126,"context_line":"    }"},{"line_number":127,"context_line":"    echo \"Loading to $dest from $tmpfile\""},{"line_number":128,"context_line":"    mysql_command $dest \u003c $tmpfile || {"},{"line_number":129,"context_line":"        echo \u0027Failed to load destination database:\u0027"},{"line_number":130,"context_line":"        cat $LAST_MYSQL_ERR"}],"source_content_type":"text/x-sh","patch_set":7,"id":"3f79a3b5_d372157c","line":127,"updated":"2018-09-21 18:06:58.000000000","message":"OK so I guess it doesn\u0027t matter if the placement DB has any schema in it (when I ran this it didn\u0027t, I just created an empty placement DB):\n\n$ ./tools/mysql-migrate-db.sh --migrate\nNova database contains data, placement database does not. Okay to proceed with migration\nDumping from NOVA_API to migrate-db.j7n6W4sv/from-nova.sql\nLoading to PLACEMENT from migrate-db.j7n6W4sv/from-nova.sql","commit_id":"324f8fc98b98c6fca8136366c6df253a5e9436b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"69dbd9cc096262d3255fc16cc02800f793311c6d","unresolved":false,"context_lines":[{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    RCFILE\u003d\"${1:-migrate-db.rc}\""},{"line_number":143,"context_line":"    if [ ! -f \"$RCFILE\" ]; then"},{"line_number":144,"context_line":"        echo \u0027Specify an RC file on the command line or create migrate-db.rc in the current directory\u0027"},{"line_number":145,"context_line":"        return 1"},{"line_number":146,"context_line":"    fi"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-sh","patch_set":7,"id":"3f79a3b5_539a85c4","line":144,"updated":"2018-09-21 18:06:58.000000000","message":"Would be nice to dump the help automatically if nothing is specified and the rc file doesn\u0027t exist, or mention that you can run with the --help option (-h doesn\u0027t do anything). In my fresh devstack before doing anything (no placement db yet or anything) I just ran it and this is what I got:\n\n$ ./tools/mysql-migrate-db.sh \nSpecify an RC file on the command line or create migrate-db.rc in the current directory\n\nCould be a follow up improvement too.","commit_id":"324f8fc98b98c6fca8136366c6df253a5e9436b9"}]}
