)]}'
{"dragonflow/neutron/services/l3_router_plugin.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"7ca3c8b2ac1c6bee4f9a277b44d852cefccbd112","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # Note: Here the context is elevated, because the floatingip port"},{"line_number":180,"context_line":"            # will not have tenant and floatingip subnet might be in other"},{"line_number":181,"context_line":"            # tenant."},{"line_number":182,"context_line":"            context \u003d context.elevated()"},{"line_number":183,"context_line":"            floatingip_port \u003d self._get_floatingip_port("},{"line_number":184,"context_line":"                context, floatingip_dict[\u0027id\u0027])"},{"line_number":185,"context_line":"            if not floatingip_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_359cf15c","line":182,"updated":"2016-09-11 16:12:26.000000000","message":"I think you should pass context.elevated() to _get_gloatingip_port, and keep the original (non-elevated) context for the rest of the operation. We shouldn\u0027t used elevated context unless absolutely necessary.","commit_id":"13c2618d753d91385b224283ce895acb04f4bd98"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"e8031faed1aa47ff58c948aa3b8e9e54b1b61e38","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # Note: Here the context is elevated, because the floatingip port"},{"line_number":180,"context_line":"            # will not have tenant and floatingip subnet might be in other"},{"line_number":181,"context_line":"            # tenant."},{"line_number":182,"context_line":"            context \u003d context.elevated()"},{"line_number":183,"context_line":"            floatingip_port \u003d self._get_floatingip_port("},{"line_number":184,"context_line":"                context, floatingip_dict[\u0027id\u0027])"},{"line_number":185,"context_line":"            if not floatingip_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_53f8a849","line":182,"in_reply_to":"9a89bdaa_359cf15c","updated":"2016-09-12 04:08:47.000000000","message":"If we just elevate context for getting floatingip port. non-admin user might also fail to get foatingip subnet.\n\nFor example, there is one external network in tenant A, it has a subnet also in tenant A. normal user in tenant B wants to create a floatingip. Without admin context, the user can\u0027t get the external subnet in _get_floatingip_subnet.\n\nIt is normal to have only one external network and all its subnets in the same tenant. we can create subnet for each tenant in the external network. but there is no guarantee that neutron will allocate floatingip from the subnet in same tenant.\n\nTo make it more usable, I think elevating context for following operation is necessary. Since neutron don\u0027t fail creating fip in line 175. df might just gracefully ignore tenant here. After all, they are query to neutron db in the following code.","commit_id":"13c2618d753d91385b224283ce895acb04f4bd98"},{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"89a52435dfc469b0f129bfb66ce756abf781919f","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # Note: Here the context is elevated, because the floatingip port"},{"line_number":180,"context_line":"            # will not have tenant and floatingip subnet might be in other"},{"line_number":181,"context_line":"            # tenant."},{"line_number":182,"context_line":"            context \u003d context.elevated()"},{"line_number":183,"context_line":"            floatingip_port \u003d self._get_floatingip_port("},{"line_number":184,"context_line":"                context, floatingip_dict[\u0027id\u0027])"},{"line_number":185,"context_line":"            if not floatingip_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_fcf989c9","line":182,"in_reply_to":"9a89bdaa_53f8a849","updated":"2016-09-12 06:23:56.000000000","message":"the usage of admin context seems chaotic in neutron. I also think we have to pass it along the way.","commit_id":"13c2618d753d91385b224283ce895acb04f4bd98"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"f601f1d87ad195d74b2eff5c21f8ed8c2a5cdc29","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # Note: Here the context is elevated, because the floatingip port"},{"line_number":180,"context_line":"            # will not have tenant and floatingip subnet might be in other"},{"line_number":181,"context_line":"            # tenant."},{"line_number":182,"context_line":"            context \u003d context.elevated()"},{"line_number":183,"context_line":"            floatingip_port \u003d self._get_floatingip_port("},{"line_number":184,"context_line":"                context, floatingip_dict[\u0027id\u0027])"},{"line_number":185,"context_line":"            if not floatingip_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_faadf788","line":182,"in_reply_to":"9a89bdaa_d9d84582","updated":"2016-09-12 12:25:07.000000000","message":"Make sense, will do","commit_id":"13c2618d753d91385b224283ce895acb04f4bd98"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"e43cac326974588a7960772344dad74b366ec2d2","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            # Note: Here the context is elevated, because the floatingip port"},{"line_number":180,"context_line":"            # will not have tenant and floatingip subnet might be in other"},{"line_number":181,"context_line":"            # tenant."},{"line_number":182,"context_line":"            context \u003d context.elevated()"},{"line_number":183,"context_line":"            floatingip_port \u003d self._get_floatingip_port("},{"line_number":184,"context_line":"                context, floatingip_dict[\u0027id\u0027])"},{"line_number":185,"context_line":"            if not floatingip_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_d9d84582","line":182,"in_reply_to":"9a89bdaa_fcf989c9","updated":"2016-09-12 11:38:51.000000000","message":"I see. Maybe rename it to admin_context? This way we keep the non-elevated context, and can use it if we don\u0027t need admin privileges.\n\nIt is generally preferable not to use elevated privileges unless absolutely necessary, to avoid allowing the user to do something they shouldn\u0027t.","commit_id":"13c2618d753d91385b224283ce895acb04f4bd98"}]}
