)]}'
{"lib/tempest":[{"author":{"_account_id":13252,"name":"Dr. Jens Harbott","display_name":"Jens Harbott (frickler)","email":"frickler@offenerstapel.de","username":"jrosenboom"},"change_message_id":"9e6d043e11d6bf52926a08e0320388fe11c89386","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"3fa7e38b_73de313d","line":110,"updated":"2019-12-05 06:43:02.000000000","message":"Can we run this with \"python3\" instead of \"python\"? That would also work with Centos8 then, which no longer has python2 and thus no \"python\" binary.\n\nSee also https://review.opendev.org/697382","commit_id":"0649a3015abcc1cedba61fc6c2cd24b2192de00e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"aa27f0ff54254362551cdee27f24f256a7dc232d","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":2,"id":"3fa7e38b_ce8bbe14","line":110,"in_reply_to":"3fa7e38b_73de313d","updated":"2019-12-05 10:05:22.000000000","message":"Sure, lemme change it...","commit_id":"0649a3015abcc1cedba61fc6c2cd24b2192de00e"},{"author":{"_account_id":11952,"name":"Flavio Fernandes","email":"flavio@flaviof.com","username":"ffernand"},"change_message_id":"22494225772e0dab47ff81230efea26790d06492","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_6e572a29","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"updated":"2019-12-05 09:56:15.000000000","message":"nit and probably not important:\nuse  python${PYTHON3_VERSION}\ninstead of python3  ?","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"},{"author":{"_account_id":27329,"name":"Federico Ressi","email":"fressi@redhat.com","username":"fressi_redhat"},"change_message_id":"5c2d535ff4fb93057fbf8538da23ca70684fce4e","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_8a125660","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"in_reply_to":"3fa7e38b_11924b4c","updated":"2019-12-10 09:05:01.000000000","message":"python command is easier to find than python3. I am pretty sure you can write an implementation of this command working with any python version working on any existing unix. For example:\n\n python -c \u0027import sys; print(int(sys.argv[1]) \u003e\u003e 30)\u0027 \"${size}\"\n\nint(sys.argv[1]) translate the first arguments to integer. Integers in python are at least 64bit so are pretty fine for storing gigabytes values.\n\nvalue \u003e\u003e 30 is a binary shift of 30 bits, that means dividing an integer by 1GB. Size units (by 1024 instead of by 1000) have actually been created to be processed by cpus CPUs build with few thousands of transistors. ;-)","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"8bd0ccfca4919f3cd87e7abaa6ecec73f5a3e8b4","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_68f63bdb","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"in_reply_to":"3fa7e38b_345ae01d","updated":"2019-12-05 14:43:32.000000000","message":"If Jens thinks python3 is fine it\u0027s good with me, we originally saw python${PYTHON3_VERSION} in inc/python but it is in the code installing python itself.","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"},{"author":{"_account_id":13252,"name":"Dr. Jens Harbott","display_name":"Jens Harbott (frickler)","email":"frickler@offenerstapel.de","username":"jrosenboom"},"change_message_id":"418c7fa28928237fb8a1414c290377ebf06f5d7d","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_11924b4c","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"in_reply_to":"3fa7e38b_68f63bdb","updated":"2019-12-05 19:30:45.000000000","message":"In other locations where devstack-installed code is to be executed, it matters whether we installed stuff under e.g. py36 or py37 and we need to be specific about using the matching python executable, but in this case here, any python3 should work fine, so KISS rules. ;)","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"aa27f0ff54254362551cdee27f24f256a7dc232d","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_345ae01d","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"in_reply_to":"3fa7e38b_6e572a29","updated":"2019-12-05 10:05:22.000000000","message":"Good point. I\u0027m mostly following Jens\u0027 recommendation to just use \"python3\" per: https://review.opendev.org/#/c/697382/2/lib/tempest","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"f5abeb19af02f046b7a0af479cca4f646542d791","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_e579bbc5","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"in_reply_to":"3fa7e38b_8a125660","updated":"2019-12-10 09:47:18.000000000","message":"Thanks for the suggestions Federico.\n\nThe current implementation already works with both python versions (just drop the \"3\" from the python command, it was my original proposal).\n\nThat said, I find the bit shift a bit too black magic-ish for such a simple task (tho I like the GiB vs GB thing).\n\nI will leave for other reviewers to decide. I just want to get this fixed cause it can currently break some local devstack deployments.","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"},{"author":{"_account_id":27329,"name":"Federico Ressi","email":"fressi@redhat.com","username":"fressi_redhat"},"change_message_id":"a5c85ff41d751a794a3669fd4dedca7b9ca74884","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_8f4d489a","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"in_reply_to":"3fa7e38b_c09d8dbb","updated":"2019-12-13 15:24:14.000000000","message":"If you prefer division over shift (readability is a subjective question, it depends on what you are used to) you can then use below expression instead:\n\n python -c \u0027import sys; print(int(sys.argv[1]) / (1024 * 1024 * 1024))\u0027 \"${size}\"\n\nThe original implementation you are changing here it haves any right math basis and I wonder from where taken from. Division between integer will give an integer value so there absolutely no need to convert anything to floating points and call any rounding function. ;-)","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"da2fd2b7a982b0897a0dc338c62df7ad3477eeb6","unresolved":false,"context_lines":[{"line_number":107,"context_line":"function image_size_in_gib {"},{"line_number":108,"context_line":"    local size"},{"line_number":109,"context_line":"    size\u003d$(openstack image show $1 -c size -f value)"},{"line_number":110,"context_line":"    echo $size | python3 -c \"import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))\""},{"line_number":111,"context_line":"}"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"# configure_tempest() - Set config files, create data dirs, etc"}],"source_content_type":"application/x-shellscript","patch_set":3,"id":"3fa7e38b_c09d8dbb","line":110,"range":{"start_line":110,"start_character":17,"end_line":110,"end_character":24},"in_reply_to":"3fa7e38b_e579bbc5","updated":"2019-12-10 09:58:51.000000000","message":"+1 to Lucas\u0027 comment. Performing a division by shifting bits here doesn\u0027t while invoking the python interpreter doesn\u0027t seem to be a performance vs readability win.","commit_id":"40f7579bb8ebd8082dc5f55785c0ae4644b062ec"}]}
