)]}'
{"tools/configure_for_func_testing.sh":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"ec1242005bfcb538615afeccf2b9b11c474c7e6f","unresolved":true,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    # Avoid attempting to configure the db if it appears to already"},{"line_number":156,"context_line":"    # have run.  The setup as currently defined is not idempotent."},{"line_number":157,"context_line":"    if mysql openstack_citest \u003e /dev/null 2\u003e\u00261 \u003c /dev/null; then"},{"line_number":158,"context_line":"        echo_summary \"DB config appears to be complete, skipping.\""},{"line_number":159,"context_line":"        return 0"},{"line_number":160,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":1,"id":"45ebd336_4f7b6cd6","line":157,"range":{"start_line":157,"start_character":13,"end_line":157,"end_character":29},"updated":"2022-03-01 14:15:36.000000000","message":"maybe this can also be changed to variable?","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":13861,"name":"yatin","email":"ykarel@redhat.com","username":"yatinkarel"},"change_message_id":"1911e81b9c7f96bfdc3171c3df2a6bbc6cbaacd0","unresolved":true,"context_lines":[{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    # Avoid attempting to configure the db if it appears to already"},{"line_number":156,"context_line":"    # have run.  The setup as currently defined is not idempotent."},{"line_number":157,"context_line":"    if mysql openstack_citest \u003e /dev/null 2\u003e\u00261 \u003c /dev/null; then"},{"line_number":158,"context_line":"        echo_summary \"DB config appears to be complete, skipping.\""},{"line_number":159,"context_line":"        return 0"},{"line_number":160,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":1,"id":"241504c9_543eb7b3","line":157,"range":{"start_line":157,"start_character":13,"end_line":157,"end_character":29},"in_reply_to":"45ebd336_4f7b6cd6","updated":"2022-03-01 15:50:47.000000000","message":"Ok created a new variable for DATABASE_NAME defaults to openstack_citest and used it as all places where needed.","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"ec1242005bfcb538615afeccf2b9b11c474c7e6f","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        configure_database_postgresql"},{"line_number":177,"context_line":"    fi"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    # Set up the \u0027openstack_citest\u0027 user and database in each backend"},{"line_number":180,"context_line":"    tmp_dir\u003d$(mktemp -d)"},{"line_number":181,"context_line":"    trap \"rm -rf $tmp_dir\" EXIT"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"084627c7_88268a07","line":179,"updated":"2022-03-01 14:15:36.000000000","message":"same here","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":13861,"name":"yatin","email":"ykarel@redhat.com","username":"yatinkarel"},"change_message_id":"1911e81b9c7f96bfdc3171c3df2a6bbc6cbaacd0","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        configure_database_postgresql"},{"line_number":177,"context_line":"    fi"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    # Set up the \u0027openstack_citest\u0027 user and database in each backend"},{"line_number":180,"context_line":"    tmp_dir\u003d$(mktemp -d)"},{"line_number":181,"context_line":"    trap \"rm -rf $tmp_dir\" EXIT"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-sh","patch_set":1,"id":"76156287_708e60df","line":179,"in_reply_to":"084627c7_88268a07","updated":"2022-03-01 15:50:47.000000000","message":"Done","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"ec1242005bfcb538615afeccf2b9b11c474c7e6f","unresolved":true,"context_lines":[{"line_number":181,"context_line":"    trap \"rm -rf $tmp_dir\" EXIT"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    cat \u003c\u003c EOF \u003e $tmp_dir/mysql.sql"},{"line_number":184,"context_line":"CREATE DATABASE openstack_citest;"},{"line_number":185,"context_line":"CREATE USER \u0027${DATABASE_USER}\u0027@\u0027localhost\u0027 IDENTIFIED BY \u0027${MYSQL_PASSWORD}\u0027;"},{"line_number":186,"context_line":"GRANT ALL PRIVILEGES ON *.* TO \u0027${DATABASE_USER}\u0027@\u0027localhost\u0027;"},{"line_number":187,"context_line":"FLUSH PRIVILEGES;"}],"source_content_type":"text/x-sh","patch_set":1,"id":"5118ccb5_739ac962","line":184,"updated":"2022-03-01 14:15:36.000000000","message":"and here","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":13861,"name":"yatin","email":"ykarel@redhat.com","username":"yatinkarel"},"change_message_id":"1911e81b9c7f96bfdc3171c3df2a6bbc6cbaacd0","unresolved":false,"context_lines":[{"line_number":181,"context_line":"    trap \"rm -rf $tmp_dir\" EXIT"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    cat \u003c\u003c EOF \u003e $tmp_dir/mysql.sql"},{"line_number":184,"context_line":"CREATE DATABASE openstack_citest;"},{"line_number":185,"context_line":"CREATE USER \u0027${DATABASE_USER}\u0027@\u0027localhost\u0027 IDENTIFIED BY \u0027${MYSQL_PASSWORD}\u0027;"},{"line_number":186,"context_line":"GRANT ALL PRIVILEGES ON *.* TO \u0027${DATABASE_USER}\u0027@\u0027localhost\u0027;"},{"line_number":187,"context_line":"FLUSH PRIVILEGES;"}],"source_content_type":"text/x-sh","patch_set":1,"id":"ea235be5_dfb390a3","line":184,"in_reply_to":"5118ccb5_739ac962","updated":"2022-03-01 15:50:47.000000000","message":"Done","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"ec1242005bfcb538615afeccf2b9b11c474c7e6f","unresolved":true,"context_lines":[{"line_number":186,"context_line":"GRANT ALL PRIVILEGES ON *.* TO \u0027${DATABASE_USER}\u0027@\u0027localhost\u0027;"},{"line_number":187,"context_line":"FLUSH PRIVILEGES;"},{"line_number":188,"context_line":"EOF"},{"line_number":189,"context_line":"    /usr/bin/mysql -u $MYSQL_USER -p\"$MYSQL_PASSWORD\" \u003c $tmp_dir/mysql.sql"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    if [[ \"$install_pg\" \u003d\u003d \"True\" ]]; then"},{"line_number":192,"context_line":"        cat \u003c\u003c EOF \u003e $tmp_dir/postgresql.sql"}],"source_content_type":"text/x-sh","patch_set":1,"id":"e80aaa0c_d1b1d1d0","line":189,"updated":"2022-03-01 14:15:36.000000000","message":"why MYSQL_USER and not DATABASE_USER here?","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":13861,"name":"yatin","email":"ykarel@redhat.com","username":"yatinkarel"},"change_message_id":"1911e81b9c7f96bfdc3171c3df2a6bbc6cbaacd0","unresolved":true,"context_lines":[{"line_number":186,"context_line":"GRANT ALL PRIVILEGES ON *.* TO \u0027${DATABASE_USER}\u0027@\u0027localhost\u0027;"},{"line_number":187,"context_line":"FLUSH PRIVILEGES;"},{"line_number":188,"context_line":"EOF"},{"line_number":189,"context_line":"    /usr/bin/mysql -u $MYSQL_USER -p\"$MYSQL_PASSWORD\" \u003c $tmp_dir/mysql.sql"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    if [[ \"$install_pg\" \u003d\u003d \"True\" ]]; then"},{"line_number":192,"context_line":"        cat \u003c\u003c EOF \u003e $tmp_dir/postgresql.sql"}],"source_content_type":"text/x-sh","patch_set":1,"id":"3afe3a84_3ef9355e","line":189,"in_reply_to":"e80aaa0c_d1b1d1d0","updated":"2022-03-01 15:50:47.000000000","message":"DATABASE_USER is being created as part of script $tmp_dir/mysql.sql, MYSQL_USER which is root i thing get\u0027s created with mysql installation itself.","commit_id":"7e66ab97a7aa074196b5d28a3c1c7b0a017b4ab2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"18d828dd88d7594b5c8e404c5d7a96d13a8c4d65","unresolved":true,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        # User/group postgres needs to be given access to tmp_dir"},{"line_number":199,"context_line":"        setfacl -m g:postgres:rwx $tmp_dir"},{"line_number":200,"context_line":"        sudo -u root sudo -u postgres /usr/bin/psql --file\u003d$tmp_dir/postgresql.sql"},{"line_number":201,"context_line":"    fi"},{"line_number":202,"context_line":"}"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"e91ee744_4037abdb","line":200,"range":{"start_line":200,"start_character":16,"end_line":200,"end_character":28},"updated":"2022-03-01 15:55:57.000000000","message":"Why this?","commit_id":"28df8470f6a2838878bc567716889ee938fccfd6"},{"author":{"_account_id":13861,"name":"yatin","email":"ykarel@redhat.com","username":"yatinkarel"},"change_message_id":"7aadf196bef169c1d39b55e019eda5f01582a042","unresolved":true,"context_lines":[{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        # User/group postgres needs to be given access to tmp_dir"},{"line_number":199,"context_line":"        setfacl -m g:postgres:rwx $tmp_dir"},{"line_number":200,"context_line":"        sudo -u root sudo -u postgres /usr/bin/psql --file\u003d$tmp_dir/postgresql.sql"},{"line_number":201,"context_line":"    fi"},{"line_number":202,"context_line":"}"},{"line_number":203,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"a5dd336b_c6d7b120","line":200,"range":{"start_line":200,"start_character":16,"end_line":200,"end_character":28},"in_reply_to":"e91ee744_4037abdb","updated":"2022-03-02 04:55:54.000000000","message":"stack user is allowed to passwordless sudo only for root user so need to switch to it so can use postgres user for psql. Added same in commit message, same is done in devstack:- https://opendev.org/openstack/devstack/src/branch/master/lib/databases/postgresql#L90","commit_id":"28df8470f6a2838878bc567716889ee938fccfd6"}]}
