)]}'
{"kuryr_kubernetes/controller/drivers/vif_pool.py":[{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"89513cee93af9643c4c07e3d43f0d63a6f690938","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        last_update \u003d 0"},{"line_number":220,"context_line":"        pool_updates \u003d self._last_update.get(pool_key)"},{"line_number":221,"context_line":"        if pool_updates:"},{"line_number":222,"context_line":"            last_update \u003d pool_updates.get(security_groups, 0)"},{"line_number":223,"context_line":"            try:"},{"line_number":224,"context_line":"                if (now - oslo_cfg.CONF.vif_pool.ports_pool_update_frequency \u003c"},{"line_number":225,"context_line":"                        last_update):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_84881771","line":222,"range":{"start_line":222,"start_character":12,"end_line":222,"end_character":62},"updated":"2019-10-29 19:02:07.000000000","message":"Isn\u0027t that enough? I assume pool_updates is a dictionary-like object, so it should set last_update to 0 in case the key doesn\u0027t exists.\n\nOr maybe pool_updates[security_groups] might return some other value besides int?","commit_id":"987d0d60f742cf229d58512b13c673704c178fb0"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"a1f3b7bb487c5f23201d6f5080f0d9f01f1736e6","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        last_update \u003d 0"},{"line_number":220,"context_line":"        pool_updates \u003d self._last_update.get(pool_key)"},{"line_number":221,"context_line":"        if pool_updates:"},{"line_number":222,"context_line":"            last_update \u003d pool_updates.get(security_groups, 0)"},{"line_number":223,"context_line":"            try:"},{"line_number":224,"context_line":"                if (now - oslo_cfg.CONF.vif_pool.ports_pool_update_frequency \u003c"},{"line_number":225,"context_line":"                        last_update):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_515c154a","line":222,"range":{"start_line":222,"start_character":12,"end_line":222,"end_character":62},"in_reply_to":"3fa7e38b_3fa2859b","updated":"2019-10-30 09:51:30.000000000","message":"Oh, I see. Thanks for explanation.","commit_id":"987d0d60f742cf229d58512b13c673704c178fb0"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"1910c7d7b91f87b0402a97215b7071b90271b9cc","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        last_update \u003d 0"},{"line_number":220,"context_line":"        pool_updates \u003d self._last_update.get(pool_key)"},{"line_number":221,"context_line":"        if pool_updates:"},{"line_number":222,"context_line":"            last_update \u003d pool_updates.get(security_groups, 0)"},{"line_number":223,"context_line":"            try:"},{"line_number":224,"context_line":"                if (now - oslo_cfg.CONF.vif_pool.ports_pool_update_frequency \u003c"},{"line_number":225,"context_line":"                        last_update):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_3fa2859b","line":222,"range":{"start_line":222,"start_character":12,"end_line":222,"end_character":62},"in_reply_to":"3fa7e38b_84881771","updated":"2019-10-30 08:07:30.000000000","message":"the problem here is if pool_update is empy, i.e., if last_update does not have info for pool_key yet. Then this line is not executed and when executing line 249 (in case of request_vifs failure) last_update is not initialized","commit_id":"987d0d60f742cf229d58512b13c673704c178fb0"},{"author":{"_account_id":14352,"name":"Antoni Segura Puimedon","email":"celebdor@gmail.com","username":"toni"},"change_message_id":"312c6e49218e5587d2482ee1aab9c7faa92d21c8","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                    return"},{"line_number":228,"context_line":"            except AttributeError:"},{"line_number":229,"context_line":"                LOG.info(\"Kuryr-controller not yet ready to populate pools\")"},{"line_number":230,"context_line":"                return"},{"line_number":231,"context_line":"        self._last_update[pool_key] \u003d {security_groups: now}"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        pool_size \u003d self._get_pool_size(pool_key)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_0ad511e6","line":230,"updated":"2019-11-20 08:38:06.000000000","message":"If I read this correctly, the last_update \u003d 0 that you are adding in line 219, is only used in the \"else that could start on line 231. If that is the case, it is much more readable to put it in an else clause. Otherwise it looks like we were going to use it in the \"if\" indent.","commit_id":"d7d8e9ff8bf34ed415a94ed76a6180ceff197f55"}]}
