)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"b7546b09ca4f7c4c0ba5ace6f5648205999e4296","unresolved":false,"context_lines":[{"line_number":18,"context_line":"port-id\u0027 opt is only supported with neutron). The patch also"},{"line_number":19,"context_line":"adds unit tests to verify the behavior + changes."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Based on original work from Aaron Rosen \u003caaronorosen@gmail.com\u003e"},{"line_number":22,"context_line":"for which you can see a stale patch review here:"},{"line_number":23,"context_line":"https://review.openstack.org/#/c/77043/"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"baa201ad_b08b7fc1","line":21,"updated":"2014-10-09 05:11:58.000000000","message":"nit: I think we can deleted this and say Co-author Aaron Rosen \u003caaronorosen@gmail.com\u003e","commit_id":"bff0074b405740a6d296d26a5eba4efa3e4eac0f"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"aa61896ef6c5649a472775b5e85d132245a85ce9","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Based on original work from Aaron Rosen \u003caaronorosen@gmail.com\u003e"},{"line_number":22,"context_line":"for which you can see a stale patch review here:"},{"line_number":23,"context_line":"https://review.openstack.org/#/c/77043/"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Change-Id: Ia5367cf064d40690670ffeac3c1f16998464c234"},{"line_number":26,"context_line":"Closes-bug: 1158684"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"baa201ad_5bb1048e","line":23,"updated":"2014-10-15 06:49:50.000000000","message":"nit: better to use:\n\nCo-authored-by: Aaron Rosen \u003caaronorosen@gmail.com\u003e","commit_id":"182273c52d630859c0d5d5814189295448fabbf7"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"6a17053728225cd925ef21f1e3b4b728b2b4be3a","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Based on original work from Aaron Rosen \u003caaronorosen@gmail.com\u003e"},{"line_number":22,"context_line":"for which you can see a stale patch review here:"},{"line_number":23,"context_line":"https://review.openstack.org/#/c/77043/"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Change-Id: Ia5367cf064d40690670ffeac3c1f16998464c234"},{"line_number":26,"context_line":"Closes-bug: 1158684"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9aa7fdbe_612d8246","line":23,"in_reply_to":"baa201ad_5bb1048e","updated":"2014-10-21 16:34:35.000000000","message":"added \u0027Co-authored-by\u0027 as you suggested, but also left existing text.. IMO referring to that stale review is good context for the questions which were raised during Aaron\u0027s work. thanks","commit_id":"182273c52d630859c0d5d5814189295448fabbf7"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"04f1acbc3775879ab78638bef05859ba99b68bdb","unresolved":false,"context_lines":[{"line_number":21,"context_line":"Based on original work from Aaron Rosen \u003caaronorosen@gmail.com\u003e"},{"line_number":22,"context_line":"for which you can see a stale patch review here:"},{"line_number":23,"context_line":"https://review.openstack.org/#/c/77043/"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Co-authored-by: Aaron Rosen \u003caaronorosen@gmail.com\u003e"},{"line_number":26,"context_line":"Co-authored-by: Davanum Srinivas \u003cdavanum@gmail.com\u003e"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":29,"id":"9a80dd14_9c7691d7","line":24,"updated":"2015-03-04 09:37:27.000000000","message":"I think that we need a DocImpact or an APIImpact flag here. The reason is that say one has developed and app to spin up and manage VM\u0027s. Up until now they may create a neutron port and that port would be blown away when the instance was deleted.\nNow running that same application over and over again would now result in the neutron ports not being deleted and the tenant reaching their port quota.\nSo this change actually has side effects on people already deploying Nova dn Neutron and expecting the ports to be deleted (due to the fact that had this bug/feature).\n\nSo at the end of the day this has deployer impact.","commit_id":"5293c8bd7a210c01612ae34ecae84d8afa40e3a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1a8c1e5d4971ff5142207727c74c62fbe7a85413","unresolved":false,"context_lines":[{"line_number":13,"context_line":"expect it to only be unbound from the server on delete."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch allow the existing port to be unbound from the instance"},{"line_number":16,"context_line":"on server delete whereupon the port will still exist by not"},{"line_number":17,"context_line":"be associated with the instance in neutron (note the \u0027--nic"},{"line_number":18,"context_line":"port-id\u0027 opt is only supported with neutron). The patch also"},{"line_number":19,"context_line":"adds unit tests to verify the behavior + changes."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"9a80dd14_a5d7144a","line":16,"updated":"2015-03-07 23:40:36.000000000","message":"s/by not/but not/","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"56e640d4b4ba1ee3031ddfdf5a914a7de7824ddd","unresolved":false,"context_lines":[{"line_number":13,"context_line":"expect it to only be unbound from the server on delete."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"This patch allow the existing port to be unbound from the instance"},{"line_number":16,"context_line":"on server delete whereupon the port will still exist by not"},{"line_number":17,"context_line":"be associated with the instance in neutron (note the \u0027--nic"},{"line_number":18,"context_line":"port-id\u0027 opt is only supported with neutron). The patch also"},{"line_number":19,"context_line":"adds unit tests to verify the behavior + changes."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":31,"id":"9a80dd14_e5474c75","line":16,"in_reply_to":"9a80dd14_a5d7144a","updated":"2015-03-08 02:04:06.000000000","message":"Done","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"}],"nova/compute/manager.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1f6e6cd7d3933f9d7da16854f1ce975bedb71315","unresolved":false,"context_lines":[{"line_number":2531,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2532,"context_line":"                                              \"delete.start\")"},{"line_number":2533,"context_line":"            self._shutdown_instance(context, instance, bdms)"},{"line_number":2534,"context_line":"            instance.info_cache.delete()"},{"line_number":2535,"context_line":"            # NOTE(vish): We have already deleted the instance, so we have"},{"line_number":2536,"context_line":"            #             to ignore problems cleaning up the volumes. It"},{"line_number":2537,"context_line":"            #             would be nice to let the user know somehow that"}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_fa7af023","line":2534,"updated":"2015-02-16 13:03:38.000000000","message":"nice! maybe we can split this into a separate patch - that may help it land sooner","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"8ae41b00727ed68c5a20318baaf4870d1afdb074","unresolved":false,"context_lines":[{"line_number":2531,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2532,"context_line":"                                              \"delete.start\")"},{"line_number":2533,"context_line":"            self._shutdown_instance(context, instance, bdms)"},{"line_number":2534,"context_line":"            instance.info_cache.delete()"},{"line_number":2535,"context_line":"            # NOTE(vish): We have already deleted the instance, so we have"},{"line_number":2536,"context_line":"            #             to ignore problems cleaning up the volumes. It"},{"line_number":2537,"context_line":"            #             would be nice to let the user know somehow that"}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_4e809a8b","line":2534,"in_reply_to":"da86d52c_fa7af023","updated":"2015-02-16 14:57:10.000000000","message":"@garyk, leaving this alone (not my patch, just shepherding boden\u0027s)","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1a8c1e5d4971ff5142207727c74c62fbe7a85413","unresolved":false,"context_lines":[{"line_number":2545,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2546,"context_line":"                                              \"delete.start\")"},{"line_number":2547,"context_line":"            self._shutdown_instance(context, instance, bdms)"},{"line_number":2548,"context_line":"            instance.info_cache.delete()"},{"line_number":2549,"context_line":"            # NOTE(vish): We have already deleted the instance, so we have"},{"line_number":2550,"context_line":"            #             to ignore problems cleaning up the volumes. It"},{"line_number":2551,"context_line":"            #             would be nice to let the user know somehow that"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a80dd14_45bc9806","line":2548,"updated":"2015-03-07 23:40:36.000000000","message":"/me wonders why this change here was needed...\n\nI\u0027m unaware of any information from instance.info_cache would be needed in _shutdown_instance() to make this changed necessary.\n\nIf there *isn\u0027t* something that is in instance.info_cache that _shutdown_instance() needs, then I\u0027d recommend not making this change. If there *is* something in instance.info_cache that _shutdown_instance() needs, then please do place a code comment here explaining what that would be.","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"56e640d4b4ba1ee3031ddfdf5a914a7de7824ddd","unresolved":false,"context_lines":[{"line_number":2545,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2546,"context_line":"                                              \"delete.start\")"},{"line_number":2547,"context_line":"            self._shutdown_instance(context, instance, bdms)"},{"line_number":2548,"context_line":"            instance.info_cache.delete()"},{"line_number":2549,"context_line":"            # NOTE(vish): We have already deleted the instance, so we have"},{"line_number":2550,"context_line":"            #             to ignore problems cleaning up the volumes. It"},{"line_number":2551,"context_line":"            #             would be nice to let the user know somehow that"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a80dd14_05b2a093","line":2548,"in_reply_to":"9a80dd14_45bc9806","updated":"2015-03-08 02:04:06.000000000","message":"Please see Aaron\u0027s referenced changeset - https://review.openstack.org/#/c/77043/21/nova/compute/manager.py,cm","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"540cf7a06279c3682bf69108b2a9f8cccc967444","unresolved":false,"context_lines":[{"line_number":2545,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2546,"context_line":"                                              \"delete.start\")"},{"line_number":2547,"context_line":"            self._shutdown_instance(context, instance, bdms)"},{"line_number":2548,"context_line":"            instance.info_cache.delete()"},{"line_number":2549,"context_line":"            # NOTE(vish): We have already deleted the instance, so we have"},{"line_number":2550,"context_line":"            #             to ignore problems cleaning up the volumes. It"},{"line_number":2551,"context_line":"            #             would be nice to let the user know somehow that"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_7914e19f","line":2548,"updated":"2015-03-08 14:19:03.000000000","message":"Mind putting a code comment above to indicate why you\u0027re moving this? The snippet you added to the commit message would do. The reason I think it\u0027s important is because folks reading this code in the future might not realize why exactly this is ordered this way... :)","commit_id":"aa0308ff4d2536ae0e02b77888f2625adfdeffd1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"b55a17e45897e5133b37845921cabde99d5178e0","unresolved":false,"context_lines":[{"line_number":2545,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2546,"context_line":"                                              \"delete.start\")"},{"line_number":2547,"context_line":"            self._shutdown_instance(context, instance, bdms)"},{"line_number":2548,"context_line":"            instance.info_cache.delete()"},{"line_number":2549,"context_line":"            # NOTE(vish): We have already deleted the instance, so we have"},{"line_number":2550,"context_line":"            #             to ignore problems cleaning up the volumes. It"},{"line_number":2551,"context_line":"            #             would be nice to let the user know somehow that"}],"source_content_type":"text/x-python","patch_set":33,"id":"9a80dd14_79330114","line":2548,"in_reply_to":"9a80dd14_7914e19f","updated":"2015-03-08 14:53:25.000000000","message":"Done","commit_id":"aa0308ff4d2536ae0e02b77888f2625adfdeffd1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":2545,"context_line":"            self._notify_about_instance_usage(context, instance,"},{"line_number":2546,"context_line":"                                              \"delete.start\")"},{"line_number":2547,"context_line":"            self._shutdown_instance(context, instance, bdms)"},{"line_number":2548,"context_line":"            # NOTE(dims): instance.info_cache.delete() should be called after"},{"line_number":2549,"context_line":"            # _shutdown_instance in the compute manager as shutdown calls"},{"line_number":2550,"context_line":"            # deallocate_for_instance so the info_cache is still needed"},{"line_number":2551,"context_line":"            # at this point."}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_f331a95a","line":2548,"updated":"2015-03-09 21:38:00.000000000","message":"We could totally make this a separate dependent change at this point, but it would probably make everyone\u0027s head explode so I won\u0027t push for it. :)","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"b7546b09ca4f7c4c0ba5ace6f5648205999e4296","unresolved":false,"context_lines":[{"line_number":425,"context_line":"                    ports_in_requested_order.append(created_port)"},{"line_number":426,"context_line":"            except Exception:"},{"line_number":427,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":428,"context_line":"                    for port_id in touched_port_ids:"},{"line_number":429,"context_line":"                        try:"},{"line_number":430,"context_line":"                            port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027}}"},{"line_number":431,"context_line":"                            # Requires admin creds to set port bindings"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_f0a8a721","side":"PARENT","line":428,"updated":"2014-10-09 05:11:58.000000000","message":"Nice clean up! Might be worth while breaking this part off into another patch set just for other reviews but i\u0027m okay with it.","commit_id":"8ba0d9188d492028fcf4e65f908aa2d3db571952"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"14a45ec14213da850be5024dbd05d725e99f9aff","unresolved":false,"context_lines":[{"line_number":425,"context_line":"                    ports_in_requested_order.append(created_port)"},{"line_number":426,"context_line":"            except Exception:"},{"line_number":427,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":428,"context_line":"                    for port_id in touched_port_ids:"},{"line_number":429,"context_line":"                        try:"},{"line_number":430,"context_line":"                            port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027}}"},{"line_number":431,"context_line":"                            # Requires admin creds to set port bindings"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_0a45efb2","side":"PARENT","line":428,"in_reply_to":"baa201ad_f0a8a721","updated":"2014-10-09 14:20:56.000000000","message":"will leave for now... if others think it should be separate I\u0027ll move. thanks","commit_id":"8ba0d9188d492028fcf4e65f908aa2d3db571952"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"b7546b09ca4f7c4c0ba5ace6f5648205999e4296","unresolved":false,"context_lines":[{"line_number":501,"context_line":"        for port in ports:"},{"line_number":502,"context_line":"            port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027, \u0027device_owner\u0027: \u0027\u0027}}"},{"line_number":503,"context_line":"            # Requires admin creds to set port bindings"},{"line_number":504,"context_line":"            if self._has_port_binding_extension(context):"},{"line_number":505,"context_line":"                port_req_body[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d None"},{"line_number":506,"context_line":"                port_client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":507,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_1048cbb1","line":504,"updated":"2014-10-09 05:11:58.000000000","message":"nit: we should move this outside the for loop so we don\u0027t need to do this each time for every port.","commit_id":"bff0074b405740a6d296d26a5eba4efa3e4eac0f"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"14a45ec14213da850be5024dbd05d725e99f9aff","unresolved":false,"context_lines":[{"line_number":501,"context_line":"        for port in ports:"},{"line_number":502,"context_line":"            port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027, \u0027device_owner\u0027: \u0027\u0027}}"},{"line_number":503,"context_line":"            # Requires admin creds to set port bindings"},{"line_number":504,"context_line":"            if self._has_port_binding_extension(context):"},{"line_number":505,"context_line":"                port_req_body[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d None"},{"line_number":506,"context_line":"                port_client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":507,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_0aeecfb4","line":504,"in_reply_to":"baa201ad_1048cbb1","updated":"2014-10-09 14:20:56.000000000","message":"Done... Good point.","commit_id":"bff0074b405740a6d296d26a5eba4efa3e4eac0f"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"b7546b09ca4f7c4c0ba5ace6f5648205999e4296","unresolved":false,"context_lines":[{"line_number":509,"context_line":"            try:"},{"line_number":510,"context_line":"                port_client.update_port(port, port_req_body)"},{"line_number":511,"context_line":"            except Exception:"},{"line_number":512,"context_line":"                msg \u003d _LE(\"Unable to reset device ID for port \u0027%s\u0027\")"},{"line_number":513,"context_line":"                LOG.exception(msg, port)"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def _delete_ports(self, neutron, instance, ports, raise_if_fail\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_d0d803f1","line":512,"updated":"2014-10-09 05:11:58.000000000","message":"nit: I think we should say s/reset/clear","commit_id":"bff0074b405740a6d296d26a5eba4efa3e4eac0f"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"14a45ec14213da850be5024dbd05d725e99f9aff","unresolved":false,"context_lines":[{"line_number":509,"context_line":"            try:"},{"line_number":510,"context_line":"                port_client.update_port(port, port_req_body)"},{"line_number":511,"context_line":"            except Exception:"},{"line_number":512,"context_line":"                msg \u003d _LE(\"Unable to reset device ID for port \u0027%s\u0027\")"},{"line_number":513,"context_line":"                LOG.exception(msg, port)"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":"    def _delete_ports(self, neutron, instance, ports, raise_if_fail\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_ea47cbba","line":512,"in_reply_to":"baa201ad_d0d803f1","updated":"2014-10-09 14:20:56.000000000","message":"Done","commit_id":"bff0074b405740a6d296d26a5eba4efa3e4eac0f"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"c9b9b1307c8a3d5f50340d937d2495a4fe998f96","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            # Requires admin creds to set port bindings"},{"line_number":505,"context_line":"            if port_binding:"},{"line_number":506,"context_line":"                port_req_body[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d None"},{"line_number":507,"context_line":"                port_client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":508,"context_line":"            else:"},{"line_number":509,"context_line":"                port_client \u003d neutronv2.get_client(context)"},{"line_number":510,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_dcd9e3f5","line":507,"updated":"2014-10-10 03:33:45.000000000","message":"Sorry you should also pull out port_client 507/509 out of this loop.","commit_id":"852087d1913e51e7fab72b206488fbf37dd77d5d"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"b0a3f1413dd3c4e5b8bad305a89ca69d344ccccb","unresolved":false,"context_lines":[{"line_number":504,"context_line":"            # Requires admin creds to set port bindings"},{"line_number":505,"context_line":"            if port_binding:"},{"line_number":506,"context_line":"                port_req_body[\u0027port\u0027][\u0027binding:host_id\u0027] \u003d None"},{"line_number":507,"context_line":"                port_client \u003d neutronv2.get_client(context, admin\u003dTrue)"},{"line_number":508,"context_line":"            else:"},{"line_number":509,"context_line":"                port_client \u003d neutronv2.get_client(context)"},{"line_number":510,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_b935d847","line":507,"in_reply_to":"baa201ad_dcd9e3f5","updated":"2014-10-13 13:46:23.000000000","message":"done","commit_id":"852087d1913e51e7fab72b206488fbf37dd77d5d"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"1c6b040545a5922e4292ee5c42ea0ddd0d967ef1","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        # NOTE(danms): This is an inner method intended to be called"},{"line_number":623,"context_line":"        # by other code that updates instance nwinfo. It *must* be"},{"line_number":624,"context_line":"        # called with the refresh_cache-%(instance_uuid) lock held!"},{"line_number":625,"context_line":"        LOG.debug(\u0027get_instance_nw_info()\u0027, instance\u003dinstance)"},{"line_number":626,"context_line":"        nw_info \u003d self._build_network_info_model(context, instance, networks,"},{"line_number":627,"context_line":"                                                 port_ids,"},{"line_number":628,"context_line":"                                                 preexisting_port_ids)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aa7fdbe_a9ae1ae4","line":625,"updated":"2014-10-24 08:01:36.000000000","message":"nit: better to change the log debug message to _get_instance_nw_info which is the same name with it\u0027s function, but it\u0027s okay to do it in another patch, or update it if you need to submit a new PS.","commit_id":"e78180d30774f01e74cc04bab208a32724d32182"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"3ba56af223d9c80546f91f8191aae04419b603ca","unresolved":false,"context_lines":[{"line_number":622,"context_line":"        # NOTE(danms): This is an inner method intended to be called"},{"line_number":623,"context_line":"        # by other code that updates instance nwinfo. It *must* be"},{"line_number":624,"context_line":"        # called with the refresh_cache-%(instance_uuid) lock held!"},{"line_number":625,"context_line":"        LOG.debug(\u0027get_instance_nw_info()\u0027, instance\u003dinstance)"},{"line_number":626,"context_line":"        nw_info \u003d self._build_network_info_model(context, instance, networks,"},{"line_number":627,"context_line":"                                                 port_ids,"},{"line_number":628,"context_line":"                                                 preexisting_port_ids)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aa7fdbe_6d72024b","line":625,"in_reply_to":"9aa7fdbe_a9ae1ae4","updated":"2014-10-29 17:25:19.000000000","message":"Done","commit_id":"e78180d30774f01e74cc04bab208a32724d32182"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"1c6b040545a5922e4292ee5c42ea0ddd0d967ef1","unresolved":false,"context_lines":[{"line_number":1375,"context_line":"                          cached value."},{"line_number":1376,"context_line":"        :param preexisting_port_ids - List of port_ids that nova didn\u0027t"},{"line_number":1377,"context_line":"                                      allocate and therefore shouldn\u0027t be"},{"line_number":1378,"context_line":"                                      deleted when an instance is deallocated."},{"line_number":1379,"context_line":"        \"\"\""},{"line_number":1380,"context_line":""},{"line_number":1381,"context_line":"        search_opts \u003d {\u0027tenant_id\u0027: instance[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aa7fdbe_a9953a88","line":1378,"updated":"2014-10-24 08:01:36.000000000","message":"better to explain what if the case of None, just like what port_ids said above.","commit_id":"e78180d30774f01e74cc04bab208a32724d32182"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"3ba56af223d9c80546f91f8191aae04419b603ca","unresolved":false,"context_lines":[{"line_number":1375,"context_line":"                          cached value."},{"line_number":1376,"context_line":"        :param preexisting_port_ids - List of port_ids that nova didn\u0027t"},{"line_number":1377,"context_line":"                                      allocate and therefore shouldn\u0027t be"},{"line_number":1378,"context_line":"                                      deleted when an instance is deallocated."},{"line_number":1379,"context_line":"        \"\"\""},{"line_number":1380,"context_line":""},{"line_number":1381,"context_line":"        search_opts \u003d {\u0027tenant_id\u0027: instance[\u0027project_id\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"9aa7fdbe_4dc37e38","line":1378,"in_reply_to":"9aa7fdbe_a9953a88","updated":"2014-10-29 17:25:19.000000000","message":"Done","commit_id":"e78180d30774f01e74cc04bab208a32724d32182"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1f6e6cd7d3933f9d7da16854f1ce975bedb71315","unresolved":false,"context_lines":[{"line_number":583,"context_line":"                                                   pci_request_id,"},{"line_number":584,"context_line":"                                                   port_req_body)"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _unbind_ports(self, context, ports):"},{"line_number":587,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":588,"context_line":"        device_owner."},{"line_number":589,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_9a7bb4f3","line":586,"updated":"2015-02-16 13:03:38.000000000","message":"why not pass neutron as a parameter here (it was initiated on line 350?\n\ni would personally go for the option that these are set as None or can be passed from the calling method","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1f6e6cd7d3933f9d7da16854f1ce975bedb71315","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        # a number of different calls for the instance allocation."},{"line_number":593,"context_line":"        # We do not want to create a new neutron session for each of these"},{"line_number":594,"context_line":"        # calls."},{"line_number":595,"context_line":"        neutron \u003d get_client(context)"},{"line_number":596,"context_line":"        port_binding \u003d self._has_port_binding_extension(context,"},{"line_number":597,"context_line":"                           refresh_cache\u003dTrue, neutron\u003dneutron)"},{"line_number":598,"context_line":"        # Requires admin creds to set port bindings"}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_7a11a0ae","line":595,"updated":"2015-02-16 13:03:38.000000000","message":"see above - we could get this from a parameter instead of creating it again","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1f6e6cd7d3933f9d7da16854f1ce975bedb71315","unresolved":false,"context_lines":[{"line_number":597,"context_line":"                           refresh_cache\u003dTrue, neutron\u003dneutron)"},{"line_number":598,"context_line":"        # Requires admin creds to set port bindings"},{"line_number":599,"context_line":"        port_client \u003d (neutron if not port_binding else"},{"line_number":600,"context_line":"                       get_client(context, admin\u003dTrue))"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"        for port in ports:"},{"line_number":603,"context_line":"            port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: \u0027\u0027, \u0027device_owner\u0027: \u0027\u0027}}"}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_1a67c452","line":600,"updated":"2015-02-16 13:03:38.000000000","message":"we also have this from line 352","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1f6e6cd7d3933f9d7da16854f1ce975bedb71315","unresolved":false,"context_lines":[{"line_number":606,"context_line":"            try:"},{"line_number":607,"context_line":"                port_client.update_port(port, port_req_body)"},{"line_number":608,"context_line":"            except Exception:"},{"line_number":609,"context_line":"                msg \u003d _LE(\"Unable to clear device ID for port \u0027%s\u0027\")"},{"line_number":610,"context_line":"                LOG.exception(msg, port)"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"    def _delete_ports(self, neutron, instance, ports, raise_if_fail\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_ba0b187c","line":609,"updated":"2015-02-16 13:03:38.000000000","message":"dumb comment but do we need the msg variable here?","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"8ae41b00727ed68c5a20318baaf4870d1afdb074","unresolved":false,"context_lines":[{"line_number":606,"context_line":"            try:"},{"line_number":607,"context_line":"                port_client.update_port(port, port_req_body)"},{"line_number":608,"context_line":"            except Exception:"},{"line_number":609,"context_line":"                msg \u003d _LE(\"Unable to clear device ID for port \u0027%s\u0027\")"},{"line_number":610,"context_line":"                LOG.exception(msg, port)"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"    def _delete_ports(self, neutron, instance, ports, raise_if_fail\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_e9e948b8","line":609,"in_reply_to":"da86d52c_ba0b187c","updated":"2015-02-16 14:57:10.000000000","message":"Done","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":583,"context_line":"                                                   pci_request_id,"},{"line_number":584,"context_line":"                                                   port_req_body)"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _unbind_ports(self, context, ports):"},{"line_number":587,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":588,"context_line":"        device_owner."},{"line_number":589,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_0c685bf4","line":586,"updated":"2015-02-23 19:19:18.000000000","message":"It seems this _unbind_ports refactor should be a dependent change to lay the groundwork for the preexisting_ports stuff to use it, since this is really just consolidation of common code/logic for (de)allocate.  That would help move this change along if it was broken up more logically.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":583,"context_line":"                                                   pci_request_id,"},{"line_number":584,"context_line":"                                                   port_req_body)"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _unbind_ports(self, context, ports):"},{"line_number":587,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":588,"context_line":"        device_owner."},{"line_number":589,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_763b5938","line":586,"in_reply_to":"ba7be1f8_0c685bf4","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        # a number of different calls for the instance allocation."},{"line_number":593,"context_line":"        # We do not want to create a new neutron session for each of these"},{"line_number":594,"context_line":"        # calls."},{"line_number":595,"context_line":"        neutron \u003d get_client(context)"},{"line_number":596,"context_line":"        port_binding \u003d self._has_port_binding_extension(context,"},{"line_number":597,"context_line":"                           refresh_cache\u003dTrue, neutron\u003dneutron)"},{"line_number":598,"context_line":"        # Requires admin creds to set port bindings"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_4c033373","line":595,"updated":"2015-02-23 19:19:18.000000000","message":"Can\u0027t we just pass in neutron and port_client from allocate_for_instance so we don\u0027t have to duplicate this logic?  You could call port_client arg \u0027port_binding_client\u0027 or something to make it clear that you use that client for port binding stuff.\n\nLooks like deallocate_for_instance would just have to pass in \u0027neutron\u0027 since it doesn\u0027t have the port_client logic.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        # a number of different calls for the instance allocation."},{"line_number":593,"context_line":"        # We do not want to create a new neutron session for each of these"},{"line_number":594,"context_line":"        # calls."},{"line_number":595,"context_line":"        neutron \u003d get_client(context)"},{"line_number":596,"context_line":"        port_binding \u003d self._has_port_binding_extension(context,"},{"line_number":597,"context_line":"                           refresh_cache\u003dTrue, neutron\u003dneutron)"},{"line_number":598,"context_line":"        # Requires admin creds to set port bindings"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_f61669a6","line":595,"in_reply_to":"ba7be1f8_4c033373","updated":"2015-02-24 01:34:23.000000000","message":"Done.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":647,"context_line":"        ports \u003d set(ports) - ports_to_skip"},{"line_number":648,"context_line":""},{"line_number":649,"context_line":"        # Reset device_id and device_owner for the ports that are skipped"},{"line_number":650,"context_line":"        self._unbind_ports(context, ports_to_skip)"},{"line_number":651,"context_line":"        self._delete_ports(neutron, instance, ports, raise_if_fail\u003dTrue)"},{"line_number":652,"context_line":""},{"line_number":653,"context_line":"        # NOTE(arosen): This clears out the network_cache only if the instance"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_0c9a1b14","line":650,"updated":"2015-02-23 19:19:18.000000000","message":"This should be ports rather than ports_to_skip, right?  Isn\u0027t the point of ports_to_skip to...skip those ports?","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":647,"context_line":"        ports \u003d set(ports) - ports_to_skip"},{"line_number":648,"context_line":""},{"line_number":649,"context_line":"        # Reset device_id and device_owner for the ports that are skipped"},{"line_number":650,"context_line":"        self._unbind_ports(context, ports_to_skip)"},{"line_number":651,"context_line":"        self._delete_ports(neutron, instance, ports, raise_if_fail\u003dTrue)"},{"line_number":652,"context_line":""},{"line_number":653,"context_line":"        # NOTE(arosen): This clears out the network_cache only if the instance"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_b61cf1c2","line":650,"in_reply_to":"ba7be1f8_0c9a1b14","updated":"2015-02-24 01:34:23.000000000","message":"i renamed the method to reflect what it does better. we unbind only the ports that we are not going to delete.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":1438,"context_line":"        \"\"\""},{"line_number":1439,"context_line":"        net_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":1440,"context_line":"        if not net_info:"},{"line_number":1441,"context_line":"            LOG.debug(\"Instance \u0027%(uuid)s\u0027 cache missing network info.\","},{"line_number":1442,"context_line":"                      {\u0027uuid\u0027: instance.uuid})"},{"line_number":1443,"context_line":"        return [vif[\u0027id\u0027] for vif in net_info"},{"line_number":1444,"context_line":"                if vif.get(\u0027preserve_on_delete\u0027)]"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_ecc86724","line":1441,"updated":"2015-02-23 19:19:18.000000000","message":"nit: if you just pass instance\u003dinstance kwarg to LOG.debug the instance.uuid is automatically logged.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":1438,"context_line":"        \"\"\""},{"line_number":1439,"context_line":"        net_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":1440,"context_line":"        if not net_info:"},{"line_number":1441,"context_line":"            LOG.debug(\"Instance \u0027%(uuid)s\u0027 cache missing network info.\","},{"line_number":1442,"context_line":"                      {\u0027uuid\u0027: instance.uuid})"},{"line_number":1443,"context_line":"        return [vif[\u0027id\u0027] for vif in net_info"},{"line_number":1444,"context_line":"                if vif.get(\u0027preserve_on_delete\u0027)]"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_76fef939","line":1441,"in_reply_to":"ba7be1f8_ecc86724","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"            LOG.debug(\"Instance \u0027%(uuid)s\u0027 cache missing network info.\","},{"line_number":1442,"context_line":"                      {\u0027uuid\u0027: instance.uuid})"},{"line_number":1443,"context_line":"        return [vif[\u0027id\u0027] for vif in net_info"},{"line_number":1444,"context_line":"                if vif.get(\u0027preserve_on_delete\u0027)]"},{"line_number":1445,"context_line":""},{"line_number":1446,"context_line":"    def _build_network_info_model(self, context, instance, networks\u003dNone,"},{"line_number":1447,"context_line":"                                  port_ids\u003dNone, admin_client\u003dNone,"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_6f69c9bd","line":1444,"updated":"2015-02-23 19:19:18.000000000","message":"Are we already getting this information from neutron but we just weren\u0027t modeling it yet?","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":1441,"context_line":"            LOG.debug(\"Instance \u0027%(uuid)s\u0027 cache missing network info.\","},{"line_number":1442,"context_line":"                      {\u0027uuid\u0027: instance.uuid})"},{"line_number":1443,"context_line":"        return [vif[\u0027id\u0027] for vif in net_info"},{"line_number":1444,"context_line":"                if vif.get(\u0027preserve_on_delete\u0027)]"},{"line_number":1445,"context_line":""},{"line_number":1446,"context_line":"    def _build_network_info_model(self, context, instance, networks\u003dNone,"},{"line_number":1447,"context_line":"                                  port_ids\u003dNone, admin_client\u003dNone,"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_36bba173","line":1444,"in_reply_to":"ba7be1f8_6f69c9bd","updated":"2015-02-24 01:34:23.000000000","message":"yep, i believe so.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"        :param preexisting_port_ids - List of port_ids that nova didn\u0027t"},{"line_number":1462,"context_line":"                                      allocate and therefore shouldn\u0027t be"},{"line_number":1463,"context_line":"                                      deleted when an instance is deallocated."},{"line_number":1464,"context_line":"                                      If value is None the value will be"},{"line_number":1465,"context_line":"                                      populated from existing cached value."},{"line_number":1466,"context_line":"        \"\"\""},{"line_number":1467,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_0cf3fb73","line":1464,"updated":"2015-02-23 19:19:18.000000000","message":"None and/or empty?","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":1461,"context_line":"        :param preexisting_port_ids - List of port_ids that nova didn\u0027t"},{"line_number":1462,"context_line":"                                      allocate and therefore shouldn\u0027t be"},{"line_number":1463,"context_line":"                                      deleted when an instance is deallocated."},{"line_number":1464,"context_line":"                                      If value is None the value will be"},{"line_number":1465,"context_line":"                                      populated from existing cached value."},{"line_number":1466,"context_line":"        \"\"\""},{"line_number":1467,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_b68f91cb","line":1464,"in_reply_to":"ba7be1f8_0cf3fb73","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1a8c1e5d4971ff5142207727c74c62fbe7a85413","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                        network_uuid\u003dnet[\u0027id\u0027])"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    def _unbind_ports(self, context, ports,"},{"line_number":316,"context_line":"                      neutron\u003dNone, port_binding\u003dNone):"},{"line_number":317,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":318,"context_line":"        device_owner."},{"line_number":319,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"9a80dd14_254a4426","line":316,"updated":"2015-03-07 23:40:36.000000000","message":"I don\u0027t understand why you changed the name of this parameter. The callers are passing a *client* object (with elevated context), not a port binding dict. Recommend returning this to be named port_client.","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"56e640d4b4ba1ee3031ddfdf5a914a7de7824ddd","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                        network_uuid\u003dnet[\u0027id\u0027])"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    def _unbind_ports(self, context, ports,"},{"line_number":316,"context_line":"                      neutron\u003dNone, port_binding\u003dNone):"},{"line_number":317,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":318,"context_line":"        device_owner."},{"line_number":319,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"9a80dd14_854cd09f","line":316,"in_reply_to":"9a80dd14_254a4426","updated":"2015-03-08 02:04:06.000000000","message":"ack","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":313,"context_line":"                        network_uuid\u003dnet[\u0027id\u0027])"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"    def _unbind_ports(self, context, ports,"},{"line_number":316,"context_line":"                      neutron\u003dNone, port_client\u003dNone):"},{"line_number":317,"context_line":"        \"\"\"Unbind the given ports by clearing their device_id and"},{"line_number":318,"context_line":"        device_owner."},{"line_number":319,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_130c7d93","line":316,"updated":"2015-03-09 21:38:00.000000000","message":"The neutron parameter shouldn\u0027t be optional, so I\u0027d drop the neutron\u003dNone here.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        # a number of different calls for the instance allocation."},{"line_number":329,"context_line":"        # We do not want to create a new neutron session for each of these"},{"line_number":330,"context_line":"        # calls."},{"line_number":331,"context_line":"        if neutron is None:"},{"line_number":332,"context_line":"            neutron \u003d get_client(context)"},{"line_number":333,"context_line":"        port_binding \u003d self._has_port_binding_extension(context,"},{"line_number":334,"context_line":"                            refresh_cache\u003dTrue, neutron\u003dneutron)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_7324d90c","line":331,"updated":"2015-03-09 21:38:00.000000000","message":"This shouldn\u0027t be necessary, everything calling this method has a neutron client already.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":686,"context_line":"        \"\"\""},{"line_number":687,"context_line":"        preexisting_ports \u003d self._get_preexisting_port_ids(instance)"},{"line_number":688,"context_line":"        if port_id in preexisting_ports:"},{"line_number":689,"context_line":"            self._unbind_ports(context, [port_id])"},{"line_number":690,"context_line":"        else:"},{"line_number":691,"context_line":"            neutron \u003d get_client(context)"},{"line_number":692,"context_line":"            self._delete_ports(neutron, instance, [port_id],"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_4ee00c29","line":689,"updated":"2015-03-09 21:38:00.000000000","message":"After this, wouldn\u0027t / couldn\u0027t we remove port_id from preexisting_ports and then pass that to get_instance_nw_info to update the cache since the port is no longer associated with the instance?  Since it wouldn\u0027t be in current_neutron_ports in _build_network_info_model it wouldn\u0027t be processed anyway, so probably not a big deal to leave it.  It would keep the size of the cache down though if that port was never attached to the instance again, and allocate_port_for_instance will add it back in later if it\u0027s needed.\n\nBut on second thought (or third), we rebuild the nw info cache fresh each time so either way it\u0027s going to be gone, we\u0027d just save ourselves another call to self._get_preexisting_port_ids.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":688,"context_line":"        if port_id in preexisting_ports:"},{"line_number":689,"context_line":"            self._unbind_ports(context, [port_id])"},{"line_number":690,"context_line":"        else:"},{"line_number":691,"context_line":"            neutron \u003d get_client(context)"},{"line_number":692,"context_line":"            self._delete_ports(neutron, instance, [port_id],"},{"line_number":693,"context_line":"                               raise_if_fail\u003dTrue)"},{"line_number":694,"context_line":"        return self.get_instance_nw_info(context, instance)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_f37fe9dd","line":691,"updated":"2015-03-09 21:38:00.000000000","message":"Move this above the if condition above so we can pass it to _unbind_ports.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":1453,"context_line":"        These ports were not created by nova and hence should not be"},{"line_number":1454,"context_line":"        deallocated upon instance deletion."},{"line_number":1455,"context_line":"        \"\"\""},{"line_number":1456,"context_line":"        net_info \u003d compute_utils.get_nw_info_for_instance(instance)"},{"line_number":1457,"context_line":"        if not net_info:"},{"line_number":1458,"context_line":"            LOG.debug(\u0027Instance cache missing network info.\u0027,"},{"line_number":1459,"context_line":"                      instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_d398251e","line":1456,"updated":"2015-03-09 21:38:00.000000000","message":"I was worried about a potential infinite loop if this called back into _get_instance_nw_info but it doesn\u0027t:\n\nhttp://git.openstack.org/cgit/openstack/nova/tree/nova/compute/utils.py#n385","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e1349e1b35044366c51d88c40e662ddc131e6737","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        # a number of different calls for the instance allocation."},{"line_number":329,"context_line":"        # We do not want to create a new neutron session for each of these"},{"line_number":330,"context_line":"        # calls."},{"line_number":331,"context_line":"        if neutron is None:"},{"line_number":332,"context_line":"            neutron \u003d get_client(context)"},{"line_number":333,"context_line":"        port_binding \u003d self._has_port_binding_extension(context,"},{"line_number":334,"context_line":"                            refresh_cache\u003dTrue, neutron\u003dneutron)"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a80dd14_6d805147","line":331,"updated":"2015-03-10 14:59:27.000000000","message":"This shouldn\u0027t happen, we can remove this logic.","commit_id":"d479e749ad86d8bc7ca31492ee4a439d48964283"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"d0601ad4e1b666853822309b1472b039c45ebd30","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        # a number of different calls for the instance allocation."},{"line_number":329,"context_line":"        # We do not want to create a new neutron session for each of these"},{"line_number":330,"context_line":"        # calls."},{"line_number":331,"context_line":"        if neutron is None:"},{"line_number":332,"context_line":"            neutron \u003d get_client(context)"},{"line_number":333,"context_line":"        port_binding \u003d self._has_port_binding_extension(context,"},{"line_number":334,"context_line":"                            refresh_cache\u003dTrue, neutron\u003dneutron)"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a80dd14_dbd9f323","line":331,"in_reply_to":"9a80dd14_6d805147","updated":"2015-03-10 15:15:51.000000000","message":"Done","commit_id":"d479e749ad86d8bc7ca31492ee4a439d48964283"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1a8c1e5d4971ff5142207727c74c62fbe7a85413","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        self.assertEqual([\u0027clear_events_for_instance\u0027,"},{"line_number":120,"context_line":"                          \u0027_notify_about_instance_usage\u0027,"},{"line_number":121,"context_line":"                          \u0027_shutdown_instance\u0027, \u0027delete\u0027],"},{"line_number":122,"context_line":"                         methods_called)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def test_allocate_network_succeeds_after_retries(self):"},{"line_number":125,"context_line":"        self.flags(network_allocate_retries\u003d8)"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a80dd14_a53394a9","line":122,"updated":"2015-03-07 23:40:36.000000000","message":"This style of unit test mocking is very difficult to read and follow. It\u0027s not clear to me what this has to do with the changes included in this patch?","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"56e640d4b4ba1ee3031ddfdf5a914a7de7824ddd","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        self.assertEqual([\u0027clear_events_for_instance\u0027,"},{"line_number":120,"context_line":"                          \u0027_notify_about_instance_usage\u0027,"},{"line_number":121,"context_line":"                          \u0027_shutdown_instance\u0027, \u0027delete\u0027],"},{"line_number":122,"context_line":"                         methods_called)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def test_allocate_network_succeeds_after_retries(self):"},{"line_number":125,"context_line":"        self.flags(network_allocate_retries\u003d8)"}],"source_content_type":"text/x-python","patch_set":31,"id":"9a80dd14_c53968f3","line":122,"in_reply_to":"9a80dd14_a53394a9","updated":"2015-03-08 02:04:06.000000000","message":"Added by Aaron in the patch/review referenced in the commit message - https://review.openstack.org/#/c/77043/21/nova/compute/manager.py,cm","commit_id":"6ce96f780b1b41b53c0999336f01b39f1f46bcd3"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":899,"context_line":"                objects\u003d[objects.NetworkRequest(port_id\u003d\u0027my_portid1\u0027)]))"},{"line_number":900,"context_line":"        self.assertEqual(self.port_data1, result)"},{"line_number":901,"context_line":""},{"line_number":902,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":903,"context_line":"    def test_allocate_for_instance_not_enough_macs_via_ports(self,"},{"line_number":904,"context_line":"                                                             mock_unbind):"},{"line_number":905,"context_line":"        # using a hypervisor MAC via a pre-created port will stop it being"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_0c04db13","line":902,"updated":"2015-02-23 19:19:18.000000000","message":"nit: could have just been:\n\n@mock.patch.object(neutronapi.API, \u0027_unbind_ports\u0027)","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":899,"context_line":"                objects\u003d[objects.NetworkRequest(port_id\u003d\u0027my_portid1\u0027)]))"},{"line_number":900,"context_line":"        self.assertEqual(self.port_data1, result)"},{"line_number":901,"context_line":""},{"line_number":902,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":903,"context_line":"    def test_allocate_for_instance_not_enough_macs_via_ports(self,"},{"line_number":904,"context_line":"                                                             mock_unbind):"},{"line_number":905,"context_line":"        # using a hypervisor MAC via a pre-created port will stop it being"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_22dfdb3c","line":902,"in_reply_to":"ba7be1f8_0c04db13","updated":"2015-02-24 01:34:23.000000000","message":"all the code below uses the what i already have, so leaving this as-is to keep the same style in the module","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":901,"context_line":""},{"line_number":902,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":903,"context_line":"    def test_allocate_for_instance_not_enough_macs_via_ports(self,"},{"line_number":904,"context_line":"                                                             mock_unbind):"},{"line_number":905,"context_line":"        # using a hypervisor MAC via a pre-created port will stop it being"},{"line_number":906,"context_line":"        # used to dynamically create a port on a network. We put the network"},{"line_number":907,"context_line":"        # first in requested_networks so that if the code were to not pre-check"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_4ce25304","line":904,"updated":"2015-02-23 19:19:18.000000000","message":"Shouldn\u0027t we be asserting that mock_unbind was called?","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":901,"context_line":""},{"line_number":902,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":903,"context_line":"    def test_allocate_for_instance_not_enough_macs_via_ports(self,"},{"line_number":904,"context_line":"                                                             mock_unbind):"},{"line_number":905,"context_line":"        # using a hypervisor MAC via a pre-created port will stop it being"},{"line_number":906,"context_line":"        # used to dynamically create a port on a network. We put the network"},{"line_number":907,"context_line":"        # first in requested_networks so that if the code were to not pre-check"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_a24aebc2","line":904,"in_reply_to":"ba7be1f8_4ce25304","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":920,"context_line":"                          macs\u003dset([\u0027my_mac1\u0027]))"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":923,"context_line":"    def test_allocate_for_instance_not_enough_macs(self, mock_unbind):"},{"line_number":924,"context_line":"        # If not enough MAC addresses are available to allocate to networks, an"},{"line_number":925,"context_line":"        # error should be raised."},{"line_number":926,"context_line":"        # We could pass in macs\u003dset(), but that wouldn\u0027t tell us that"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_8ce36b04","line":923,"updated":"2015-02-23 19:19:18.000000000","message":"Shouldn\u0027t we be asserting that mock_unbind was called?","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":920,"context_line":"                          macs\u003dset([\u0027my_mac1\u0027]))"},{"line_number":921,"context_line":""},{"line_number":922,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":923,"context_line":"    def test_allocate_for_instance_not_enough_macs(self, mock_unbind):"},{"line_number":924,"context_line":"        # If not enough MAC addresses are available to allocate to networks, an"},{"line_number":925,"context_line":"        # error should be raised."},{"line_number":926,"context_line":"        # We could pass in macs\u003dset(), but that wouldn\u0027t tell us that"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_822247ff","line":923,"in_reply_to":"ba7be1f8_8ce36b04","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":1030,"context_line":"        self.assertEqual(len(nwinfo), 0)"},{"line_number":1031,"context_line":""},{"line_number":1032,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":1033,"context_line":"    def test_allocate_for_instance_ex1(self, mock_unbind):"},{"line_number":1034,"context_line":"        \"\"\"verify we will delete created ports"},{"line_number":1035,"context_line":"        if we fail to allocate all net resources."},{"line_number":1036,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_4cb973e8","line":1033,"updated":"2015-02-23 19:19:18.000000000","message":"Shouldn\u0027t we be asserting that mock_unbind was called?","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":1030,"context_line":"        self.assertEqual(len(nwinfo), 0)"},{"line_number":1031,"context_line":""},{"line_number":1032,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":1033,"context_line":"    def test_allocate_for_instance_ex1(self, mock_unbind):"},{"line_number":1034,"context_line":"        \"\"\"verify we will delete created ports"},{"line_number":1035,"context_line":"        if we fail to allocate all net resources."},{"line_number":1036,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_a2210bfd","line":1033,"in_reply_to":"ba7be1f8_4cb973e8","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"        self.mox.ReplayAll()"},{"line_number":1282,"context_line":""},{"line_number":1283,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1284,"context_line":"        mock_preexisting \u003d mock.Mock()"},{"line_number":1285,"context_line":"        mock_preexisting.return_value \u003d []"},{"line_number":1286,"context_line":"        api._get_preexisting_port_ids \u003d mock_preexisting"},{"line_number":1287,"context_line":"        api.deallocate_for_instance(self.context, self.instance,"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_acbaef20","line":1284,"updated":"2015-02-23 19:19:18.000000000","message":"Would rather see this as a decorator like in test_deallocate_for_instance_uses_delete_helper.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":1281,"context_line":"        self.mox.ReplayAll()"},{"line_number":1282,"context_line":""},{"line_number":1283,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1284,"context_line":"        mock_preexisting \u003d mock.Mock()"},{"line_number":1285,"context_line":"        mock_preexisting.return_value \u003d []"},{"line_number":1286,"context_line":"        api._get_preexisting_port_ids \u003d mock_preexisting"},{"line_number":1287,"context_line":"        api.deallocate_for_instance(self.context, self.instance,"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_7d78942b","line":1284,"in_reply_to":"ba7be1f8_acbaef20","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"        self.mox.ReplayAll()"},{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1332,"context_line":"        mock_preexisting \u003d mock.Mock()"},{"line_number":1333,"context_line":"        mock_preexisting.return_value \u003d []"},{"line_number":1334,"context_line":"        api._get_preexisting_port_ids \u003d mock_preexisting"},{"line_number":1335,"context_line":"        api.deallocate_for_instance(self.context, self.instance)"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_ec830754","line":1332,"updated":"2015-02-23 19:19:18.000000000","message":"Would rather see this as a decorator like in test_deallocate_for_instance_uses_delete_helper.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":1329,"context_line":"        self.mox.ReplayAll()"},{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":"        api \u003d neutronapi.API()"},{"line_number":1332,"context_line":"        mock_preexisting \u003d mock.Mock()"},{"line_number":1333,"context_line":"        mock_preexisting.return_value \u003d []"},{"line_number":1334,"context_line":"        api._get_preexisting_port_ids \u003d mock_preexisting"},{"line_number":1335,"context_line":"        api.deallocate_for_instance(self.context, self.instance)"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_5d7d901b","line":1332,"in_reply_to":"ba7be1f8_ec830754","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":2432,"context_line":"    def test_build_network_info_model(self):"},{"line_number":2433,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2434,"context_line":""},{"line_number":2435,"context_line":"        class Dict(dict):"},{"line_number":2436,"context_line":"            pass"},{"line_number":2437,"context_line":"        fake_inst \u003d Dict({\u0027project_id\u0027: \u0027fake\u0027, \u0027uuid\u0027: \u0027uuid\u0027,"},{"line_number":2438,"context_line":"                          \u0027info_cache\u0027: {\u0027network_info\u0027: []}})"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_cc47234a","line":2435,"updated":"2015-02-23 19:19:18.000000000","message":"Why is this needed?  We should be using instance objects now so this is ugly.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":2432,"context_line":"    def test_build_network_info_model(self):"},{"line_number":2433,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2434,"context_line":""},{"line_number":2435,"context_line":"        class Dict(dict):"},{"line_number":2436,"context_line":"            pass"},{"line_number":2437,"context_line":"        fake_inst \u003d Dict({\u0027project_id\u0027: \u0027fake\u0027, \u0027uuid\u0027: \u0027uuid\u0027,"},{"line_number":2438,"context_line":"                          \u0027info_cache\u0027: {\u0027network_info\u0027: []}})"}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_1dd318d7","line":2435,"in_reply_to":"ba7be1f8_cc47234a","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dcbdde4c5f151b2d3840419548ad316b204902a3","unresolved":false,"context_lines":[{"line_number":3357,"context_line":"        self._test_get_client_for_admin(use_id\u003dTrue, admin_context\u003dTrue)"},{"line_number":3358,"context_line":""},{"line_number":3359,"context_line":""},{"line_number":3360,"context_line":"class TestNeutronV2NoMox(test.TestCase):"},{"line_number":3361,"context_line":"    # Unit tests using mock without all the setup() and teardown()"},{"line_number":3362,"context_line":"    # gunk in the TestNeutron2 class."},{"line_number":3363,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_ace82f11","line":3360,"updated":"2015-02-23 19:19:18.000000000","message":"Umm....this is what TestNeutronv2WithMock is for...so use that.","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"849ee1ed73cf3314b090390ade0d3915c64b1b33","unresolved":false,"context_lines":[{"line_number":3357,"context_line":"        self._test_get_client_for_admin(use_id\u003dTrue, admin_context\u003dTrue)"},{"line_number":3358,"context_line":""},{"line_number":3359,"context_line":""},{"line_number":3360,"context_line":"class TestNeutronV2NoMox(test.TestCase):"},{"line_number":3361,"context_line":"    # Unit tests using mock without all the setup() and teardown()"},{"line_number":3362,"context_line":"    # gunk in the TestNeutron2 class."},{"line_number":3363,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"ba7be1f8_7d36d4e8","line":3360,"in_reply_to":"ba7be1f8_ace82f11","updated":"2015-02-24 01:34:23.000000000","message":"Done","commit_id":"3aed20dfd644ebbb15e1002af720d647f94694d6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                          self.instance, requested_networks\u003drequested_networks,"},{"line_number":938,"context_line":"                          macs\u003dset([\u0027my_mac1\u0027]))"},{"line_number":939,"context_line":"        mock_unbind.assert_called_once_with(self.context, [],"},{"line_number":940,"context_line":"                                            mock.ANY, mock.ANY)"},{"line_number":941,"context_line":""},{"line_number":942,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API._unbind_ports\u0027)"},{"line_number":943,"context_line":"    def test_allocate_for_instance_not_enough_macs(self, mock_unbind):"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_ce7cfcee","line":940,"updated":"2015-03-09 21:38:00.000000000","message":"I\u0027m not a huge fan of the mock.ANY\u0027s here, wouldn\u0027t at least the first one be self.moxed_client?","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":960,"context_line":"                              requested_networks\u003drequested_networks,"},{"line_number":961,"context_line":"                              macs\u003dset([\u0027my_mac2\u0027]))"},{"line_number":962,"context_line":"        mock_unbind.assert_called_once_with(self.context, [],"},{"line_number":963,"context_line":"                                            mock.ANY, mock.ANY)"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    def test_allocate_for_instance_two_macs_two_networks(self):"},{"line_number":966,"context_line":"        # If two MACs are available and two networks requested, two new ports"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_4e700c0b","line":963,"updated":"2015-03-09 21:38:00.000000000","message":"Can\u0027t we change the first mock.ANY to self.moxed_client?","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":1112,"context_line":"                          self.context, self.instance,"},{"line_number":1113,"context_line":"                          requested_networks\u003drequested_networks)"},{"line_number":1114,"context_line":"        mock_unbind.assert_called_once_with(self.context, [],"},{"line_number":1115,"context_line":"                                            mock.ANY, mock.ANY)"},{"line_number":1116,"context_line":""},{"line_number":1117,"context_line":"    def test_allocate_for_instance_ex2(self):"},{"line_number":1118,"context_line":"        \"\"\"verify we have no port to delete"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_ee662050","line":1115,"updated":"2015-03-09 21:38:00.000000000","message":"ditto on mock.ANY","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":2616,"context_line":"        neutronapi.get_client(\u0027fake\u0027)"},{"line_number":2617,"context_line":"        fake_inst.info_cache \u003d objects.InstanceInfoCache.new("},{"line_number":2618,"context_line":"            self.context, \u0027fake-uuid\u0027)"},{"line_number":2619,"context_line":"        fake_inst.info_cache.network_info \u003d model.NetworkInfo.hydrate([])"},{"line_number":2620,"context_line":"        nw_infos \u003d api._build_network_info_model(self.context, fake_inst,"},{"line_number":2621,"context_line":"                                                 fake_nets,"},{"line_number":2622,"context_line":"                                                 [fake_ports[2][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_0e9ff403","line":2619,"updated":"2015-03-09 21:38:00.000000000","message":"Shouldn\u0027t we be using _fake_instance_info_cache now?","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":3316,"context_line":"        nw_req \u003d objects.NetworkRequestList("},{"line_number":3317,"context_line":"            objects \u003d [objects.NetworkRequest(network_id\u003d\u0027net-1\u0027,"},{"line_number":3318,"context_line":"                                              address\u003d\u0027192.168.0.3\u0027,"},{"line_number":3319,"context_line":"                                              port_id\u003d\u0027port-1\u0027,"},{"line_number":3320,"context_line":"                                              pci_request_id\u003d\u0027pci-1\u0027)])"},{"line_number":3321,"context_line":"        mock_gppids.return_value \u003d [\u0027port-3\u0027]"},{"line_number":3322,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_ce1b1c7f","line":3319,"updated":"2015-03-09 21:38:00.000000000","message":"So port-1 was requested in allocate_for_instance on boot.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":3318,"context_line":"                                              address\u003d\u0027192.168.0.3\u0027,"},{"line_number":3319,"context_line":"                                              port_id\u003d\u0027port-1\u0027,"},{"line_number":3320,"context_line":"                                              pci_request_id\u003d\u0027pci-1\u0027)])"},{"line_number":3321,"context_line":"        mock_gppids.return_value \u003d [\u0027port-3\u0027]"},{"line_number":3322,"context_line":""},{"line_number":3323,"context_line":"        self.api.deallocate_for_instance(mock.sentinel.ctx, mock_inst,"},{"line_number":3324,"context_line":"                                    requested_networks\u003dnw_req)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_0e129461","line":3321,"updated":"2015-03-09 21:38:00.000000000","message":"port-3 was pre-existing from info_cache (but this seems weird, should only be port-1 I\u0027d think).","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":3328,"context_line":"                                            mock.ANY)"},{"line_number":3329,"context_line":"        mock_deletep.assert_called_once_with(mock_nc,"},{"line_number":3330,"context_line":"                                             mock_inst,"},{"line_number":3331,"context_line":"                                             set([\u0027port-2\u0027]),"},{"line_number":3332,"context_line":"                                             raise_if_fail\u003dTrue)"},{"line_number":3333,"context_line":""},{"line_number":3334,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API.get_instance_nw_info\u0027)"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_8e05a415","line":3331,"updated":"2015-03-09 21:38:00.000000000","message":"And port-2 was created in allocate_for_instance so we delete it since nova created it.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":3341,"context_line":"                                                      mock_unbind,"},{"line_number":3342,"context_line":"                                                      mock_netinfo):"},{"line_number":3343,"context_line":"        mock_comp_utils.get_nw_info_for_instance.return_value \u003d [model.VIF("},{"line_number":3344,"context_line":"            id\u003d\u00271\u0027, preserve_on_delete\u003dFalse), model.VIF("},{"line_number":3345,"context_line":"            id\u003d\u00272\u0027, preserve_on_delete\u003dTrue), model.VIF("},{"line_number":3346,"context_line":"            id\u003d\u00273\u0027, preserve_on_delete\u003dTrue)]"},{"line_number":3347,"context_line":"        mock_inst \u003d mock.Mock(project_id\u003d\"proj-1\","}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_290cb23a","line":3344,"updated":"2015-03-09 21:38:00.000000000","message":"nova created 1, 2 and 3 were already existing.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":3349,"context_line":"                              uuid\u003d\u0027inst-1\u0027)"},{"line_number":3350,"context_line":"        mock_ntrn.return_value \u003d mock.Mock()"},{"line_number":3351,"context_line":"        self.api.deallocate_port_for_instance(mock.sentinel.ctx,"},{"line_number":3352,"context_line":"                                              mock_inst, \u00272\u0027)"},{"line_number":3353,"context_line":"        mock_unbind.assert_called_once_with(mock.sentinel.ctx, [\u00272\u0027])"},{"line_number":3354,"context_line":""},{"line_number":3355,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_891cbe6b","line":3352,"updated":"2015-03-09 21:38:00.000000000","message":"remove port 2 from the instance","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bab6d11fc09df0421406c01b24444478004b26b1","unresolved":false,"context_lines":[{"line_number":3350,"context_line":"        mock_ntrn.return_value \u003d mock.Mock()"},{"line_number":3351,"context_line":"        self.api.deallocate_port_for_instance(mock.sentinel.ctx,"},{"line_number":3352,"context_line":"                                              mock_inst, \u00272\u0027)"},{"line_number":3353,"context_line":"        mock_unbind.assert_called_once_with(mock.sentinel.ctx, [\u00272\u0027])"},{"line_number":3354,"context_line":""},{"line_number":3355,"context_line":""},{"line_number":3356,"context_line":"class TestNeutronv2ModuleMethods(test.TestCase):"}],"source_content_type":"text/x-python","patch_set":34,"id":"9a80dd14_a917c243","line":3353,"updated":"2015-03-09 21:38:00.000000000","message":"we only unbind 2, this shows that we didn\u0027t unbind 3 (or delete 1). OK.","commit_id":"be3aa5c058318d4d254c02119b942b38241e6dfb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e1349e1b35044366c51d88c40e662ddc131e6737","unresolved":false,"context_lines":[{"line_number":2616,"context_line":"        neutronapi.get_client(\u0027fake\u0027)"},{"line_number":2617,"context_line":"        fake_inst.info_cache \u003d objects.InstanceInfoCache.new("},{"line_number":2618,"context_line":"            self.context, \u0027fake-uuid\u0027)"},{"line_number":2619,"context_line":"        fake_inst.info_cache.network_info \u003d model.NetworkInfo.hydrate([])"},{"line_number":2620,"context_line":"        nw_infos \u003d api._build_network_info_model(self.context, fake_inst,"},{"line_number":2621,"context_line":"                                                 fake_nets,"},{"line_number":2622,"context_line":"                                                 [fake_ports[2][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a80dd14_7002e670","line":2619,"updated":"2015-03-10 14:59:27.000000000","message":"Seems we should have moved this up with the instance object construction above and we have helper methods for constructing these now that aren\u0027t being used.","commit_id":"d479e749ad86d8bc7ca31492ee4a439d48964283"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"d0601ad4e1b666853822309b1472b039c45ebd30","unresolved":false,"context_lines":[{"line_number":2616,"context_line":"        neutronapi.get_client(\u0027fake\u0027)"},{"line_number":2617,"context_line":"        fake_inst.info_cache \u003d objects.InstanceInfoCache.new("},{"line_number":2618,"context_line":"            self.context, \u0027fake-uuid\u0027)"},{"line_number":2619,"context_line":"        fake_inst.info_cache.network_info \u003d model.NetworkInfo.hydrate([])"},{"line_number":2620,"context_line":"        nw_infos \u003d api._build_network_info_model(self.context, fake_inst,"},{"line_number":2621,"context_line":"                                                 fake_nets,"},{"line_number":2622,"context_line":"                                                 [fake_ports[2][\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a80dd14_7b5e4778","line":2619,"in_reply_to":"9a80dd14_7002e670","updated":"2015-03-10 15:15:51.000000000","message":"i\u0027ll take a stab at this in a later review Matt.","commit_id":"d479e749ad86d8bc7ca31492ee4a439d48964283"}],"nova/tests/unit/utils.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1f6e6cd7d3933f9d7da16854f1ce975bedb71315","unresolved":false,"context_lines":[{"line_number":34,"context_line":"CONF.import_opt(\u0027use_ipv6\u0027, \u0027nova.netconf\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class Dict(dict):"},{"line_number":38,"context_line":"    pass"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_7aed208e","line":37,"updated":"2015-02-16 13:03:38.000000000","message":"why do we need this?","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"8ae41b00727ed68c5a20318baaf4870d1afdb074","unresolved":false,"context_lines":[{"line_number":34,"context_line":"CONF.import_opt(\u0027use_ipv6\u0027, \u0027nova.netconf\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class Dict(dict):"},{"line_number":38,"context_line":"    pass"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"da86d52c_ce11ea5e","line":37,"in_reply_to":"da86d52c_7aed208e","updated":"2015-02-16 14:57:10.000000000","message":"looks like a bad merge","commit_id":"7a22ee387fc9287546c79cb36bbd957eacb924c1"}],"nova/tests/utils.py":[{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"b7546b09ca4f7c4c0ba5ace6f5648205999e4296","unresolved":false,"context_lines":[{"line_number":33,"context_line":"CONF.import_opt(\u0027use_ipv6\u0027, \u0027nova.netconf\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class Dict(dict):"},{"line_number":37,"context_line":"    pass"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_d0ff2332","line":36,"updated":"2014-10-09 05:11:58.000000000","message":"why?","commit_id":"bff0074b405740a6d296d26a5eba4efa3e4eac0f"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"14a45ec14213da850be5024dbd05d725e99f9aff","unresolved":false,"context_lines":[{"line_number":33,"context_line":"CONF.import_opt(\u0027use_ipv6\u0027, \u0027nova.netconf\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class Dict(dict):"},{"line_number":37,"context_line":"    pass"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_6ad03bca","line":36,"in_reply_to":"baa201ad_d0ff2332","updated":"2014-10-09 14:20:56.000000000","message":"code which expects an instance-like object need to be able to access the object using both the item and attribute based syntax (e.g. inst[key] and inst.key). This simple class provides that ability and hence can be used in the UTs for those code paths.","commit_id":"bff0074b405740a6d296d26a5eba4efa3e4eac0f"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"c9b9b1307c8a3d5f50340d937d2495a4fe998f96","unresolved":false,"context_lines":[{"line_number":33,"context_line":"CONF.import_opt(\u0027use_ipv6\u0027, \u0027nova.netconf\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class Dict(dict):"},{"line_number":37,"context_line":"    pass"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_fc7227e2","line":36,"updated":"2014-10-10 03:33:45.000000000","message":"Sorry I still don\u0027t understand why you need this you use this here:\n\n+        mock_inst \u003d test_utils.Dict({\u0027uuid\u0027: \u0027inst-1\u0027, \u0027vm_state\u0027: \u0027RUNNING\u0027})\n\nhow is this any different then: \n\nmock_inst \u003d {\u0027uuid\u0027: \u0027inst-1\u0027, \u0027vm_state\u0027: \u0027RUNNING\u0027}","commit_id":"852087d1913e51e7fab72b206488fbf37dd77d5d"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"b0a3f1413dd3c4e5b8bad305a89ca69d344ccccb","unresolved":false,"context_lines":[{"line_number":33,"context_line":"CONF.import_opt(\u0027use_ipv6\u0027, \u0027nova.netconf\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"class Dict(dict):"},{"line_number":37,"context_line":"    pass"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_d9d45cbf","line":36,"in_reply_to":"baa201ad_fc7227e2","updated":"2014-10-13 13:46:23.000000000","message":"In some of the unit tests, we need to set / get attributes on an \"instance like\" object... This Dict class permits that..\nEX:\n\n\u003e\u003e\u003e class Dict(dict):\n...     pass\n... \n\u003e\u003e\u003e inst1 \u003d {\u0027uuid\u0027:\u0027u1\u0027}\n\u003e\u003e\u003e inst1.attr1 \u003d \u0027val1\u0027\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nAttributeError: \u0027dict\u0027 object has no attribute \u0027attr1\u0027\n\u003e\u003e\u003e inst2 \u003d Dict({\u0027uuid\u0027:\u0027u2\u0027})\n\u003e\u003e\u003e inst2.attr1 \u003d \u0027val1\u0027\n\u003e\u003e\u003e inst2.attr1\n\u0027val1\u0027","commit_id":"852087d1913e51e7fab72b206488fbf37dd77d5d"}]}
