)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b3e7a8afb65b9269467c5aab12e394102b0aecfb","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Aaron Rosen \u003caaronorosen@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-13 15:47:35 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make network_cache more smarter (WIP)"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Implements blueprint: smarter-network-cache-update"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAUH%2F%2F2GQ%3D","line":7,"updated":"2014-01-07 19:06:30.000000000","message":"more smarter?","commit_id":"7f9f3c8d21c7cb8540f3c109a3f6400bd99a2b63"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"cff35d94fd64a14619e02af96d250e0abfc346a3","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Aaron Rosen \u003caaronorosen@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-12-13 15:47:35 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make network_cache more smarter (WIP)"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Implements blueprint: smarter-network-cache-update"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAUH%2F%2F1zY%3D","line":7,"in_reply_to":"AAAAUH%2F%2F2GQ%3D","updated":"2014-01-07 20:30:06.000000000","message":"Indeed :P","commit_id":"7f9f3c8d21c7cb8540f3c109a3f6400bd99a2b63"}],"nova/network/api.py":[{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"5a832a99a582704cb0914c854e7a1d4d1d14b166","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            raise Exception(msg)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # only refresh cache if an update is needed"},{"line_number":60,"context_line":"        if nw_info !\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:"},{"line_number":61,"context_line":"            update_instance_cache_with_nw_info(self, context, instance,"},{"line_number":62,"context_line":"                                               nw_info\u003dnw_info)"},{"line_number":63,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FdmI%3D","line":60,"updated":"2014-03-05 23:37:33.000000000","message":"I think this check would be better located inside update_instance_cache_with_nw_info().\n\nSome methods call this method directly, most importantly get_instance_nw_info(), which in turn is being called from a lot of places including from the periodic cache healing task in compute manager.\n\nAlso, there are methods without return value using this wrapper that leave it up to update_instance_cache_with_nw_info() to get the nw_info for them. In this case the check can\u0027t be done before the nw_info is fetched.","commit_id":"f8c7895c4fc2dbbd47460657ff23b4039c07ed0e"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3e7d820feb4e1974dda0f74af6d81916c7ee0359","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            raise Exception(msg)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # only refresh cache if an update is needed"},{"line_number":60,"context_line":"        if nw_info !\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:"},{"line_number":61,"context_line":"            update_instance_cache_with_nw_info(self, context, instance,"},{"line_number":62,"context_line":"                                               nw_info\u003dnw_info)"},{"line_number":63,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FSbE%3D","line":60,"in_reply_to":"AAAAVn%2F%2FXx4%3D","updated":"2014-03-07 01:45:57.000000000","message":"Good point I can move this down to update_instance_cache_with_nw_info. I haven\u0027t seen this ever called without info_cache. Just the tests don\u0027t add it. db.get_instance() adds this in always.","commit_id":"f8c7895c4fc2dbbd47460657ff23b4039c07ed0e"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"42f28ba818ede2667ae71507ea2b267d097af00e","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            raise Exception(msg)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        # only refresh cache if an update is needed"},{"line_number":60,"context_line":"        if nw_info !\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:"},{"line_number":61,"context_line":"            update_instance_cache_with_nw_info(self, context, instance,"},{"line_number":62,"context_line":"                                               nw_info\u003dnw_info)"},{"line_number":63,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FXx4%3D","line":60,"in_reply_to":"AAAAVn%2F%2FdmI%3D","updated":"2014-03-06 15:23:22.000000000","message":"So, the above is no longer necessary if my follow-up patch is a valid alternative. While working on this patch I bumped into another issue.\n\nSince info_cache is an optional field of the instance it is not guaranteed to exist here. As a result. the above line might cause a KeyError. This became an issue for me as I added the decorator to get_instance_nw_info(). Obviously not all callers of this method send an instance with info_cache in it.","commit_id":"f8c7895c4fc2dbbd47460657ff23b4039c07ed0e"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"96a55706a9d09685c93e82686214a285e2b2bbe0","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                                       update_cells\u003dTrue):"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    # only refresh cache if an update is needed"},{"line_number":71,"context_line":"    if nw_info !\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:"},{"line_number":72,"context_line":"        LOG.debug(_(\u0027Network cache for %s does not need update\u0027),"},{"line_number":73,"context_line":"                    instance[\u0027uuid\u0027])"},{"line_number":74,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAVn%2F%2FQmI%3D","line":71,"updated":"2014-03-07 08:08:58.000000000","message":"This test should be the opposite right?\n\n if nw_info \u003d\u003d ...\n\nand with an added test for info_cache\n\n if instance.get(\u0027info_cache\u0027) and nw_info \u003d\u003d ...","commit_id":"6fbf93e4a4b2a08c997ebb9ee3b8abf21705db5b"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"96a55706a9d09685c93e82686214a285e2b2bbe0","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # only refresh cache if an update is needed"},{"line_number":71,"context_line":"    if nw_info !\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:"},{"line_number":72,"context_line":"        LOG.debug(_(\u0027Network cache for %s does not need update\u0027),"},{"line_number":73,"context_line":"                    instance[\u0027uuid\u0027])"},{"line_number":74,"context_line":"    try:"},{"line_number":75,"context_line":"        LOG.debug(_(\u0027Updating cache with info: %s\u0027), nw_info)"},{"line_number":76,"context_line":"        if not isinstance(nw_info, network_model.NetworkInfo):"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAVn%2F%2FQp0%3D","line":73,"updated":"2014-03-07 08:08:58.000000000","message":"also missing a return here","commit_id":"6fbf93e4a4b2a08c997ebb9ee3b8abf21705db5b"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"137f2e117b1dee818653ab7528d708bfc88194ec","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # only refresh cache if an update is needed"},{"line_number":71,"context_line":"    if nw_info !\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:"},{"line_number":72,"context_line":"        LOG.debug(_(\u0027Network cache for %s does not need update\u0027),"},{"line_number":73,"context_line":"                    instance[\u0027uuid\u0027])"},{"line_number":74,"context_line":"    try:"},{"line_number":75,"context_line":"        LOG.debug(_(\u0027Updating cache with info: %s\u0027), nw_info)"},{"line_number":76,"context_line":"        if not isinstance(nw_info, network_model.NetworkInfo):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2F78w%3D","line":73,"updated":"2014-03-12 20:17:19.000000000","message":"Missing return","commit_id":"81e9797560b0ea122b43aec8e03cb1443d7145ec"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"679e43229f73a952cfe041bf975cb8d87db50387","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # only refresh cache if an update is needed"},{"line_number":71,"context_line":"    if nw_info !\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:"},{"line_number":72,"context_line":"        LOG.debug(_(\u0027Network cache for %s does not need update\u0027),"},{"line_number":73,"context_line":"                    instance[\u0027uuid\u0027])"},{"line_number":74,"context_line":"    try:"},{"line_number":75,"context_line":"        LOG.debug(_(\u0027Updating cache with info: %s\u0027), nw_info)"},{"line_number":76,"context_line":"        if not isinstance(nw_info, network_model.NetworkInfo):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAWH%2F%2F78U%3D","line":73,"in_reply_to":"AAAAWH%2F%2F78w%3D","updated":"2014-03-12 20:17:55.000000000","message":"if  nw_info \u003d\u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]:\n    return","commit_id":"81e9797560b0ea122b43aec8e03cb1443d7145ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a1ed9023e962468c292708d19a5c6ffa23d67a32","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        # though many of the unit tests don\u0027t add this to instance so we"},{"line_number":73,"context_line":"        # check here rather than adding it to all the tests."},{"line_number":74,"context_line":"        instance_nw_info \u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]"},{"line_number":75,"context_line":"    except KeyError:"},{"line_number":76,"context_line":"        pass"},{"line_number":77,"context_line":"    else:"},{"line_number":78,"context_line":"        # only refresh cache if an update is needed"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAWH%2F%2Fozg%3D","line":75,"updated":"2014-03-14 20:24:18.000000000","message":"This actually concerns me. This means the unit tests are broken (believe me, every object change needs a lot of this kind of fixing). Ignoring it in real code means that we ignore it in real life, which leads to bugs like the one we\u0027ve got right now where network_info is not filled out for some reason.","commit_id":"e223c34589514155c388dc954d0c2b98e2772bc3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"656fc33e99914189bc6906b1b8523ab950ce76fd","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        # though many of the unit tests don\u0027t add this to instance so we"},{"line_number":73,"context_line":"        # check here rather than adding it to all the tests."},{"line_number":74,"context_line":"        instance_nw_info \u003d instance[\u0027info_cache\u0027][\u0027network_info\u0027]"},{"line_number":75,"context_line":"    except KeyError:"},{"line_number":76,"context_line":"        pass"},{"line_number":77,"context_line":"    else:"},{"line_number":78,"context_line":"        # only refresh cache if an update is needed"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAWH%2F%2FoOI%3D","line":75,"in_reply_to":"AAAAWH%2F%2Fozg%3D","updated":"2014-03-14 21:43:08.000000000","message":"Makes sense. I\u0027ll make sure that the tests have [\u0027info_cache\u0027][\u0027network_info\u0027] as well.","commit_id":"e223c34589514155c388dc954d0c2b98e2772bc3"}],"nova/tests/network/test_api.py":[{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"4e758a66e702c266561ecd151e6ecdf9cdd29b43","unresolved":false,"context_lines":[{"line_number":335,"context_line":"                                     \u0027update_instance_cache_with_nw_info\u0027)"},{"line_number":336,"context_line":"        return network_model.NetworkInfo(nw_info)"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def test_instance_info_cache_update_not_called(self):"},{"line_number":339,"context_line":"        nw_info \u003d network_model.NetworkInfo("},{"line_number":340,"context_line":"            self.instance[\u0027info_cache\u0027][\u0027network_info\u0027])"},{"line_number":341,"context_line":"        self._fake_refresh_nw_cache(self.context,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAVn%2F%2FQV0%3D","line":338,"updated":"2014-03-07 08:29:56.000000000","message":"I can confirm now that this test can\u0027t verify the correct behavior. If I remove the check in network/api.py in this or in the previous patch, this test still pass.","commit_id":"6fbf93e4a4b2a08c997ebb9ee3b8abf21705db5b"},{"author":{"_account_id":6450,"name":"Hans Lindgren","email":"hanlind@kth.se","username":"hanlind"},"change_message_id":"d920d0447e20cc7ee99c33afab2e78a01c7e42e0","unresolved":false,"context_lines":[{"line_number":333,"context_line":"        nw_info \u003d []"},{"line_number":334,"context_line":"        self._fake_refresh_nw_cache(self.context,"},{"line_number":335,"context_line":"                                    self.instance, nw_info)"},{"line_number":336,"context_line":"        self.mox.ReplayAll()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def test_instance_info_cache_update_called(self):"},{"line_number":339,"context_line":"        nw_info \u003d network_model.NetworkInfo([{\u0027id\u0027: \u0027uid\u0027}])"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAWH%2F%2FxpI%3D","line":336,"updated":"2014-03-13 21:49:02.000000000","message":"Should call api.update_instance_cache_with_nw_info() here, otherwise this test does nothing.","commit_id":"e223c34589514155c388dc954d0c2b98e2772bc3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"5d2aadb81fd79977d5d4d5a46b0016066b4a4b49","unresolved":false,"context_lines":[{"line_number":333,"context_line":"        nw_info \u003d []"},{"line_number":334,"context_line":"        self._fake_refresh_nw_cache(self.context,"},{"line_number":335,"context_line":"                                    self.instance, nw_info)"},{"line_number":336,"context_line":"        self.mox.ReplayAll()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"    def test_instance_info_cache_update_called(self):"},{"line_number":339,"context_line":"        nw_info \u003d network_model.NetworkInfo([{\u0027id\u0027: \u0027uid\u0027}])"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAWH%2F%2FuP4%3D","line":336,"in_reply_to":"AAAAWH%2F%2FxpI%3D","updated":"2014-03-14 08:08:20.000000000","message":"Done, clearly the test is doing what it says though jk :)","commit_id":"e223c34589514155c388dc954d0c2b98e2772bc3"}]}
