)]}'
{"kuryr_kubernetes/controller/drivers/lbaasv2.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"40ec25e28d189329909f00ed4609c72c07c49426","unresolved":true,"context_lines":[{"line_number":783,"context_line":"        return result"},{"line_number":784,"context_line":""},{"line_number":785,"context_line":"    def _ensure_loadbalancer(self, loadbalancer):"},{"line_number":786,"context_line":"        result \u003d self._find_loadbalancer(loadbalancer)"},{"line_number":787,"context_line":"        if result:"},{"line_number":788,"context_line":"            LOG.debug(\"Found %(obj)s\", {\u0027obj\u0027: result})"},{"line_number":789,"context_line":""},{"line_number":790,"context_line":"        try:"},{"line_number":791,"context_line":"            result \u003d self._create_loadbalancer(loadbalancer)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3026a19b_319d89cc","line":788,"range":{"start_line":786,"start_character":0,"end_line":788,"end_character":55},"updated":"2021-09-24 06:14:33.000000000","message":"there was a reason to have the create + find, instead of find + create. Also if moved this way you should have a return on the if result block","commit_id":"6e222cf0652cd8f9fe6c6c438fd5b9b4641fc762"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"c096317c7c222c09d0ecc3c5333a1c14c024eb0e","unresolved":true,"context_lines":[{"line_number":783,"context_line":"        return result"},{"line_number":784,"context_line":""},{"line_number":785,"context_line":"    def _ensure_loadbalancer(self, loadbalancer):"},{"line_number":786,"context_line":"        result \u003d self._find_loadbalancer(loadbalancer)"},{"line_number":787,"context_line":"        if result:"},{"line_number":788,"context_line":"            LOG.debug(\"Found %(obj)s\", {\u0027obj\u0027: result})"},{"line_number":789,"context_line":""},{"line_number":790,"context_line":"        try:"},{"line_number":791,"context_line":"            result \u003d self._create_loadbalancer(loadbalancer)"}],"source_content_type":"text/x-python","patch_set":1,"id":"f0548e06_05363fdc","line":788,"range":{"start_line":786,"start_character":0,"end_line":788,"end_character":55},"in_reply_to":"3026a19b_319d89cc","updated":"2021-09-24 10:50:52.000000000","message":"I agree that we should have a return here.\nAnd as Luis pointed out on the chat, this is the reason for creation before find: https://review.opendev.org/c/openstack/kuryr-kubernetes/+/580659/1/kuryr_kubernetes/controller/drivers/lbaasv2.py. Personally, I\u0027m fine with how it\u0027s.","commit_id":"6e222cf0652cd8f9fe6c6c438fd5b9b4641fc762"},{"author":{"_account_id":19521,"name":"Robin Cernin","email":"rcernin@redhat.com","username":"rcernin"},"change_message_id":"af36ad5b86a7309de5be86436d66f4a3eb7d8700","unresolved":false,"context_lines":[{"line_number":783,"context_line":"        return result"},{"line_number":784,"context_line":""},{"line_number":785,"context_line":"    def _ensure_loadbalancer(self, loadbalancer):"},{"line_number":786,"context_line":"        result \u003d self._find_loadbalancer(loadbalancer)"},{"line_number":787,"context_line":"        if result:"},{"line_number":788,"context_line":"            LOG.debug(\"Found %(obj)s\", {\u0027obj\u0027: result})"},{"line_number":789,"context_line":""},{"line_number":790,"context_line":"        try:"},{"line_number":791,"context_line":"            result \u003d self._create_loadbalancer(loadbalancer)"}],"source_content_type":"text/x-python","patch_set":1,"id":"b40dd9d1_671dfb36","line":788,"range":{"start_line":786,"start_character":0,"end_line":788,"end_character":55},"in_reply_to":"f0548e06_05363fdc","updated":"2021-09-24 21:07:10.000000000","message":"Done","commit_id":"6e222cf0652cd8f9fe6c6c438fd5b9b4641fc762"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"f2b53db2d41852c92955a9a2b0b38ed8b33da29e","unresolved":true,"context_lines":[{"line_number":488,"context_line":"                                              self._create_member,"},{"line_number":489,"context_line":"                                              self._find_member,"},{"line_number":490,"context_line":"                                              update\u003dlbaas.update_member)"},{"line_number":491,"context_line":"        except os_exc.HttpException as e:"},{"line_number":492,"context_line":"            if e.response.status_code \u003d\u003d 404:"},{"line_number":493,"context_line":"                # Either LB or pool doesn\u0027t exist."},{"line_number":494,"context_line":"                LOG.warning(\"Loadbalancer %s or pool %s created for \""},{"line_number":495,"context_line":"                            \"Service %s doesn\u0027t exist. Attempting to recreate \""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a7e72e0_696096ed","line":492,"range":{"start_line":491,"start_character":8,"end_line":492,"end_character":45},"updated":"2021-09-24 10:53:55.000000000","message":"Also, I wonder if we could use NotFound exception from Octavia https://github.com/openstack/octavia/blob/master/octavia/common/exceptions.py#L72","commit_id":"2bff2a5641e92943acf980871308e1d9a1a29377"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":439,"context_line":"                                     self._create_pool,"},{"line_number":440,"context_line":"                                     self._find_pool)"},{"line_number":441,"context_line":"        except os_exc.ResourceNotFound as e:"},{"line_number":442,"context_line":"            if e.response.status_code \u003d\u003d 404:"},{"line_number":443,"context_line":"                # Either LB or listener doesn\u0027t exist."},{"line_number":444,"context_line":"                LOG.warning(\"Loadbalancer %s or listener %s created for \""},{"line_number":445,"context_line":"                            \"Service %s doesn\u0027t exist. Attempting to recreate \""}],"source_content_type":"text/x-python","patch_set":4,"id":"0d895155_322250a9","line":442,"range":{"start_line":442,"start_character":12,"end_line":442,"end_character":45},"updated":"2021-10-07 12:02:24.000000000","message":"I don\u0027t think we need to check for 404 if it\u0027s ResourceNotFound.","commit_id":"a26a43f7d4399a289ee41dab78fd98be10951d58"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":489,"context_line":"                                              self._find_member,"},{"line_number":490,"context_line":"                                              update\u003dlbaas.update_member)"},{"line_number":491,"context_line":"        except os_exc.ResourceNotFound as e:"},{"line_number":492,"context_line":"            if e.response.status_code \u003d\u003d 404:"},{"line_number":493,"context_line":"                # Either LB or pool doesn\u0027t exist."},{"line_number":494,"context_line":"                LOG.warning(\"Loadbalancer %s or pool %s created for \""},{"line_number":495,"context_line":"                            \"Service %s doesn\u0027t exist. Attempting to recreate \""}],"source_content_type":"text/x-python","patch_set":4,"id":"3ff68361_6d044d53","line":492,"range":{"start_line":492,"start_character":0,"end_line":492,"end_character":45},"updated":"2021-10-07 12:02:24.000000000","message":"Same.","commit_id":"a26a43f7d4399a289ee41dab78fd98be10951d58"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":783,"context_line":"        return result"},{"line_number":784,"context_line":""},{"line_number":785,"context_line":"    def _ensure_loadbalancer(self, loadbalancer):"},{"line_number":786,"context_line":"        result \u003d self._find_loadbalancer(loadbalancer)"},{"line_number":787,"context_line":"        if result:"},{"line_number":788,"context_line":"            LOG.debug(\"Found %(obj)s\", {\u0027obj\u0027: result})"},{"line_number":789,"context_line":"            return result"},{"line_number":790,"context_line":""},{"line_number":791,"context_line":"        try:"},{"line_number":792,"context_line":"            result \u003d self._create_loadbalancer(loadbalancer)"}],"source_content_type":"text/x-python","patch_set":4,"id":"438ea0b6_202614ba","line":789,"range":{"start_line":786,"start_character":0,"end_line":789,"end_character":25},"updated":"2021-10-07 12:02:24.000000000","message":"Yep, we\u0027re moving this because we discovered that Octavia will not always raise Conflict if you create an LB with the same IP. If no VIP port got created for an LB, then Octavia will not have any issue with creating another LB with the same IP.","commit_id":"a26a43f7d4399a289ee41dab78fd98be10951d58"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":792,"context_line":"            result \u003d self._create_loadbalancer(loadbalancer)"},{"line_number":793,"context_line":"            LOG.debug(\"Created %(obj)s\", {\u0027obj\u0027: result})"},{"line_number":794,"context_line":"            return result"},{"line_number":795,"context_line":"        except os_exc.HttpException as e:"},{"line_number":796,"context_line":"            if e.status_code not in OKAY_CODES:"},{"line_number":797,"context_line":"                raise"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"        return result"},{"line_number":800,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ae49f978_a7901a03","line":797,"range":{"start_line":795,"start_character":0,"end_line":797,"end_character":21},"updated":"2021-10-07 12:02:24.000000000","message":"This probably doesn\u0027t have sense anymore as we search for an LB first.","commit_id":"a26a43f7d4399a289ee41dab78fd98be10951d58"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":813,"context_line":"            except os_exc.BadRequestException:"},{"line_number":814,"context_line":"                raise"},{"line_number":815,"context_line":"            except os_exc.HttpException as e:"},{"line_number":816,"context_line":"                if e.response.status_code \u003d\u003d 404:"},{"line_number":817,"context_line":"                    # The LB must be gone."},{"line_number":818,"context_line":"                    LOG.warning("},{"line_number":819,"context_line":"                        \"Loadbalancer %s for Service %s doesn\u0027t exist, \""}],"source_content_type":"text/x-python","patch_set":4,"id":"bd562ccd_04526f4e","line":816,"range":{"start_line":816,"start_character":16,"end_line":816,"end_character":49},"updated":"2021-10-07 12:02:24.000000000","message":"Could we move that to a separate \"except\" clause where we catch ResourceNotFound?","commit_id":"a26a43f7d4399a289ee41dab78fd98be10951d58"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":904,"context_line":"                                \u0027Octavia, retrying!\u0027, loadbalancer[\u0027id\u0027])"},{"line_number":905,"context_line":"                    lbaas.delete_load_balancer(loadbalancer[\u0027id\u0027],"},{"line_number":906,"context_line":"                                               cascade\u003dTrue)"},{"line_number":907,"context_line":"            except (os_exc.ResourceNotFound, os_exc.NotFoundException):"},{"line_number":908,"context_line":"                return"},{"line_number":909,"context_line":""},{"line_number":910,"context_line":"    def _provisioning_timer(self, timeout,"}],"source_content_type":"text/x-python","patch_set":4,"id":"e39dac24_82c44c39","line":907,"range":{"start_line":907,"start_character":18,"end_line":907,"end_character":70},"updated":"2021-10-07 12:02:24.000000000","message":"With more recent openstacksdk versions those two exceptions are the same. Just use ResourceNotFound.","commit_id":"a26a43f7d4399a289ee41dab78fd98be10951d58"}],"kuryr_kubernetes/utils.py":[{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"40ec25e28d189329909f00ed4609c72c07c49426","unresolved":true,"context_lines":[{"line_number":476,"context_line":"        LOG.debug(\"Removing LBaaSState annotation: %r\", lbaas_state)"},{"line_number":477,"context_line":"        annotations \u003d {"},{"line_number":478,"context_line":"            constants.K8S_ANNOTATION_LBAAS_STATE: None,"},{"line_number":479,"context_line":"            constants.K8S_ANNOTATION_LBAAS_TRIGGER: uuid.uuid4()"},{"line_number":480,"context_line":"        }"},{"line_number":481,"context_line":"    else:"},{"line_number":482,"context_line":"        lbaas_state.obj_reset_changes(recursive\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"b2287ea2_abda43d3","line":479,"range":{"start_line":479,"start_character":0,"end_line":479,"end_character":64},"updated":"2021-09-24 06:14:33.000000000","message":"what is this used for? We moved away from annotations in favor of CRDs","commit_id":"6e222cf0652cd8f9fe6c6c438fd5b9b4641fc762"},{"author":{"_account_id":19521,"name":"Robin Cernin","email":"rcernin@redhat.com","username":"rcernin"},"change_message_id":"af36ad5b86a7309de5be86436d66f4a3eb7d8700","unresolved":false,"context_lines":[{"line_number":476,"context_line":"        LOG.debug(\"Removing LBaaSState annotation: %r\", lbaas_state)"},{"line_number":477,"context_line":"        annotations \u003d {"},{"line_number":478,"context_line":"            constants.K8S_ANNOTATION_LBAAS_STATE: None,"},{"line_number":479,"context_line":"            constants.K8S_ANNOTATION_LBAAS_TRIGGER: uuid.uuid4()"},{"line_number":480,"context_line":"        }"},{"line_number":481,"context_line":"    else:"},{"line_number":482,"context_line":"        lbaas_state.obj_reset_changes(recursive\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"13293f26_c98d7ce6","line":479,"range":{"start_line":479,"start_character":0,"end_line":479,"end_character":64},"in_reply_to":"3a643129_12f89dfd","updated":"2021-09-24 21:07:10.000000000","message":"Found other unused function. Removing those with next iteration of the patch too.","commit_id":"6e222cf0652cd8f9fe6c6c438fd5b9b4641fc762"},{"author":{"_account_id":27032,"name":"Maysa de Macedo Souza","email":"maysa.macedo95@gmail.com","username":"maysa"},"change_message_id":"c096317c7c222c09d0ecc3c5333a1c14c024eb0e","unresolved":true,"context_lines":[{"line_number":476,"context_line":"        LOG.debug(\"Removing LBaaSState annotation: %r\", lbaas_state)"},{"line_number":477,"context_line":"        annotations \u003d {"},{"line_number":478,"context_line":"            constants.K8S_ANNOTATION_LBAAS_STATE: None,"},{"line_number":479,"context_line":"            constants.K8S_ANNOTATION_LBAAS_TRIGGER: uuid.uuid4()"},{"line_number":480,"context_line":"        }"},{"line_number":481,"context_line":"    else:"},{"line_number":482,"context_line":"        lbaas_state.obj_reset_changes(recursive\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a643129_12f89dfd","line":479,"range":{"start_line":479,"start_character":0,"end_line":479,"end_character":64},"in_reply_to":"b2287ea2_abda43d3","updated":"2021-09-24 10:50:52.000000000","message":"this function is not really being used anywhere and can be removed\nhttps://github.com/openstack/kuryr-kubernetes/search?q\u003dset_lbaas_state","commit_id":"6e222cf0652cd8f9fe6c6c438fd5b9b4641fc762"},{"author":{"_account_id":23567,"name":"Luis Tomas Bolivar","email":"ltomasbo@redhat.com","username":"ltomasbo"},"change_message_id":"40ec25e28d189329909f00ed4609c72c07c49426","unresolved":true,"context_lines":[{"line_number":486,"context_line":"                jsonutils.dumps(lbaas_state.obj_to_primitive(),"},{"line_number":487,"context_line":"                                sort_keys\u003dTrue)}"},{"line_number":488,"context_line":"    k8s \u003d clients.get_kubernetes_client()"},{"line_number":489,"context_line":"    k8s.annotate(endpoints[\u0027metadata\u0027][\u0027selfLink\u0027], annotations,"},{"line_number":490,"context_line":"                 resource_version\u003dendpoints[\u0027metadata\u0027][\u0027resourceVersion\u0027])"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"8863a25e_dcc329e9","line":489,"range":{"start_line":489,"start_character":16,"end_line":489,"end_character":51},"updated":"2021-09-24 06:14:33.000000000","message":"we should use the get_res_link function instead","commit_id":"6e222cf0652cd8f9fe6c6c438fd5b9b4641fc762"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":447,"context_line":"        raise"},{"line_number":448,"context_line":"    try:"},{"line_number":449,"context_line":"        k8s.annotate(svc_link,"},{"line_number":450,"context_line":"                     {constants.K8S_ANNOTATION_LBAAS_SPEC: annotation},"},{"line_number":451,"context_line":"                     resource_version\u003dservice[\u0027metadata\u0027][\u0027resourceVersion\u0027])"},{"line_number":452,"context_line":"    except exceptions.K8sResourceNotFound as ex:"},{"line_number":453,"context_line":"        LOG.debug(\"Failed to annotate svc: %s\", ex)"}],"source_content_type":"text/x-python","patch_set":4,"id":"2aa7b670_52749aa8","side":"PARENT","line":450,"range":{"start_line":450,"start_character":32,"end_line":450,"end_character":57},"updated":"2021-10-07 12:02:24.000000000","message":"You can remove this constants too.","commit_id":"deb055190f1c4d337534124a49935916511a9ab1"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"54451a9faafbf5d2797ba3bca2574b73cba06e8d","unresolved":true,"context_lines":[{"line_number":460,"context_line":"def get_lbaas_state(endpoint):"},{"line_number":461,"context_line":"    try:"},{"line_number":462,"context_line":"        annotations \u003d endpoint[\u0027metadata\u0027][\u0027annotations\u0027]"},{"line_number":463,"context_line":"        annotation \u003d annotations[constants.K8S_ANNOTATION_LBAAS_STATE]"},{"line_number":464,"context_line":"    except KeyError:"},{"line_number":465,"context_line":"        return None"},{"line_number":466,"context_line":"    obj_dict \u003d jsonutils.loads(annotation)"}],"source_content_type":"text/x-python","patch_set":4,"id":"d42dce7c_57d2a39e","side":"PARENT","line":463,"range":{"start_line":463,"start_character":43,"end_line":463,"end_character":69},"updated":"2021-10-07 12:02:24.000000000","message":"Same here.","commit_id":"deb055190f1c4d337534124a49935916511a9ab1"}]}
