)]}'
{"nova/api/openstack/compute/security_groups.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c33a0cef100039b117bacda58b939bf2d5a737f1","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def _extend_servers(self, req, servers):"},{"line_number":487,"context_line":"        # TODO(arosen) this function should be refactored to reduce duplicate"},{"line_number":488,"context_line":"        # code and use get_instance_security_groups instead of get_db_instance."},{"line_number":489,"context_line":"        if not len(servers):"},{"line_number":490,"context_line":"            return"},{"line_number":491,"context_line":"        key \u003d \"security_groups\""},{"line_number":492,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":493,"context_line":"        if not openstack_driver.is_neutron_security_groups():"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_b3b67924","side":"PARENT","line":490,"range":{"start_line":489,"start_character":8,"end_line":490,"end_character":18},"updated":"2018-09-10 04:46:37.000000000","message":"So we lose this optimization now?","commit_id":"c7991409f48787dd344e8946d4cb20059477e8ea"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"a91bf5ffd2769e6064cfe4a5ec481a3a48a0ad9d","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def _extend_servers(self, req, servers):"},{"line_number":487,"context_line":"        # TODO(arosen) this function should be refactored to reduce duplicate"},{"line_number":488,"context_line":"        # code and use get_instance_security_groups instead of get_db_instance."},{"line_number":489,"context_line":"        if not len(servers):"},{"line_number":490,"context_line":"            return"},{"line_number":491,"context_line":"        key \u003d \"security_groups\""},{"line_number":492,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":493,"context_line":"        if not openstack_driver.is_neutron_security_groups():"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_03bfd8fc","side":"PARENT","line":490,"range":{"start_line":489,"start_character":8,"end_line":490,"end_character":18},"in_reply_to":"3f79a3b5_b3b67924","updated":"2018-09-10 12:34:05.000000000","message":"ah, nice catch. i did not realizes the neutron case things here.","commit_id":"c7991409f48787dd344e8946d4cb20059477e8ea"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cb627c2339d5e439f795433fcfe50488f34906b4","unresolved":false,"context_lines":[{"line_number":480,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":481,"context_line":"        super(SecurityGroupsOutputController, self).__init__(*args, **kwargs)"},{"line_number":482,"context_line":"        self.compute_api \u003d compute.API()"},{"line_number":483,"context_line":"        self.security_group_api \u003d ("},{"line_number":484,"context_line":"            openstack_driver.get_openstack_security_group_driver())"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    def _extend_servers(self, req, servers):"},{"line_number":487,"context_line":"        # TODO(arosen) this function should be refactored to reduce duplicate"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_5d2c3a98","side":"PARENT","line":484,"range":{"start_line":483,"start_character":8,"end_line":484,"end_character":67},"updated":"2018-09-17 20:30:02.000000000","message":"We should do this in the servers view builder init also.","commit_id":"6a7482862179a3300dbdb259b15592265fb8fc71"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f7cc8df4a567d9cd106465b5e927ab83265c3ca5","unresolved":false,"context_lines":[{"line_number":480,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":481,"context_line":"        super(SecurityGroupsOutputController, self).__init__(*args, **kwargs)"},{"line_number":482,"context_line":"        self.compute_api \u003d compute.API()"},{"line_number":483,"context_line":"        self.security_group_api \u003d ("},{"line_number":484,"context_line":"            openstack_driver.get_openstack_security_group_driver())"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"    def _extend_servers(self, req, servers):"},{"line_number":487,"context_line":"        # TODO(arosen) this function should be refactored to reduce duplicate"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_3de85e14","side":"PARENT","line":484,"range":{"start_line":483,"start_character":8,"end_line":484,"end_character":67},"in_reply_to":"3f79a3b5_5d2c3a98","updated":"2018-09-17 20:41:31.000000000","message":"Done","commit_id":"6a7482862179a3300dbdb259b15592265fb8fc71"}],"nova/api/openstack/compute/views/servers.py":[{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"15643ff64dfcdcd2a74bba5d207a6666af23f629","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                server[\"server\"][key] \u003d (instance[k].replace(tzinfo\u003dNone)"},{"line_number":200,"context_line":"                                         if instance[k] else None)"},{"line_number":201,"context_line":"        if show_sec_grp:"},{"line_number":202,"context_line":"            server[\"server\"][\"security_groups\"] \u003d self._get_security_grps("},{"line_number":203,"context_line":"                request, server[\"server\"], instance)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        if show_extended_attr is None:"}],"source_content_type":"text/x-python","patch_set":12,"id":"3f79a3b5_051b8b80","line":202,"range":{"start_line":202,"start_character":12,"end_line":202,"end_character":47},"updated":"2018-09-07 08:26:27.000000000","message":"failed tests is checking that whether \"security_groups\" field is present or not[1]. Which is valid failure. \n\nIn original nova code[2],\"security_groups\" field is added in server dict(response) optionally. This is not added when there is no security group in DB(for nova-net case) and other condition for neutron case. \nAnd in this patch (this file code change) i made mistake to add the \"security_groups\" field always. So here empty list is presents in \"security_groups\" field when there is no group. This is behavior change and so does test fail. I will make it same as original. \n\nOther issue i observed that our api-ref does not tell that \"security_groups\" is optional field in sever response[3]\n  \n\n[1] https://github.com/openstack/tempest/blob/293e36c61d33c728a9609c678d087f5526c4ed16/tempest/api/compute/servers/test_server_actions.py#L168\n\n[2]L498- https://review.openstack.org/#/c/585475/12/nova/api/openstack/compute/security_groups.py\n\n[3] https://developer.openstack.org/api-ref/compute/#show-server-details","commit_id":"fc9c5f9bc1a938117dea1fe8f80d5912976ef867"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"87caf521da2dc60418f113e19ff9895df0203bdf","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    def _get_security_grps(self, req, server, instance):"},{"line_number":435,"context_line":"        # TODO(arosen) this function should be refactored to reduce duplicate"},{"line_number":436,"context_line":"        # code and use get_instance_security_groups instead of get_db_instance."},{"line_number":437,"context_line":"        security_group_api \u003d ("},{"line_number":438,"context_line":"            openstack_driver.get_openstack_security_group_driver())"},{"line_number":439,"context_line":"        if not openstack_driver.is_neutron_security_groups():"},{"line_number":440,"context_line":"            groups \u003d instance.get(\u0027security_groups\u0027)"},{"line_number":441,"context_line":"            if groups:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_ad02ae07","line":438,"range":{"start_line":437,"start_character":0,"end_line":438,"end_character":67},"updated":"2018-09-07 22:59:29.000000000","message":"This security_group_api is used in the block of line 445- only. So it is nice to move it into the block.","commit_id":"8e2acbaa06cf4c8f50fdf07cce8096f4c2e24398"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"258790da362e9100926c81028f8b00782107b10a","unresolved":false,"context_lines":[{"line_number":434,"context_line":"    def _get_security_grps(self, req, server, instance):"},{"line_number":435,"context_line":"        # TODO(arosen) this function should be refactored to reduce duplicate"},{"line_number":436,"context_line":"        # code and use get_instance_security_groups instead of get_db_instance."},{"line_number":437,"context_line":"        security_group_api \u003d ("},{"line_number":438,"context_line":"            openstack_driver.get_openstack_security_group_driver())"},{"line_number":439,"context_line":"        if not openstack_driver.is_neutron_security_groups():"},{"line_number":440,"context_line":"            groups \u003d instance.get(\u0027security_groups\u0027)"},{"line_number":441,"context_line":"            if groups:"}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_6c31ea0a","line":438,"range":{"start_line":437,"start_character":0,"end_line":438,"end_character":67},"in_reply_to":"3f79a3b5_ad02ae07","updated":"2018-09-09 17:40:59.000000000","message":"Done","commit_id":"8e2acbaa06cf4c8f50fdf07cce8096f4c2e24398"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"87caf521da2dc60418f113e19ff9895df0203bdf","unresolved":false,"context_lines":[{"line_number":441,"context_line":"            if groups:"},{"line_number":442,"context_line":"                server[\u0027security_groups\u0027] \u003d [{\"name\": group.name}"},{"line_number":443,"context_line":"                                             for group in groups]"},{"line_number":444,"context_line":"        else:"},{"line_number":445,"context_line":"            # If method is a POST we get the security groups intended for an"},{"line_number":446,"context_line":"            # instance from the request. The reason for this is if using"},{"line_number":447,"context_line":"            # neutron security groups the requested security groups for the"}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_2d377ee5","line":444,"updated":"2018-09-07 22:59:29.000000000","message":"nit: better to add\n\n return\n\njust after line 443 and remove \"else:\" for reducing the indents.","commit_id":"8e2acbaa06cf4c8f50fdf07cce8096f4c2e24398"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"258790da362e9100926c81028f8b00782107b10a","unresolved":false,"context_lines":[{"line_number":441,"context_line":"            if groups:"},{"line_number":442,"context_line":"                server[\u0027security_groups\u0027] \u003d [{\"name\": group.name}"},{"line_number":443,"context_line":"                                             for group in groups]"},{"line_number":444,"context_line":"        else:"},{"line_number":445,"context_line":"            # If method is a POST we get the security groups intended for an"},{"line_number":446,"context_line":"            # instance from the request. The reason for this is if using"},{"line_number":447,"context_line":"            # neutron security groups the requested security groups for the"}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_6c1a4a7d","line":444,"in_reply_to":"3f79a3b5_2d377ee5","updated":"2018-09-09 17:40:59.000000000","message":"i feel explicit else make this code more readable otherwise it will be difficult to understand what cases for nova-net and what for neutron.","commit_id":"8e2acbaa06cf4c8f50fdf07cce8096f4c2e24398"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"87caf521da2dc60418f113e19ff9895df0203bdf","unresolved":false,"context_lines":[{"line_number":458,"context_line":""},{"line_number":459,"context_line":"            # In this section of code len(servers) \u003d\u003d 1 as you can only POST"},{"line_number":460,"context_line":"            # one server in an API request."},{"line_number":461,"context_line":"            else:"},{"line_number":462,"context_line":"                # try converting to json"},{"line_number":463,"context_line":"                req_obj \u003d jsonutils.loads(req.body)"},{"line_number":464,"context_line":"                # Add security group to server, if no security group was in"}],"source_content_type":"text/x-python","patch_set":13,"id":"3f79a3b5_ed2c2694","line":461,"updated":"2018-09-07 22:59:29.000000000","message":"ditto","commit_id":"8e2acbaa06cf4c8f50fdf07cce8096f4c2e24398"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c33a0cef100039b117bacda58b939bf2d5a737f1","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        if (api_version_request.is_supported(request, min_version\u003d\u00272.16\u0027)):"},{"line_number":279,"context_line":"            show_host_status \u003d context.can("},{"line_number":280,"context_line":"                servers_policies.SERVERS % \u0027show:host_status\u0027, fatal\u003dFalse)"},{"line_number":281,"context_line":"        return self._list_view(self.show, request, instances, coll_name,"},{"line_number":282,"context_line":"                               show_extra_specs,"},{"line_number":283,"context_line":"                               show_extended_attr\u003dshow_extended_attr,"},{"line_number":284,"context_line":"                               show_host_status\u003dshow_host_status)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def _list_view(self, func, request, servers, coll_name, show_extra_specs,"},{"line_number":287,"context_line":"                   show_extended_attr\u003dNone, show_host_status\u003dNone):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_f345d115","line":284,"range":{"start_line":281,"start_character":8,"end_line":284,"end_character":65},"updated":"2018-09-10 04:46:37.000000000","message":"Can we make _add_security_grps still take a list of servers and call it after this so we get the batching capability in the neutron driver? Otherwise I think I\u0027d want to see performance comparisons of what listing servers with details looks like before and after this change to see if it\u0027s been noticeably negatively impacted.","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"a91bf5ffd2769e6064cfe4a5ec481a3a48a0ad9d","unresolved":false,"context_lines":[{"line_number":278,"context_line":"        if (api_version_request.is_supported(request, min_version\u003d\u00272.16\u0027)):"},{"line_number":279,"context_line":"            show_host_status \u003d context.can("},{"line_number":280,"context_line":"                servers_policies.SERVERS % \u0027show:host_status\u0027, fatal\u003dFalse)"},{"line_number":281,"context_line":"        return self._list_view(self.show, request, instances, coll_name,"},{"line_number":282,"context_line":"                               show_extra_specs,"},{"line_number":283,"context_line":"                               show_extended_attr\u003dshow_extended_attr,"},{"line_number":284,"context_line":"                               show_host_status\u003dshow_host_status)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def _list_view(self, func, request, servers, coll_name, show_extra_specs,"},{"line_number":287,"context_line":"                   show_extended_attr\u003dNone, show_host_status\u003dNone):"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_c3b80013","line":284,"range":{"start_line":281,"start_character":8,"end_line":284,"end_character":65},"in_reply_to":"3f79a3b5_f345d115","updated":"2018-09-10 12:34:05.000000000","message":"yeah, we should do that.","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c33a0cef100039b117bacda58b939bf2d5a737f1","unresolved":false,"context_lines":[{"line_number":446,"context_line":"            # instance are not in the db and have not been sent to neutron yet."},{"line_number":447,"context_line":"            if req.method !\u003d \u0027POST\u0027:"},{"line_number":448,"context_line":"                context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":449,"context_line":"                security_group_api \u003d ("},{"line_number":450,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":451,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":452,"context_line":"                    security_group_api"},{"line_number":453,"context_line":"                    .get_instances_security_groups_bindings(context,"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_13c88da5","line":450,"range":{"start_line":449,"start_character":16,"end_line":450,"end_character":75},"updated":"2018-09-10 04:46:37.000000000","message":"Can we store this as a variable in the view builder itself? Or at least a singleton variable in the view builder class, because if we\u0027re iterating and returning 1000 servers we\u0027re going to create this for each server.","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"f0f2c03cee44e7741d7bfa56f3057d843a6cb6af","unresolved":false,"context_lines":[{"line_number":446,"context_line":"            # instance are not in the db and have not been sent to neutron yet."},{"line_number":447,"context_line":"            if req.method !\u003d \u0027POST\u0027:"},{"line_number":448,"context_line":"                context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":449,"context_line":"                security_group_api \u003d ("},{"line_number":450,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":451,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":452,"context_line":"                    security_group_api"},{"line_number":453,"context_line":"                    .get_instances_security_groups_bindings(context,"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_0f8ccfd5","line":450,"range":{"start_line":449,"start_character":16,"end_line":450,"end_character":75},"in_reply_to":"3f79a3b5_0344b818","updated":"2018-09-12 03:00:20.000000000","message":"now with making this method taking servers together, this variable will be instantiated once.","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"a91bf5ffd2769e6064cfe4a5ec481a3a48a0ad9d","unresolved":false,"context_lines":[{"line_number":446,"context_line":"            # instance are not in the db and have not been sent to neutron yet."},{"line_number":447,"context_line":"            if req.method !\u003d \u0027POST\u0027:"},{"line_number":448,"context_line":"                context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":449,"context_line":"                security_group_api \u003d ("},{"line_number":450,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":451,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":452,"context_line":"                    security_group_api"},{"line_number":453,"context_line":"                    .get_instances_security_groups_bindings(context,"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_0344b818","line":450,"range":{"start_line":449,"start_character":16,"end_line":450,"end_character":75},"in_reply_to":"3f79a3b5_13c88da5","updated":"2018-09-10 12:34:05.000000000","message":"got it. we can do it in __init__ and use here.","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c33a0cef100039b117bacda58b939bf2d5a737f1","unresolved":false,"context_lines":[{"line_number":450,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":451,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":452,"context_line":"                    security_group_api"},{"line_number":453,"context_line":"                    .get_instances_security_groups_bindings(context,"},{"line_number":454,"context_line":"                                                            [server]))"},{"line_number":455,"context_line":"                groups \u003d sg_instance_bindings.get(server[\u0027id\u0027])"},{"line_number":456,"context_line":"                if groups:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_f3c0717e","line":453,"range":{"start_line":453,"start_character":21,"end_line":453,"end_character":59},"updated":"2018-09-10 04:46:37.000000000","message":"If we\u0027re doing this one per server now, I think we\u0027re likely going to have a performance regression when listing a lot of servers. Looking at how http://git.openstack.org/cgit/openstack/nova/tree/nova/network/security_group/neutron_driver.py#n374 works, it\u0027s meant to be batched results if possible, but we\u0027d lose that with this change. I already know that getting the security groups for a list of servers is already a known performance issue in nova:\n\nhttps://bugs.launchpad.net/nova/+bug/1567655","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"a91bf5ffd2769e6064cfe4a5ec481a3a48a0ad9d","unresolved":false,"context_lines":[{"line_number":450,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":451,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":452,"context_line":"                    security_group_api"},{"line_number":453,"context_line":"                    .get_instances_security_groups_bindings(context,"},{"line_number":454,"context_line":"                                                            [server]))"},{"line_number":455,"context_line":"                groups \u003d sg_instance_bindings.get(server[\u0027id\u0027])"},{"line_number":456,"context_line":"                if groups:"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_832f683d","line":453,"range":{"start_line":453,"start_character":21,"end_line":453,"end_character":59},"in_reply_to":"3f79a3b5_f3c0717e","updated":"2018-09-10 12:34:05.000000000","message":"yeah, it is costly to do per server, i will make it with all servers for detail case.","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c33a0cef100039b117bacda58b939bf2d5a737f1","unresolved":false,"context_lines":[{"line_number":456,"context_line":"                if groups:"},{"line_number":457,"context_line":"                    server[\u0027security_groups\u0027] \u003d groups"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"            # In this section of code len(servers) \u003d\u003d 1 as you can only POST"},{"line_number":460,"context_line":"            # one server in an API request."},{"line_number":461,"context_line":"            else:"},{"line_number":462,"context_line":"                # try converting to json"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_133ded8c","line":459,"range":{"start_line":459,"start_character":38,"end_line":459,"end_character":55},"updated":"2018-09-10 04:46:37.000000000","message":"This doesn\u0027t really make sense now.","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"a91bf5ffd2769e6064cfe4a5ec481a3a48a0ad9d","unresolved":false,"context_lines":[{"line_number":456,"context_line":"                if groups:"},{"line_number":457,"context_line":"                    server[\u0027security_groups\u0027] \u003d groups"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"            # In this section of code len(servers) \u003d\u003d 1 as you can only POST"},{"line_number":460,"context_line":"            # one server in an API request."},{"line_number":461,"context_line":"            else:"},{"line_number":462,"context_line":"                # try converting to json"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f79a3b5_a31704ef","line":459,"range":{"start_line":459,"start_character":38,"end_line":459,"end_character":55},"in_reply_to":"3f79a3b5_133ded8c","updated":"2018-09-10 12:34:05.000000000","message":"yeah, i can modify this to something like there can be one security group for create request either one or more server creation request,","commit_id":"6e69a2b4fdec2603fb43a4a1d067c82c778305a0"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"2f74047720f8396f398035bec4029ed8aaf9d2b0","unresolved":false,"context_lines":[{"line_number":305,"context_line":"        :param show_extended_attr: If the server extended attributes should be"},{"line_number":306,"context_line":"                        included in the response dict."},{"line_number":307,"context_line":"        :param show_host_status: If the host status should be included in"},{"line_number":308,"context_line":"                        the response dict."},{"line_number":309,"context_line":"        :returns: Server data in dictionary format"},{"line_number":310,"context_line":"        \"\"\""},{"line_number":311,"context_line":"        server_list \u003d [func(request, server,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_5eed89b5","line":308,"updated":"2018-09-11 16:49:41.000000000","message":"need to add show_sec_grp on the docstring.","commit_id":"b4246a0fa6052a82b0236de6063b92616f8a24b2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"582029db6b0f6eef8a7ea45032f90ecffea5661e","unresolved":false,"context_lines":[{"line_number":450,"context_line":"        if not len(servers):"},{"line_number":451,"context_line":"            return"},{"line_number":452,"context_line":"        if not openstack_driver.is_neutron_security_groups():"},{"line_number":453,"context_line":"            for server in servers:"},{"line_number":454,"context_line":"                for i in instances:"},{"line_number":455,"context_line":"                    if server[\u0027id\u0027] \u003d\u003d i[\u0027uuid\u0027]:"},{"line_number":456,"context_line":"                        groups \u003d i.get(\u0027security_groups\u0027)"},{"line_number":457,"context_line":"                        if groups:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_aeb4a483","line":454,"range":{"start_line":453,"start_character":12,"end_line":454,"end_character":35},"updated":"2018-09-11 23:11:25.000000000","message":"Hmm, this is a pretty nasty search - can\u0027t we map instances by uuid in a dict and look them up so we don\u0027t have to iterate over the instances list for every server?","commit_id":"ab37a75362d4bbcbff9dfdeb1ea4e43353ea9811"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"f0f2c03cee44e7741d7bfa56f3057d843a6cb6af","unresolved":false,"context_lines":[{"line_number":450,"context_line":"        if not len(servers):"},{"line_number":451,"context_line":"            return"},{"line_number":452,"context_line":"        if not openstack_driver.is_neutron_security_groups():"},{"line_number":453,"context_line":"            for server in servers:"},{"line_number":454,"context_line":"                for i in instances:"},{"line_number":455,"context_line":"                    if server[\u0027id\u0027] \u003d\u003d i[\u0027uuid\u0027]:"},{"line_number":456,"context_line":"                        groups \u003d i.get(\u0027security_groups\u0027)"},{"line_number":457,"context_line":"                        if groups:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_ca3d49bd","line":454,"range":{"start_line":453,"start_character":12,"end_line":454,"end_character":35},"in_reply_to":"3f79a3b5_aeb4a483","updated":"2018-09-12 03:00:20.000000000","message":"yeah, this is becoming n2 complexity. mapping in dict is better way.","commit_id":"ab37a75362d4bbcbff9dfdeb1ea4e43353ea9811"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cb627c2339d5e439f795433fcfe50488f34906b4","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                                       show_host_status\u003dshow_host_status,"},{"line_number":292,"context_line":"                                       show_sec_grp\u003dFalse)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        instances_dict \u003d {i[\u0027uuid\u0027]: i for i in instances}"},{"line_number":295,"context_line":"        self._add_security_grps(request, list(servers_dict[\"servers\"]),"},{"line_number":296,"context_line":"                                instances_dict)"},{"line_number":297,"context_line":"        return servers_dict"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_1d09e229","line":294,"range":{"start_line":294,"start_character":8,"end_line":294,"end_character":58},"updated":"2018-09-17 20:30:02.000000000","message":"We could just do this within the _add_security_grps method. Then every caller doesn\u0027t need to handle it.","commit_id":"bea6a7c26d66fa2f6b9aa5b7083077025296c00b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f7cc8df4a567d9cd106465b5e927ab83265c3ca5","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                                       show_host_status\u003dshow_host_status,"},{"line_number":292,"context_line":"                                       show_sec_grp\u003dFalse)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        instances_dict \u003d {i[\u0027uuid\u0027]: i for i in instances}"},{"line_number":295,"context_line":"        self._add_security_grps(request, list(servers_dict[\"servers\"]),"},{"line_number":296,"context_line":"                                instances_dict)"},{"line_number":297,"context_line":"        return servers_dict"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_fd3bc697","line":294,"range":{"start_line":294,"start_character":8,"end_line":294,"end_character":58},"in_reply_to":"3f79a3b5_1d09e229","updated":"2018-09-17 20:41:31.000000000","message":"Done","commit_id":"bea6a7c26d66fa2f6b9aa5b7083077025296c00b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"bc619f18d75418c0c8551c9627c6416f55a0eb8f","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                                       show_host_status\u003dshow_host_status,"},{"line_number":292,"context_line":"                                       show_sec_grp\u003dFalse)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"        instances_dict \u003d {i[\u0027uuid\u0027]: i for i in instances}"},{"line_number":295,"context_line":"        self._add_security_grps(request, list(servers_dict[\"servers\"]),"},{"line_number":296,"context_line":"                                instances_dict)"},{"line_number":297,"context_line":"        return servers_dict"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_40bbf1e3","line":294,"range":{"start_line":294,"start_character":8,"end_line":294,"end_character":58},"in_reply_to":"3f79a3b5_fd3bc697","updated":"2018-09-17 21:59:07.000000000","message":"Thanks, much better","commit_id":"bea6a7c26d66fa2f6b9aa5b7083077025296c00b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cb627c2339d5e439f795433fcfe50488f34906b4","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            # instance are not in the db and have not been sent to neutron yet."},{"line_number":468,"context_line":"            if req.method !\u003d \u0027POST\u0027:"},{"line_number":469,"context_line":"                context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":470,"context_line":"                security_group_api \u003d ("},{"line_number":471,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":472,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":473,"context_line":"                    security_group_api"},{"line_number":474,"context_line":"                    .get_instances_security_groups_bindings(context,"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_9d141243","line":471,"range":{"start_line":470,"start_character":16,"end_line":471,"end_character":75},"updated":"2018-09-17 20:30:02.000000000","message":"I thought you were going to move this to __init__?","commit_id":"bea6a7c26d66fa2f6b9aa5b7083077025296c00b"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"aee3b44eac6400d358301113df597f4d8ef85e55","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            # instance are not in the db and have not been sent to neutron yet."},{"line_number":468,"context_line":"            if req.method !\u003d \u0027POST\u0027:"},{"line_number":469,"context_line":"                context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":470,"context_line":"                security_group_api \u003d ("},{"line_number":471,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":472,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":473,"context_line":"                    security_group_api"},{"line_number":474,"context_line":"                    .get_instances_security_groups_bindings(context,"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_40d21136","line":471,"range":{"start_line":470,"start_character":16,"end_line":471,"end_character":75},"in_reply_to":"3f79a3b5_1d41e20a","updated":"2018-09-17 21:58:35.000000000","message":"i avoided this as this is only used one time here now. making instance var not really needed.","commit_id":"bea6a7c26d66fa2f6b9aa5b7083077025296c00b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f7cc8df4a567d9cd106465b5e927ab83265c3ca5","unresolved":false,"context_lines":[{"line_number":467,"context_line":"            # instance are not in the db and have not been sent to neutron yet."},{"line_number":468,"context_line":"            if req.method !\u003d \u0027POST\u0027:"},{"line_number":469,"context_line":"                context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":470,"context_line":"                security_group_api \u003d ("},{"line_number":471,"context_line":"                    openstack_driver.get_openstack_security_group_driver())"},{"line_number":472,"context_line":"                sg_instance_bindings \u003d ("},{"line_number":473,"context_line":"                    security_group_api"},{"line_number":474,"context_line":"                    .get_instances_security_groups_bindings(context,"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_1d41e20a","line":471,"range":{"start_line":470,"start_character":16,"end_line":471,"end_character":75},"in_reply_to":"3f79a3b5_9d141243","updated":"2018-09-17 20:41:31.000000000","message":"Done","commit_id":"bea6a7c26d66fa2f6b9aa5b7083077025296c00b"}]}
