)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"53501d9460df2a5f4192a03ff116530cb49b084e","unresolved":false,"context_lines":[{"line_number":790,"context_line":"        for p in ports:"},{"line_number":791,"context_line":"            for subnet in ipam_subnets:"},{"line_number":792,"context_line":"                fixed_ips \u003d p[\u0027fixed_ips\u0027]"},{"line_number":793,"context_line":"                fixed_ips.append({\u0027subnet_id\u0027: subnet[\u0027id\u0027]})"},{"line_number":794,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: fixed_ips}}"},{"line_number":795,"context_line":"                try:"},{"line_number":796,"context_line":"                    get_client(context).update_port(p[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_6cc46140","line":793,"updated":"2015-03-12 15:18:46.000000000","message":"So fixed_ips in the port dict aren\u0027t fixed_ip addresses at all, but subnet IDs.  I think this code really needs some documentation on what it\u0027s doing and how it would be used.","commit_id":"1ec516f290835e6b2a75e20bb12d99d4f48779c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"53501d9460df2a5f4192a03ff116530cb49b084e","unresolved":false,"context_lines":[{"line_number":802,"context_line":"                    LOG.debug(msg, {\u0027portid\u0027: p[\u0027id\u0027],"},{"line_number":803,"context_line":"                                    \u0027subnet_id\u0027: subnet[\u0027id\u0027],"},{"line_number":804,"context_line":"                                    \u0027exception\u0027: ex})"},{"line_number":805,"context_line":"        if fixed_ips_added !\u003d len(ports): "},{"line_number":806,"context_line":"            raise exception.NetworkNotFoundForInstance("},{"line_number":807,"context_line":"                    instance_id\u003dinstance.uuid)"},{"line_number":808,"context_line":"        return self._get_instance_nw_info(context, instance)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_6cdb811b","line":805,"updated":"2015-03-12 15:18:46.000000000","message":"whitespace","commit_id":"1ec516f290835e6b2a75e20bb12d99d4f48779c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"53501d9460df2a5f4192a03ff116530cb49b084e","unresolved":false,"context_lines":[{"line_number":803,"context_line":"                                    \u0027subnet_id\u0027: subnet[\u0027id\u0027],"},{"line_number":804,"context_line":"                                    \u0027exception\u0027: ex})"},{"line_number":805,"context_line":"        if fixed_ips_added !\u003d len(ports): "},{"line_number":806,"context_line":"            raise exception.NetworkNotFoundForInstance("},{"line_number":807,"context_line":"                    instance_id\u003dinstance.uuid)"},{"line_number":808,"context_line":"        return self._get_instance_nw_info(context, instance)"},{"line_number":809,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_ac04997e","line":806,"updated":"2015-03-12 15:18:46.000000000","message":"Need a better error here.","commit_id":"1ec516f290835e6b2a75e20bb12d99d4f48779c6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7091e6663fdb07539ff4b8a8a43084e1d88f3468","unresolved":false,"context_lines":[{"line_number":809,"context_line":"        self._get_instance_nw_info(context, instance)"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"    @base_api.refresh_cache"},{"line_number":812,"context_line":"    def remove_fixed_ip_from_instance(self, context, instance, address):"},{"line_number":813,"context_line":"        \"\"\"Remove a fixed ip from the instance.\"\"\""},{"line_number":814,"context_line":"        zone \u003d \u0027compute:%s\u0027 % instance.availability_zone"},{"line_number":815,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_cb0b65d4","line":812,"updated":"2015-03-12 19:59:33.000000000","message":"You also need to update this right?","commit_id":"b17d19f373bc6a72179422032a42dd6b3bc0faea"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ea2a9df03d86d961ae69d5d28947946b8d69233a","unresolved":false,"context_lines":[{"line_number":809,"context_line":"        self._get_instance_nw_info(context, instance)"},{"line_number":810,"context_line":""},{"line_number":811,"context_line":"    @base_api.refresh_cache"},{"line_number":812,"context_line":"    def remove_fixed_ip_from_instance(self, context, instance, address):"},{"line_number":813,"context_line":"        \"\"\"Remove a fixed ip from the instance.\"\"\""},{"line_number":814,"context_line":"        zone \u003d \u0027compute:%s\u0027 % instance.availability_zone"},{"line_number":815,"context_line":"        search_opts \u003d {\u0027device_id\u0027: instance.uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_b97cab21","line":812,"in_reply_to":"9a80dd14_cb0b65d4","updated":"2015-03-13 10:47:55.000000000","message":"i need to go over this one. i will update this in a sperate patch.\nthis whole feature is a mess and i am not even sure if it is used, why how and when.\nwe need to start to clean api\u0027s that are not used...","commit_id":"b17d19f373bc6a72179422032a42dd6b3bc0faea"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"4278deae387443bd8b719d10e95785986dae6fed","unresolved":false,"context_lines":[{"line_number":931,"context_line":"                subnets \u003d [{\u0027subnet_id\u0027: subnet[\u0027id\u0027]}"},{"line_number":932,"context_line":"                           for subnet in ipam_subnets]"},{"line_number":933,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: subnets}}"},{"line_number":934,"context_line":"                neutron.update_port(p[\u0027id\u0027], port_req_body)"},{"line_number":935,"context_line":""},{"line_number":936,"context_line":"    @base_api.refresh_cache"},{"line_number":937,"context_line":"    def remove_fixed_ip_from_instance(self, context, instance, address):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_1fe6f1e7","line":934,"updated":"2015-07-15 19:07:11.000000000","message":"are you sure that all the failure conditions previously caught go away?","commit_id":"ae6ea660d945f5fe777da898897f3c9b6a230ba0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"7086e6c6da1b3651f239f1faad3a304a34cb45c4","unresolved":false,"context_lines":[{"line_number":931,"context_line":"                subnets \u003d [{\u0027subnet_id\u0027: subnet[\u0027id\u0027]}"},{"line_number":932,"context_line":"                           for subnet in ipam_subnets]"},{"line_number":933,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: subnets}}"},{"line_number":934,"context_line":"                neutron.update_port(p[\u0027id\u0027], port_req_body)"},{"line_number":935,"context_line":""},{"line_number":936,"context_line":"    @base_api.refresh_cache"},{"line_number":937,"context_line":"    def remove_fixed_ip_from_instance(self, context, instance, address):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a41bdd9_b7b585ed","line":934,"in_reply_to":"9a41bdd9_1fe6f1e7","updated":"2015-07-16 12:51:06.000000000","message":"good catch!","commit_id":"ae6ea660d945f5fe777da898897f3c9b6a230ba0"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e4910e2d1b30b03adb14bcdda2985123aafaa2e4","unresolved":false,"context_lines":[{"line_number":926,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: fixed_ips}}"},{"line_number":927,"context_line":"                try:"},{"line_number":928,"context_line":"                    neutron.update_port(p[\u0027id\u0027], port_req_body)"},{"line_number":929,"context_line":"                    return self._get_instance_nw_info(context, instance)"},{"line_number":930,"context_line":"                except Exception as ex:"},{"line_number":931,"context_line":"                    msg \u003d (\"Unable to update port %(portid)s on subnet \""},{"line_number":932,"context_line":"                           \"%(subnet_id)s with failure: %(exception)s\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa1b9901_34330616","side":"PARENT","line":929,"updated":"2015-09-04 17:28:02.000000000","message":"it feels like we should still do this, just after the loop?\n\nIf we don\u0027t do that, how does the network_info_catch get updated?","commit_id":"0e5cefcf1d4483e6792e916c81f31c46c6a6e60b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"150d14a8123f10ef3d671fdc3dc11a923ed41527","unresolved":false,"context_lines":[{"line_number":926,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: fixed_ips}}"},{"line_number":927,"context_line":"                try:"},{"line_number":928,"context_line":"                    neutron.update_port(p[\u0027id\u0027], port_req_body)"},{"line_number":929,"context_line":"                    return self._get_instance_nw_info(context, instance)"},{"line_number":930,"context_line":"                except Exception as ex:"},{"line_number":931,"context_line":"                    msg \u003d (\"Unable to update port %(portid)s on subnet \""},{"line_number":932,"context_line":"                           \"%(subnet_id)s with failure: %(exception)s\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_aea381b0","side":"PARENT","line":929,"in_reply_to":"fa1b9901_34330616","updated":"2015-09-10 15:20:02.000000000","message":"Done","commit_id":"0e5cefcf1d4483e6792e916c81f31c46c6a6e60b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e4910e2d1b30b03adb14bcdda2985123aafaa2e4","unresolved":false,"context_lines":[{"line_number":934,"context_line":"                                    \u0027subnet_id\u0027: subnet[\u0027id\u0027],"},{"line_number":935,"context_line":"                                    \u0027exception\u0027: ex})"},{"line_number":936,"context_line":""},{"line_number":937,"context_line":"        raise exception.NetworkNotFoundForInstance("},{"line_number":938,"context_line":"                instance_id\u003dinstance.uuid)"},{"line_number":939,"context_line":""},{"line_number":940,"context_line":"    @base_api.refresh_cache"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_3db8ce10","side":"PARENT","line":937,"updated":"2015-09-04 17:28:02.000000000","message":"don\u0027t we still need to raise this one, if there were no IPs found?","commit_id":"0e5cefcf1d4483e6792e916c81f31c46c6a6e60b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"150d14a8123f10ef3d671fdc3dc11a923ed41527","unresolved":false,"context_lines":[{"line_number":934,"context_line":"                                    \u0027subnet_id\u0027: subnet[\u0027id\u0027],"},{"line_number":935,"context_line":"                                    \u0027exception\u0027: ex})"},{"line_number":936,"context_line":""},{"line_number":937,"context_line":"        raise exception.NetworkNotFoundForInstance("},{"line_number":938,"context_line":"                instance_id\u003dinstance.uuid)"},{"line_number":939,"context_line":""},{"line_number":940,"context_line":"    @base_api.refresh_cache"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_6ed329d6","side":"PARENT","line":937,"in_reply_to":"da20952f_3db8ce10","updated":"2015-09-10 15:20:02.000000000","message":"Done","commit_id":"0e5cefcf1d4483e6792e916c81f31c46c6a6e60b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c76c9d18913339e703a5636d274a28fff9b8fc12","unresolved":false,"context_lines":[{"line_number":979,"context_line":"                    try:"},{"line_number":980,"context_line":"                        neutron.update_port(p[\u0027id\u0027], port_req_body)"},{"line_number":981,"context_line":"                    except Exception as ex:"},{"line_number":982,"context_line":"                        LOG.debug(\"Unable to update port %(portid)s. \""},{"line_number":983,"context_line":"                                  \" Exception: %(exception)s\","},{"line_number":984,"context_line":"                                  {\u0027portid\u0027: p[\u0027id\u0027],"},{"line_number":985,"context_line":"                                   \u0027exception\u0027: ex}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba15a1d1_c7963394","line":982,"updated":"2015-09-14 10:38:47.000000000","message":"I think if all the ports hit this case, we should still raise NetworkNotFoundForInstance","commit_id":"3e54cbbcb7ad2fbafaee57703e3cbdd076360c0a"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"3bc25652fd47a867733075e0d49ff0387770ea43","unresolved":false,"context_lines":[{"line_number":979,"context_line":"                    try:"},{"line_number":980,"context_line":"                        neutron.update_port(p[\u0027id\u0027], port_req_body)"},{"line_number":981,"context_line":"                    except Exception as ex:"},{"line_number":982,"context_line":"                        LOG.debug(\"Unable to update port %(portid)s. \""},{"line_number":983,"context_line":"                                  \" Exception: %(exception)s\","},{"line_number":984,"context_line":"                                  {\u0027portid\u0027: p[\u0027id\u0027],"},{"line_number":985,"context_line":"                                   \u0027exception\u0027: ex}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba15a1d1_2436a952","line":982,"in_reply_to":"ba15a1d1_c7963394","updated":"2015-09-16 09:20:50.000000000","message":"Done","commit_id":"3e54cbbcb7ad2fbafaee57703e3cbdd076360c0a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c76c9d18913339e703a5636d274a28fff9b8fc12","unresolved":false,"context_lines":[{"line_number":983,"context_line":"                                  \" Exception: %(exception)s\","},{"line_number":984,"context_line":"                                  {\u0027portid\u0027: p[\u0027id\u0027],"},{"line_number":985,"context_line":"                                   \u0027exception\u0027: ex}, instance\u003dinstance)"},{"line_number":986,"context_line":"        else:"},{"line_number":987,"context_line":"            raise exception.NetworkNotFoundForInstance("},{"line_number":988,"context_line":"                instance_id\u003dinstance.uuid)"},{"line_number":989,"context_line":"        return self._get_instance_nw_info(context, instance)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba15a1d1_c7ddd371","line":986,"updated":"2015-09-14 10:38:47.000000000","message":"this isn\u0027t really enough, we need to ensure at least one port has an IP address, otherwise raise this error, I think?","commit_id":"3e54cbbcb7ad2fbafaee57703e3cbdd076360c0a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b67c6fe73d7a5702c478d645e39c8883bf17877f","unresolved":false,"context_lines":[{"line_number":993,"context_line":"                # If there are no fixed_ips defined on the port then provide"},{"line_number":994,"context_line":"                # the subnet_id\u0027s to neutron. Neutron in turn will allocate"},{"line_number":995,"context_line":"                # a fixed ip from the subnet"},{"line_number":996,"context_line":"                if len(fixed_ips) \u003d\u003d 0:"},{"line_number":997,"context_line":"                    subnets \u003d [{\u0027subnet_id\u0027: subnet[\u0027id\u0027]}"},{"line_number":998,"context_line":"                               for subnet in ipam_subnets]"},{"line_number":999,"context_line":"                    port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: subnets}}"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_00cd55b6","line":996,"updated":"2015-09-17 12:14:32.000000000","message":"Hmm, no I am wondering about this one.\n\nIs this call normally used to add an additional IP to an existing port.\n\nOk, got confused about this now, sorry :S","commit_id":"fcd62215e36e6a6def0ded651ad215f18dffab7c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d379ddc6972f6143daf17f8bf2bdc5554a91441d","unresolved":false,"context_lines":[{"line_number":1024,"context_line":"        data \u003d neutron.list_ports(**search_opts)"},{"line_number":1025,"context_line":"        ports \u003d data[\u0027ports\u0027]"},{"line_number":1026,"context_line":"        for p in ports:"},{"line_number":1027,"context_line":"            for subnet in ipam_subnets:"},{"line_number":1028,"context_line":"                fixed_ips \u003d p[\u0027fixed_ips\u0027]"},{"line_number":1029,"context_line":"                fixed_ips.append({\u0027subnet_id\u0027: subnet[\u0027id\u0027]})"},{"line_number":1030,"context_line":"                port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: fixed_ips}}"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_f46d5333","side":"PARENT","line":1027,"updated":"2016-07-04 17:29:02.000000000","message":"So I think the intention here is to pick the first subnet with an available IP.\n\nAgreed, with multiple ports on a network, you would expect that to happen for each port on that network.","commit_id":"5ddda6712acc2ac65fbc0733786bc148601e45fa"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d379ddc6972f6143daf17f8bf2bdc5554a91441d","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"        # If the port does not have a fixed IP then neutron will"},{"line_number":1029,"context_line":"        # allocate an ip address from one of the subnets on"},{"line_number":1030,"context_line":"        # the network"},{"line_number":1031,"context_line":"        if ports:"},{"line_number":1032,"context_line":"            for p in ports:"},{"line_number":1033,"context_line":"                fixed_ips \u003d p[\u0027fixed_ips\u0027]"},{"line_number":1034,"context_line":"                # If there are no fixed_ips defined on the port then provide"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_94032f73","line":1031,"updated":"2016-07-04 17:29:02.000000000","message":"Nit: I don\u0027t think we need this, as we get {} not None, but I am fine with it here.","commit_id":"aa0238fbc7a6d752a8f0d3edaf55803de3bedcb8"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d379ddc6972f6143daf17f8bf2bdc5554a91441d","unresolved":false,"context_lines":[{"line_number":1037,"context_line":"                if len(fixed_ips) \u003d\u003d 0:"},{"line_number":1038,"context_line":"                    subnets \u003d [{\u0027subnet_id\u0027: subnet[\u0027id\u0027]}"},{"line_number":1039,"context_line":"                               for subnet in ipam_subnets]"},{"line_number":1040,"context_line":"                    port_req_body \u003d {\u0027port\u0027: {\u0027fixed_ips\u0027: subnets}}"},{"line_number":1041,"context_line":"                    try:"},{"line_number":1042,"context_line":"                        neutron.update_port(p[\u0027id\u0027], port_req_body)"},{"line_number":1043,"context_line":"                        port_updated \u003d True"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_f4543355","line":1040,"updated":"2016-07-04 17:29:02.000000000","message":"What I think this means is give me a fixed_ip on every subnet that is possible, which is a very different intent to the original here.","commit_id":"aa0238fbc7a6d752a8f0d3edaf55803de3bedcb8"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e4910e2d1b30b03adb14bcdda2985123aafaa2e4","unresolved":false,"context_lines":[{"line_number":2836,"context_line":"                        \u0027gateway_ip\u0027: \u002720.0.1.1\u0027,"},{"line_number":2837,"context_line":"                        \u0027dns_nameservers\u0027: [\u00278.8.1.1\u0027, \u00278.8.1.2\u0027]}]"},{"line_number":2838,"context_line":"        with contextlib.nested("},{"line_number":2839,"context_line":"            mock.patch.object(client.Client, \"list_subnets\","},{"line_number":2840,"context_line":"                              return_value\u003d{\u0027subnets\u0027: subnet_data}),"},{"line_number":2841,"context_line":"            mock.patch.object(client.Client, \"list_ports\","},{"line_number":2842,"context_line":"                              return_value\u003d{\u0027ports\u0027: port_data}),"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_9d1c7a67","line":2839,"updated":"2015-09-04 17:28:02.000000000","message":"Nit: its often easier to use the decorator form here.","commit_id":"24479bb2183d501bf6e62d613fab206101201026"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"150d14a8123f10ef3d671fdc3dc11a923ed41527","unresolved":false,"context_lines":[{"line_number":2836,"context_line":"                        \u0027gateway_ip\u0027: \u002720.0.1.1\u0027,"},{"line_number":2837,"context_line":"                        \u0027dns_nameservers\u0027: [\u00278.8.1.1\u0027, \u00278.8.1.2\u0027]}]"},{"line_number":2838,"context_line":"        with contextlib.nested("},{"line_number":2839,"context_line":"            mock.patch.object(client.Client, \"list_subnets\","},{"line_number":2840,"context_line":"                              return_value\u003d{\u0027subnets\u0027: subnet_data}),"},{"line_number":2841,"context_line":"            mock.patch.object(client.Client, \"list_ports\","},{"line_number":2842,"context_line":"                              return_value\u003d{\u0027ports\u0027: port_data}),"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_eea4194c","line":2839,"in_reply_to":"da20952f_9d1c7a67","updated":"2015-09-10 15:20:02.000000000","message":"i am not sure that we can do that here as we return specific subnet data here","commit_id":"24479bb2183d501bf6e62d613fab206101201026"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e4910e2d1b30b03adb14bcdda2985123aafaa2e4","unresolved":false,"context_lines":[{"line_number":2843,"context_line":"            mock.patch.object(client.Client, \u0027update_port\u0027)) as ("},{"line_number":2844,"context_line":"            mock_list_subnets, mock_list_ports, mock_update_port):"},{"line_number":2845,"context_line":"            network_id \u003d \u0027my_netid1\u0027"},{"line_number":2846,"context_line":"            api.add_fixed_ip_to_instance(self.context,"},{"line_number":2847,"context_line":"                                         instance,"},{"line_number":2848,"context_line":"                                         network_id)"},{"line_number":2849,"context_line":"            search_opts \u003d {\u0027network_id\u0027: network_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_3d176e46","line":2846,"updated":"2015-09-04 17:28:02.000000000","message":"Nit: its much easier to read with a space either side of the function under test.","commit_id":"24479bb2183d501bf6e62d613fab206101201026"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"150d14a8123f10ef3d671fdc3dc11a923ed41527","unresolved":false,"context_lines":[{"line_number":2843,"context_line":"            mock.patch.object(client.Client, \u0027update_port\u0027)) as ("},{"line_number":2844,"context_line":"            mock_list_subnets, mock_list_ports, mock_update_port):"},{"line_number":2845,"context_line":"            network_id \u003d \u0027my_netid1\u0027"},{"line_number":2846,"context_line":"            api.add_fixed_ip_to_instance(self.context,"},{"line_number":2847,"context_line":"                                         instance,"},{"line_number":2848,"context_line":"                                         network_id)"},{"line_number":2849,"context_line":"            search_opts \u003d {\u0027network_id\u0027: network_id}"}],"source_content_type":"text/x-python","patch_set":8,"id":"da20952f_6e6fa9fc","line":2846,"in_reply_to":"da20952f_3d176e46","updated":"2015-09-10 15:20:02.000000000","message":"Done","commit_id":"24479bb2183d501bf6e62d613fab206101201026"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c76c9d18913339e703a5636d274a28fff9b8fc12","unresolved":false,"context_lines":[{"line_number":2872,"context_line":"                              return_value\u003d{\u0027subnets\u0027: subnet_data}),"},{"line_number":2873,"context_line":"            mock.patch.object(client.Client, \"list_ports\","},{"line_number":2874,"context_line":"                              return_value\u003d{\u0027ports\u0027: port_data}),"},{"line_number":2875,"context_line":"            mock.patch.object(client.Client, \u0027update_port\u0027)) as ("},{"line_number":2876,"context_line":"            mock_list_subnets, mock_list_ports, mock_update_port):"},{"line_number":2877,"context_line":"            network_id \u003d \u0027my_netid1\u0027"},{"line_number":2878,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba15a1d1_c74b932a","line":2875,"updated":"2015-09-14 10:38:47.000000000","message":"In response to your previous comment, if you use the @patch decorator, you just set the return_value on the mock object passed into the method, which looks just like a regular \"setup\" phase of a unit tests.\n\nBut not going to block on this.","commit_id":"3e54cbbcb7ad2fbafaee57703e3cbdd076360c0a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"171a00fe8a4cc12a75bb38824beabfe86f828394","unresolved":false,"context_lines":[{"line_number":3040,"context_line":"                    \u0027security_groups\u0027: []}"},{"line_number":3041,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context, **instance)"},{"line_number":3042,"context_line":"        api \u003d neutronapi.API()"},{"line_number":3043,"context_line":"        port_data \u003d [{\u0027network_id\u0027: \u0027my_netid1\u0027,"},{"line_number":3044,"context_line":"                      \u0027device_id\u0027: instance.uuid,"},{"line_number":3045,"context_line":"                      \u0027tenant_id\u0027: \u0027fake-tenant\u0027,"},{"line_number":3046,"context_line":"                      \u0027device_owner\u0027: \u0027compute:nova\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_8ff83ae7","line":3043,"updated":"2016-07-04 17:31:18.000000000","message":"Thinking about it, should we not be testing the case where we get multiple ports? As I think thats the thing we really want to fix.","commit_id":"aa0238fbc7a6d752a8f0d3edaf55803de3bedcb8"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"171a00fe8a4cc12a75bb38824beabfe86f828394","unresolved":false,"context_lines":[{"line_number":3082,"context_line":"            port_req_body \u003d {"},{"line_number":3083,"context_line":"                \u0027port\u0027: {"},{"line_number":3084,"context_line":"                    \u0027fixed_ips\u0027: [{\u0027subnet_id\u0027: \u0027my_subid1\u0027},"},{"line_number":3085,"context_line":"                                  {\u0027subnet_id\u0027: \u0027my_subid2\u0027}],"},{"line_number":3086,"context_line":"                 },"},{"line_number":3087,"context_line":"            }"},{"line_number":3088,"context_line":"            mock_update_port.assert_called_with(\u0027my_portid1\u0027, port_req_body)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_ef961e93","line":3085,"updated":"2016-07-04 17:31:18.000000000","message":"I think this is requesting multiple fixed_ips for the port.\n\nI think want we want is multiple ports all getting one (extra) fixed IP assigned in the network.","commit_id":"aa0238fbc7a6d752a8f0d3edaf55803de3bedcb8"}]}
