)]}'
{"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"da600c1dc1aadfc323e0af41c2ae21e88f266229","unresolved":false,"context_lines":[{"line_number":221,"context_line":"    def ensure_no_tenant_ports_on_network(self, network_id, net_tenant_id,"},{"line_number":222,"context_line":"                                          tenant_id):"},{"line_number":223,"context_line":"        ctx_admin \u003d ctx.get_admin_context()"},{"line_number":224,"context_line":"        other_rbac_objs \u003d rbac_obj.NetworkPolicyRBAC.get_objects("},{"line_number":225,"context_line":"            ctx_admin, object_id\u003dnetwork_id, action\u003d\u0027access_as_shared\u0027)"},{"line_number":226,"context_line":"        ports \u003d model_query.query_with_hooks(ctx_admin, models_v2.Port).filter("},{"line_number":227,"context_line":"            models_v2.Port.network_id \u003d\u003d network_id)"},{"line_number":228,"context_line":"        if tenant_id \u003d\u003d \u0027*\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_5edee96a","line":225,"range":{"start_line":224,"start_character":0,"end_line":225,"end_character":71},"updated":"2018-10-05 21:33:44.000000000","message":"It looks we can move this down to line #229 so that it won\u0027t perform an extra db access if tenant_id is not \u0027*\u0027.","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"22682f19cfab6beaecf2dc4a9563623a2d42a2a5","unresolved":false,"context_lines":[{"line_number":221,"context_line":"    def ensure_no_tenant_ports_on_network(self, network_id, net_tenant_id,"},{"line_number":222,"context_line":"                                          tenant_id):"},{"line_number":223,"context_line":"        ctx_admin \u003d ctx.get_admin_context()"},{"line_number":224,"context_line":"        other_rbac_objs \u003d rbac_obj.NetworkPolicyRBAC.get_objects("},{"line_number":225,"context_line":"            ctx_admin, object_id\u003dnetwork_id, action\u003d\u0027access_as_shared\u0027)"},{"line_number":226,"context_line":"        ports \u003d model_query.query_with_hooks(ctx_admin, models_v2.Port).filter("},{"line_number":227,"context_line":"            models_v2.Port.network_id \u003d\u003d network_id)"},{"line_number":228,"context_line":"        if tenant_id \u003d\u003d \u0027*\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_1e9fff02","line":225,"range":{"start_line":224,"start_character":0,"end_line":225,"end_character":71},"in_reply_to":"3f79a3b5_5edee96a","updated":"2018-10-08 08:43:13.000000000","message":"Hmmm, you are right!","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"da600c1dc1aadfc323e0af41c2ae21e88f266229","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        else:"},{"line_number":240,"context_line":"            # if there is a wildcard rule, we can return early because it"},{"line_number":241,"context_line":"            # allows any ports"},{"line_number":242,"context_line":"            other_rbac_objs \u003d rbac_obj.NetworkPolicyRBAC.get_objects("},{"line_number":243,"context_line":"                ctx_admin, object_id\u003dnetwork_id, action\u003d\u0027access_as_shared\u0027,"},{"line_number":244,"context_line":"                target_tenant\u003d\u0027*\u0027)"},{"line_number":245,"context_line":"            if other_rbac_objs:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_9edec13a","line":242,"range":{"start_line":242,"start_character":57,"end_line":242,"end_character":68},"updated":"2018-10-05 21:33:44.000000000","message":"If what we need is to get the count of the db records. There is a \u0027count\u0027 method defined in OVO for this: https://github.com/openstack/neutron/blob/master/neutron/objects/db/api.py#L36","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"22682f19cfab6beaecf2dc4a9563623a2d42a2a5","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        else:"},{"line_number":240,"context_line":"            # if there is a wildcard rule, we can return early because it"},{"line_number":241,"context_line":"            # allows any ports"},{"line_number":242,"context_line":"            other_rbac_objs \u003d rbac_obj.NetworkPolicyRBAC.get_objects("},{"line_number":243,"context_line":"                ctx_admin, object_id\u003dnetwork_id, action\u003d\u0027access_as_shared\u0027,"},{"line_number":244,"context_line":"                target_tenant\u003d\u0027*\u0027)"},{"line_number":245,"context_line":"            if other_rbac_objs:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_3eb99b7b","line":242,"range":{"start_line":242,"start_character":57,"end_line":242,"end_character":68},"in_reply_to":"3f79a3b5_9edec13a","updated":"2018-10-08 08:43:13.000000000","message":"Actually, here I can use get_object, that is faster.","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"9f04aca8fef401814b9fd1015174b8b2dc473033","unresolved":false,"context_lines":[{"line_number":397,"context_line":"                    \u0027description\u0027: n.get(\u0027description\u0027)}"},{"line_number":398,"context_line":"            network \u003d models_v2.Network(**args)"},{"line_number":399,"context_line":"            context.session.add(network)"},{"line_number":400,"context_line":"            if n[\u0027shared\u0027]:"},{"line_number":401,"context_line":"                np_rbac_args \u003d {\u0027project_id\u0027: network.project_id,"},{"line_number":402,"context_line":"                                \u0027object_id\u0027: network.id,"},{"line_number":403,"context_line":"                                \u0027action\u0027: \u0027access_as_shared\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e1ff1864","line":400,"range":{"start_line":400,"start_character":18,"end_line":400,"end_character":24},"updated":"2018-10-05 22:55:28.000000000","message":"I am not sure if we should manually load \u0027shared\u0027 like this because after network is converted to OVO, the attribute \u0027shared\u0027 seems to be automatically loaded by: https://github.com/openstack/neutron/blob/3e579256a36e66960495da2f303b5a6e37f644a6/neutron/objects/rbac_db.py#L256","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"22682f19cfab6beaecf2dc4a9563623a2d42a2a5","unresolved":false,"context_lines":[{"line_number":397,"context_line":"                    \u0027description\u0027: n.get(\u0027description\u0027)}"},{"line_number":398,"context_line":"            network \u003d models_v2.Network(**args)"},{"line_number":399,"context_line":"            context.session.add(network)"},{"line_number":400,"context_line":"            if n[\u0027shared\u0027]:"},{"line_number":401,"context_line":"                np_rbac_args \u003d {\u0027project_id\u0027: network.project_id,"},{"line_number":402,"context_line":"                                \u0027object_id\u0027: network.id,"},{"line_number":403,"context_line":"                                \u0027action\u0027: \u0027access_as_shared\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_de574727","line":400,"range":{"start_line":400,"start_character":18,"end_line":400,"end_character":24},"in_reply_to":"3f79a3b5_e1ff1864","updated":"2018-10-08 08:43:13.000000000","message":"This parameter is provided by the user, in the input parameters, when creating the network (--share, --no-share), not retrieved from the object.\n\nWhen a network is created, no other objects (subnets, ports) are attached.\n\nNOTE: I moved the creation of the policy after the creation of the network (L399) in order to have a valid net_id in the DB.","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"da600c1dc1aadfc323e0af41c2ae21e88f266229","unresolved":false,"context_lines":[{"line_number":415,"context_line":"            # validate \u0027shared\u0027 parameter"},{"line_number":416,"context_line":"            if \u0027shared\u0027 in n:"},{"line_number":417,"context_line":"                entry \u003d None"},{"line_number":418,"context_line":"                for item in network.rbac_entries:"},{"line_number":419,"context_line":"                    if (item.action \u003d\u003d \u0027access_as_shared\u0027 and"},{"line_number":420,"context_line":"                            item.target_tenant \u003d\u003d \u0027*\u0027):"},{"line_number":421,"context_line":"                        entry \u003d item"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_de34394c","line":418,"range":{"start_line":418,"start_character":28,"end_line":418,"end_character":48},"updated":"2018-10-05 21:33:44.000000000","message":"Should this be converted to OVO as well?","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"22682f19cfab6beaecf2dc4a9563623a2d42a2a5","unresolved":false,"context_lines":[{"line_number":415,"context_line":"            # validate \u0027shared\u0027 parameter"},{"line_number":416,"context_line":"            if \u0027shared\u0027 in n:"},{"line_number":417,"context_line":"                entry \u003d None"},{"line_number":418,"context_line":"                for item in network.rbac_entries:"},{"line_number":419,"context_line":"                    if (item.action \u003d\u003d \u0027access_as_shared\u0027 and"},{"line_number":420,"context_line":"                            item.target_tenant \u003d\u003d \u0027*\u0027):"},{"line_number":421,"context_line":"                        entry \u003d item"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_f99fbdb0","line":418,"range":{"start_line":418,"start_character":28,"end_line":418,"end_character":48},"in_reply_to":"3f79a3b5_de34394c","updated":"2018-10-08 08:43:13.000000000","message":"Well, this is the RBAC information stored in the Network object when retrieved from the DB [1]. We don\u0027t need to retrieve this information again.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/db/models_v2.py#L264","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"9f04aca8fef401814b9fd1015174b8b2dc473033","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                setattr(network, \u0027shared\u0027, True if entry else False)"},{"line_number":424,"context_line":"                self._validate_shared_update(context, id, network, n)"},{"line_number":425,"context_line":"                update_shared \u003d n.pop(\u0027shared\u0027)"},{"line_number":426,"context_line":"                if update_shared and not entry:"},{"line_number":427,"context_line":"                    np_rbac_args \u003d {\u0027project_id\u0027: network.project_id,"},{"line_number":428,"context_line":"                                    \u0027object_id\u0027: network.id,"},{"line_number":429,"context_line":"                                    \u0027action\u0027: \u0027access_as_shared\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_81398441","line":426,"range":{"start_line":426,"start_character":19,"end_line":426,"end_character":32},"updated":"2018-10-05 22:55:28.000000000","message":"Ditto: I am not sure if we should manually update shared like this because after network is converted to OVO, \u0027shared\u0027 seems to be automatically updated by: https://github.com/openstack/neutron/blob/3e579256a36e66960495da2f303b5a6e37f644a6/neutron/objects/rbac_db.py#L210","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"22682f19cfab6beaecf2dc4a9563623a2d42a2a5","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                setattr(network, \u0027shared\u0027, True if entry else False)"},{"line_number":424,"context_line":"                self._validate_shared_update(context, id, network, n)"},{"line_number":425,"context_line":"                update_shared \u003d n.pop(\u0027shared\u0027)"},{"line_number":426,"context_line":"                if update_shared and not entry:"},{"line_number":427,"context_line":"                    np_rbac_args \u003d {\u0027project_id\u0027: network.project_id,"},{"line_number":428,"context_line":"                                    \u0027object_id\u0027: network.id,"},{"line_number":429,"context_line":"                                    \u0027action\u0027: \u0027access_as_shared\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_393215c2","line":426,"range":{"start_line":426,"start_character":19,"end_line":426,"end_character":32},"in_reply_to":"3f79a3b5_81398441","updated":"2018-10-08 08:43:13.000000000","message":"This parameter come from the user input parameters when updating the Network (L412). \"network\" input parameter is the dict provided by the RPC call.","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"234778aec83e4848ab4af65d878e4829a7b6af7d","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            # see if any allow the remaining ports on the network."},{"line_number":229,"context_line":"            # any port with another RBAC entry covering it or one belonging to"},{"line_number":230,"context_line":"            # the same tenant as the network owner is ok"},{"line_number":231,"context_line":"            other_rbac_objs \u003d network_obj.NetworkRBAC.get_objects("},{"line_number":232,"context_line":"                ctx_admin, object_id\u003dnetwork_id, action\u003d\u0027access_as_shared\u0027)"},{"line_number":233,"context_line":"            allowed_tenants \u003d [rbac[\u0027target_tenant\u0027] for rbac"},{"line_number":234,"context_line":"                               in other_rbac_objs"},{"line_number":235,"context_line":"                               if rbac.target_tenant !\u003d tenant_id]"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_30864667","line":232,"range":{"start_line":231,"start_character":12,"end_line":232,"end_character":75},"updated":"2018-10-11 16:39:48.000000000","message":"if you move this call out of if before @L226, then results can be reused and L242 get_object won\u0027t be need just filterbased on tenant\u003d* on other_rbac_objs.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"59e11ade5095460d034ef5f5b6b3c190de176115","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            # see if any allow the remaining ports on the network."},{"line_number":229,"context_line":"            # any port with another RBAC entry covering it or one belonging to"},{"line_number":230,"context_line":"            # the same tenant as the network owner is ok"},{"line_number":231,"context_line":"            other_rbac_objs \u003d network_obj.NetworkRBAC.get_objects("},{"line_number":232,"context_line":"                ctx_admin, object_id\u003dnetwork_id, action\u003d\u0027access_as_shared\u0027)"},{"line_number":233,"context_line":"            allowed_tenants \u003d [rbac[\u0027target_tenant\u0027] for rbac"},{"line_number":234,"context_line":"                               in other_rbac_objs"},{"line_number":235,"context_line":"                               if rbac.target_tenant !\u003d tenant_id]"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_b01ed671","line":232,"range":{"start_line":231,"start_character":12,"end_line":232,"end_character":75},"in_reply_to":"3f79a3b5_30864667","updated":"2018-10-11 17:04:56.000000000","message":"Only if tenant_id \u003d\u003d \u0027*\u0027 I will need to use \"get_objects\" (what is slower than get_object)\n\nHowever, if tenant_id !\u003d \u0027*\u0027 I use \"get_object\" and this code is faster than getting first the objects and then filtering.\n\nSee https://review.openstack.org/#/c/608198/3/neutron/db/db_base_plugin_v2.py@225","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"4d5881d4c1166081cc385ed93d898f21593d7205","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            # see if any allow the remaining ports on the network."},{"line_number":229,"context_line":"            # any port with another RBAC entry covering it or one belonging to"},{"line_number":230,"context_line":"            # the same tenant as the network owner is ok"},{"line_number":231,"context_line":"            other_rbac_objs \u003d network_obj.NetworkRBAC.get_objects("},{"line_number":232,"context_line":"                ctx_admin, object_id\u003dnetwork_id, action\u003d\u0027access_as_shared\u0027)"},{"line_number":233,"context_line":"            allowed_tenants \u003d [rbac[\u0027target_tenant\u0027] for rbac"},{"line_number":234,"context_line":"                               in other_rbac_objs"},{"line_number":235,"context_line":"                               if rbac.target_tenant !\u003d tenant_id]"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_6b87f35c","line":232,"range":{"start_line":231,"start_character":12,"end_line":232,"end_character":75},"in_reply_to":"3f79a3b5_b01ed671","updated":"2018-10-11 17:12:34.000000000","message":"that\u0027s also fine.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"145dcef37d0051c8f6e7ef2a8ec4a7ffd34b5e08","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        other_rbac_objs \u003d network_obj.NetworkRBAC.get_objects("},{"line_number":290,"context_line":"            ctx_admin, object_id\u003dnetwork.id, action\u003d\u0027access_as_shared\u0027)"},{"line_number":291,"context_line":"        allowed_projects \u003d {rbac[\u0027target_tenant\u0027] for rbac in other_rbac_objs"},{"line_number":292,"context_line":"                            if rbac.target_tenant !\u003d \u0027*\u0027}"},{"line_number":293,"context_line":"        allowed_projects.add(network.project_id)"},{"line_number":294,"context_line":"        if project_ids - allowed_projects:"},{"line_number":295,"context_line":"            raise n_exc.InvalidSharedSetting(network\u003dnetwork.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_f95761c8","line":292,"updated":"2018-10-11 13:49:37.000000000","message":"It seems to me that L289-292 are pretty much the same as L231\u003d235.  You could pull them out to a function that you pass the thing you\u0027re going to compare rbac.target_tenant to, and you get out the list of allowed projects.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2c793a0a33ff346c184ff018fd8b536fd91a589b","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        other_rbac_objs \u003d network_obj.NetworkRBAC.get_objects("},{"line_number":290,"context_line":"            ctx_admin, object_id\u003dnetwork.id, action\u003d\u0027access_as_shared\u0027)"},{"line_number":291,"context_line":"        allowed_projects \u003d {rbac[\u0027target_tenant\u0027] for rbac in other_rbac_objs"},{"line_number":292,"context_line":"                            if rbac.target_tenant !\u003d \u0027*\u0027}"},{"line_number":293,"context_line":"        allowed_projects.add(network.project_id)"},{"line_number":294,"context_line":"        if project_ids - allowed_projects:"},{"line_number":295,"context_line":"            raise n_exc.InvalidSharedSetting(network\u003dnetwork.name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_399719ee","line":292,"in_reply_to":"3f79a3b5_f95761c8","updated":"2018-10-11 14:01:42.000000000","message":"Kind of, the result in both cases if filtered by the target_tenant. But in one case we are returning a set and in the other we need a list. We can make a function for both cases, but then we need to reconvert the result to set or list. IMO, this is an unneeded overhead.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"234778aec83e4848ab4af65d878e4829a7b6af7d","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC(context,"},{"line_number":430,"context_line":"                                                          **np_rbac_args)"},{"line_number":431,"context_line":"                    np_rbac_obj.create()"},{"line_number":432,"context_line":"                elif not update_shared and entry:"},{"line_number":433,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC.get_object("},{"line_number":434,"context_line":"                        context, object_id\u003dnetwork.id,"},{"line_number":435,"context_line":"                        action\u003d\u0027access_as_shared\u0027, target_tenant\u003d\u0027*\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_90e39a06","line":432,"range":{"start_line":432,"start_character":42,"end_line":432,"end_character":48},"updated":"2018-10-11 16:39:48.000000000","message":"this is not needed, its always going to be None with new code.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"4d5881d4c1166081cc385ed93d898f21593d7205","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC(context,"},{"line_number":430,"context_line":"                                                          **np_rbac_args)"},{"line_number":431,"context_line":"                    np_rbac_obj.create()"},{"line_number":432,"context_line":"                elif not update_shared and entry:"},{"line_number":433,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC.get_object("},{"line_number":434,"context_line":"                        context, object_id\u003dnetwork.id,"},{"line_number":435,"context_line":"                        action\u003d\u0027access_as_shared\u0027, target_tenant\u003d\u0027*\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_2b9d7bba","line":432,"range":{"start_line":432,"start_character":42,"end_line":432,"end_character":48},"in_reply_to":"3f79a3b5_6b129357","updated":"2018-10-11 17:12:34.000000000","message":"sorry I missed L419, since it was used at L431 before within if update_shared and not entry: so, I thought its never reset. but looking at L419 I think it can stay here.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"59e11ade5095460d034ef5f5b6b3c190de176115","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC(context,"},{"line_number":430,"context_line":"                                                          **np_rbac_args)"},{"line_number":431,"context_line":"                    np_rbac_obj.create()"},{"line_number":432,"context_line":"                elif not update_shared and entry:"},{"line_number":433,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC.get_object("},{"line_number":434,"context_line":"                        context, object_id\u003dnetwork.id,"},{"line_number":435,"context_line":"                        action\u003d\u0027access_as_shared\u0027, target_tenant\u003d\u0027*\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_6b129357","line":432,"range":{"start_line":432,"start_character":42,"end_line":432,"end_character":48},"in_reply_to":"3f79a3b5_90e39a06","updated":"2018-10-11 17:04:56.000000000","message":"Why? I don\u0027t understand your point here.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":28581,"name":"Lujin Luo","email":"lujinluo@gmail.com","username":"lujin"},"change_message_id":"581a024f8c61350beeaafa485470675175faf35e","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                        context, object_id\u003dnetwork.id,"},{"line_number":435,"context_line":"                        action\u003d\u0027access_as_shared\u0027, target_tenant\u003d\u0027*\u0027)"},{"line_number":436,"context_line":"                    if np_rbac_obj:"},{"line_number":437,"context_line":"                        np_rbac_obj.delete()"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"                # TODO(ihrachys) Below can be removed when we make sqlalchemy"},{"line_number":440,"context_line":"                # event listeners in neutron/db/api.py to refresh expired"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_9b725d18","line":437,"range":{"start_line":437,"start_character":24,"end_line":437,"end_character":44},"updated":"2018-10-17 22:35:00.000000000","message":"I have a question here. will the corresponding rbac_entry in network, i.e. network.rbac_entry(entry) be removed here as well? I mean, I understand that it is removed in db, but I am just concerning if network db object would be carrying the not-updated rbac objects.","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"e0746a4da3c4a032366f141d2e9a8b805e081cbe","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                        context, object_id\u003dnetwork.id,"},{"line_number":435,"context_line":"                        action\u003d\u0027access_as_shared\u0027, target_tenant\u003d\u0027*\u0027)"},{"line_number":436,"context_line":"                    if np_rbac_obj:"},{"line_number":437,"context_line":"                        np_rbac_obj.delete()"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"                # TODO(ihrachys) Below can be removed when we make sqlalchemy"},{"line_number":440,"context_line":"                # event listeners in neutron/db/api.py to refresh expired"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_ee94dc9a","line":437,"range":{"start_line":437,"start_character":24,"end_line":437,"end_character":44},"in_reply_to":"3f79a3b5_9b725d18","updated":"2018-10-18 17:56:52.000000000","message":"The context is flushed (L444) and this is enough to refresh the network object data.\n\nBut to ensure this, I\u0027ll amend the functional tests to check that the object received from \"self.plugin.create_network\" has or not the rbac entries (tested manually and it\u0027s working).","commit_id":"111e9b20d6838396492d691c781de277a836cb98"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"f1431d7a49ece4e326d9a6812e2026e299fbc35c","unresolved":false,"context_lines":[{"line_number":430,"context_line":"                                                          **np_rbac_args)"},{"line_number":431,"context_line":"                    np_rbac_obj.create()"},{"line_number":432,"context_line":"                elif not update_shared and entry:"},{"line_number":433,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC.get_object("},{"line_number":434,"context_line":"                        context, object_id\u003dnetwork.id,"},{"line_number":435,"context_line":"                        action\u003d\u0027access_as_shared\u0027, target_tenant\u003d\u0027*\u0027)"},{"line_number":436,"context_line":"                    if np_rbac_obj:"},{"line_number":437,"context_line":"                        np_rbac_obj.delete()"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"                # TODO(ihrachys) Below can be removed when we make sqlalchemy"},{"line_number":440,"context_line":"                # event listeners in neutron/db/api.py to refresh expired"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_803e1724","line":437,"range":{"start_line":433,"start_character":0,"end_line":437,"end_character":44},"updated":"2018-10-22 20:26:40.000000000","message":"I echo what @Slawek said in https://review.openstack.org/#/c/608628/5/neutron/db/external_net_db.py : you could use delete_objects instead.","commit_id":"a43f877981a1f6806b5e9be1965ed1c5dfbfc726"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c8bf0a1c1eccadba0676e9688b585aa28f162157","unresolved":false,"context_lines":[{"line_number":430,"context_line":"                                                          **np_rbac_args)"},{"line_number":431,"context_line":"                    np_rbac_obj.create()"},{"line_number":432,"context_line":"                elif not update_shared and entry:"},{"line_number":433,"context_line":"                    np_rbac_obj \u003d network_obj.NetworkRBAC.get_object("},{"line_number":434,"context_line":"                        context, object_id\u003dnetwork.id,"},{"line_number":435,"context_line":"                        action\u003d\u0027access_as_shared\u0027, target_tenant\u003d\u0027*\u0027)"},{"line_number":436,"context_line":"                    if np_rbac_obj:"},{"line_number":437,"context_line":"                        np_rbac_obj.delete()"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"                # TODO(ihrachys) Below can be removed when we make sqlalchemy"},{"line_number":440,"context_line":"                # event listeners in neutron/db/api.py to refresh expired"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_bbc6dd40","line":437,"range":{"start_line":433,"start_character":0,"end_line":437,"end_character":44},"in_reply_to":"3f79a3b5_803e1724","updated":"2018-10-23 05:50:46.000000000","message":"I thought I did it...","commit_id":"a43f877981a1f6806b5e9be1965ed1c5dfbfc726"}],"neutron/objects/network.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"f1431d7a49ece4e326d9a6812e2026e299fbc35c","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        if _target_version \u003c (1, 1):"},{"line_number":55,"context_line":"            standard_fields \u003d [\u0027id\u0027, \u0027project_id\u0027]"},{"line_number":56,"context_line":"            for f in standard_fields:"},{"line_number":57,"context_line":"                primitive.pop(f)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"@base.NeutronObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_4060ff34","line":57,"range":{"start_line":57,"start_character":16,"end_line":57,"end_character":32},"updated":"2018-10-22 20:26:40.000000000","message":"primitive.pop(f, None) is safer.","commit_id":"a43f877981a1f6806b5e9be1965ed1c5dfbfc726"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c8bf0a1c1eccadba0676e9688b585aa28f162157","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        if _target_version \u003c (1, 1):"},{"line_number":55,"context_line":"            standard_fields \u003d [\u0027id\u0027, \u0027project_id\u0027]"},{"line_number":56,"context_line":"            for f in standard_fields:"},{"line_number":57,"context_line":"                primitive.pop(f)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"@base.NeutronObjectRegistry.register"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_fbfd356d","line":57,"range":{"start_line":57,"start_character":16,"end_line":57,"end_character":32},"in_reply_to":"3f79a3b5_4060ff34","updated":"2018-10-23 05:50:46.000000000","message":"Sure, let\u0027s avoid any exception.","commit_id":"a43f877981a1f6806b5e9be1965ed1c5dfbfc726"}],"neutron/objects/rbac_db.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"da600c1dc1aadfc323e0af41c2ae21e88f266229","unresolved":false,"context_lines":[{"line_number":343,"context_line":""},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"@base.NeutronObjectRegistry.register"},{"line_number":346,"context_line":"class NetworkPolicyRBAC(base.NeutronDbObject):"},{"line_number":347,"context_line":"    # Version 1.0: Initial version"},{"line_number":348,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":349,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_5bdcbbe0","line":346,"range":{"start_line":346,"start_character":6,"end_line":346,"end_character":23},"updated":"2018-10-05 21:33:44.000000000","message":"This class looks duplicated with https://github.com/openstack/neutron/blob/master/neutron/objects/network.py#L35 .","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"22682f19cfab6beaecf2dc4a9563623a2d42a2a5","unresolved":false,"context_lines":[{"line_number":343,"context_line":""},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"@base.NeutronObjectRegistry.register"},{"line_number":346,"context_line":"class NetworkPolicyRBAC(base.NeutronDbObject):"},{"line_number":347,"context_line":"    # Version 1.0: Initial version"},{"line_number":348,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":349,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_b9fe2537","line":346,"range":{"start_line":346,"start_character":6,"end_line":346,"end_character":23},"in_reply_to":"3f79a3b5_5bdcbbe0","updated":"2018-10-08 08:43:13.000000000","message":"Ups, you are right. I was looking for this object in the wrong file.\n\nI\u0027ll need to modify it, but currently is only used here [1]\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/objects/subnet.py#L254","commit_id":"13193718d4cc071332bd515b16927cc46f0198d6"}]}
