)]}'
{"ironic/nova/tests/virt/ironic/test_driver.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"724a60607cd99fbef212e645ce025dc5784b94e8","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        mock_nr.return_value \u003d fake_resource"},{"line_number":353,"context_line":"        result \u003d self.driver.get_available_resource(node.uuid)"},{"line_number":354,"context_line":"        self.assertEqual(fake_resource, result)"},{"line_number":355,"context_line":"        mock_nr.assert_called_once_with(node)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    @mock.patch.object(FAKE_CLIENT.node, \u0027get_by_instance_uuid\u0027)"},{"line_number":358,"context_line":"    def test_get_info(self, mock_gbiu):"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_337234b0","line":355,"updated":"2014-08-12 14:48:15.000000000","message":"This test doesn\u0027t seem to be exercising the cache at all, can we add a new test or extend this one to validate that get_available_nodes() is not being called after the nodes are cached? Or in case it\u0027s not cached make sure that icli.call(\"node.get\", ...) is being called for that node","commit_id":"f81e49f1bb4e4f6fd0b4f5fc03c3d2307d5a7a83"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"d3ce6404c8f1eb5124963d5bb5becb68baff4c50","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        mock_nr.return_value \u003d fake_resource"},{"line_number":353,"context_line":"        result \u003d self.driver.get_available_resource(node.uuid)"},{"line_number":354,"context_line":"        self.assertEqual(fake_resource, result)"},{"line_number":355,"context_line":"        mock_nr.assert_called_once_with(node)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    @mock.patch.object(FAKE_CLIENT.node, \u0027get_by_instance_uuid\u0027)"},{"line_number":358,"context_line":"    def test_get_info(self, mock_gbiu):"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_c4fbdb47","line":355,"in_reply_to":"baada198_337234b0","updated":"2014-08-12 22:31:35.000000000","message":"Done","commit_id":"f81e49f1bb4e4f6fd0b4f5fc03c3d2307d5a7a83"}],"ironic/nova/virt/ironic/client_wrapper.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"28c9a7558862f1ff7c583f9912e55148679a8f90","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def _detail_hack(self, associated\u003dNone, maintenance\u003dNone):"},{"line_number":34,"context_line":"    \"\"\"Detail method to monkey patch into the client.\"\"\""},{"line_number":35,"context_line":"    filters \u003d []"},{"line_number":36,"context_line":"    if associated is not None:"},{"line_number":37,"context_line":"        filters.append(\u0027associated\u003d%s\u0027 % associated)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_09aa7270","line":34,"updated":"2014-07-22 01:21:24.000000000","message":"Oh, we actually should get \u0027detail\u0027 into ironicclient and use that. This was meant more of a hack until we could land that. Probably should be a requirement for upstream merging. :)","commit_id":"62b2376d4c8990c76aa16f2b971a3a5455b95d47"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"44c6673f3d9e72d05c36f7595ce5ad074b4f0523","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"def _detail_hack(self, associated\u003dNone, maintenance\u003dNone):"},{"line_number":34,"context_line":"    \"\"\"Detail method to monkey patch into the client.\"\"\""},{"line_number":35,"context_line":"    filters \u003d []"},{"line_number":36,"context_line":"    if associated is not None:"},{"line_number":37,"context_line":"        filters.append(\u0027associated\u003d%s\u0027 % associated)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_30312eee","line":34,"in_reply_to":"baada198_09aa7270","updated":"2014-07-22 13:13:03.000000000","message":"Agree, just putting it here to iterate on. :)","commit_id":"62b2376d4c8990c76aa16f2b971a3a5455b95d47"}],"ironic/nova/virt/ironic/driver.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"724a60607cd99fbef212e645ce025dc5784b94e8","unresolved":false,"context_lines":[{"line_number":416,"context_line":"            node_uuids.append(node.uuid)"},{"line_number":417,"context_line":"            node_cache[node.uuid] \u003d node"},{"line_number":418,"context_line":"        self.node_cache \u003d node_cache"},{"line_number":419,"context_line":"        self.node_cache_time \u003d time.time()"},{"line_number":420,"context_line":"        LOG.debug(\"Returning %(num_nodes)s available node(s): %(nodes)s\","},{"line_number":421,"context_line":"                  dict(num_nodes\u003dlen(node_uuids), nodes\u003dnode_uuids))"},{"line_number":422,"context_line":"        return node_uuids"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_f3eb5ca2","line":419,"updated":"2014-08-12 14:48:15.000000000","message":"wondering if now that we cache stuff we should be using/respecting the refresh argument, e.g:\n\n if refresh:\n   self._refresh_nodes_cache()\n else:\n    return list(self.node_cache.keys())","commit_id":"f81e49f1bb4e4f6fd0b4f5fc03c3d2307d5a7a83"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"d3ce6404c8f1eb5124963d5bb5becb68baff4c50","unresolved":false,"context_lines":[{"line_number":416,"context_line":"            node_uuids.append(node.uuid)"},{"line_number":417,"context_line":"            node_cache[node.uuid] \u003d node"},{"line_number":418,"context_line":"        self.node_cache \u003d node_cache"},{"line_number":419,"context_line":"        self.node_cache_time \u003d time.time()"},{"line_number":420,"context_line":"        LOG.debug(\"Returning %(num_nodes)s available node(s): %(nodes)s\","},{"line_number":421,"context_line":"                  dict(num_nodes\u003dlen(node_uuids), nodes\u003dnode_uuids))"},{"line_number":422,"context_line":"        return node_uuids"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_2463b7ac","line":419,"in_reply_to":"baada198_f3eb5ca2","updated":"2014-08-12 22:31:35.000000000","message":"Done","commit_id":"f81e49f1bb4e4f6fd0b4f5fc03c3d2307d5a7a83"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"724a60607cd99fbef212e645ce025dc5784b94e8","unresolved":false,"context_lines":[{"line_number":445,"context_line":"                      {\u0027node\u0027: nodename, \u0027age\u0027: time.time() - self.node_cache_time})"},{"line_number":446,"context_line":"            node \u003d self.node_cache[nodename]"},{"line_number":447,"context_line":"        else:"},{"line_number":448,"context_line":"            node \u003d icli.call(\"node.get\", nodename)"},{"line_number":449,"context_line":"        return self._node_resource(node)"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"    def get_info(self, instance):"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_f36fdc5e","line":448,"updated":"2014-08-12 14:48:15.000000000","message":"if the node is not in the cache, should we add it to the cache ? Or refresh the cache by calling get_available_nodes() ?","commit_id":"f81e49f1bb4e4f6fd0b4f5fc03c3d2307d5a7a83"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"d3ce6404c8f1eb5124963d5bb5becb68baff4c50","unresolved":false,"context_lines":[{"line_number":445,"context_line":"                      {\u0027node\u0027: nodename, \u0027age\u0027: time.time() - self.node_cache_time})"},{"line_number":446,"context_line":"            node \u003d self.node_cache[nodename]"},{"line_number":447,"context_line":"        else:"},{"line_number":448,"context_line":"            node \u003d icli.call(\"node.get\", nodename)"},{"line_number":449,"context_line":"        return self._node_resource(node)"},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"    def get_info(self, instance):"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_0466b3bc","line":448,"in_reply_to":"baada198_f36fdc5e","updated":"2014-08-12 22:31:35.000000000","message":"get_available_resource should never be called twice for the same node, without the cache being refreshed between calls. (the cache refreshes at each run of the periodic task).","commit_id":"f81e49f1bb4e4f6fd0b4f5fc03c3d2307d5a7a83"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4f67c3d3cda22536d2bb3c63a1a539e2cf6f2dd2","unresolved":false,"context_lines":[{"line_number":409,"context_line":"        \"\"\""},{"line_number":410,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":411,"context_line":"        if self.node_cache and not refresh:"},{"line_number":412,"context_line":"            return self.node_cache.keys()"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"        node_list \u003d icli.call(\u0027node.list\u0027, detail\u003dTrue)"},{"line_number":415,"context_line":"        node_uuids \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_d781ba4d","line":412,"updated":"2014-08-13 09:16:44.000000000","message":"In py3 keys() returns a dict_keys object, so we need to convert it to a list before returning to be consistent with the return code (and avoid whatever error it may cause in nova by returning a non-list object here)\n\ne.g\n\n return list(self.node_cache.keys())","commit_id":"af2be9b48e1c6d14dba3e994c46ec92f4ed0c822"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4f67c3d3cda22536d2bb3c63a1a539e2cf6f2dd2","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        self.node_cache \u003d node_cache"},{"line_number":421,"context_line":"        self.node_cache_time \u003d time.time()"},{"line_number":422,"context_line":"        LOG.debug(\"Returning %(num_nodes)s available node(s): %(nodes)s\","},{"line_number":423,"context_line":"                  dict(num_nodes\u003dlen(node_uuids), nodes\u003dnode_uuids))"},{"line_number":424,"context_line":"        return node_uuids"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def get_available_resource(self, nodename):"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_dacf21b1","line":423,"updated":"2014-08-13 09:16:44.000000000","message":"I know it\u0027s a debug log and not related to your patch... but the list of nodes could be quite big here, thousands of it... If it happen to submit a new patch set, do you think we need to change this log? For me it\u0027s questionable whether it\u0027s useful to log the whole list of UUIDs here, looks like a spam in the logs.\n\nAnother thing is that this isn\u0027t being logged when we return the codes from the cache (if cache is populated and refresh is False).\n\nYet another thing, having a function to populate the cache instead of doing it on the get_available_nodes() would make it easier to read (we can call the new function in the get_avaiable_nodes()), or at least a mention in this method docstring that it also create a cache for nodes and not only returns the list of UUIDs","commit_id":"af2be9b48e1c6d14dba3e994c46ec92f4ed0c822"},{"author":{"_account_id":7882,"name":"Yuiko Takada Mori","email":"yuiko-mori@nec.com","username":"YuikoTakada"},"change_message_id":"42181b4a1551e6937f088b57f0ba0befeab3b0c7","unresolved":false,"context_lines":[{"line_number":421,"context_line":"        self.node_cache_time \u003d time.time()"},{"line_number":422,"context_line":"        LOG.debug(\"Returning %(num_nodes)s available node(s): %(nodes)s\","},{"line_number":423,"context_line":"                  dict(num_nodes\u003dlen(node_uuids), nodes\u003dnode_uuids))"},{"line_number":424,"context_line":"        return node_uuids"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":427,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_918f59d3","line":424,"updated":"2014-08-13 04:45:51.000000000","message":"unnecessary to return node_uuids any more?","commit_id":"af2be9b48e1c6d14dba3e994c46ec92f4ed0c822"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4f67c3d3cda22536d2bb3c63a1a539e2cf6f2dd2","unresolved":false,"context_lines":[{"line_number":421,"context_line":"        self.node_cache_time \u003d time.time()"},{"line_number":422,"context_line":"        LOG.debug(\"Returning %(num_nodes)s available node(s): %(nodes)s\","},{"line_number":423,"context_line":"                  dict(num_nodes\u003dlen(node_uuids), nodes\u003dnode_uuids))"},{"line_number":424,"context_line":"        return node_uuids"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":427,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_f7e15ed0","line":424,"in_reply_to":"baada198_918f59d3","updated":"2014-08-13 09:16:44.000000000","message":"We still have to return the list of UUIDs to nova","commit_id":"af2be9b48e1c6d14dba3e994c46ec92f4ed0c822"},{"author":{"_account_id":7882,"name":"Yuiko Takada Mori","email":"yuiko-mori@nec.com","username":"YuikoTakada"},"change_message_id":"6f3d64ace33ff996fa494619cdef2578e3ccb0f7","unresolved":false,"context_lines":[{"line_number":421,"context_line":"        self.node_cache_time \u003d time.time()"},{"line_number":422,"context_line":"        LOG.debug(\"Returning %(num_nodes)s available node(s): %(nodes)s\","},{"line_number":423,"context_line":"                  dict(num_nodes\u003dlen(node_uuids), nodes\u003dnode_uuids))"},{"line_number":424,"context_line":"        return node_uuids"},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":427,"context_line":"        \"\"\"Retrieve resource information."}],"source_content_type":"text/x-python","patch_set":5,"id":"7ac7a964_8c6e70c8","line":424,"in_reply_to":"baada198_f7e15ed0","updated":"2014-08-14 05:14:21.000000000","message":"Thank you! I understand.","commit_id":"af2be9b48e1c6d14dba3e994c46ec92f4ed0c822"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"50f41ce07cb1f070836c5d932bdc2244efd3091b","unresolved":false,"context_lines":[{"line_number":406,"context_line":"        node_uuids \u003d []"},{"line_number":407,"context_line":"        node_cache \u003d {}"},{"line_number":408,"context_line":"        for node in node_list:"},{"line_number":409,"context_line":"            node_uuids.append(node.uuid)"},{"line_number":410,"context_line":"            node_cache[node.uuid] \u003d node"},{"line_number":411,"context_line":"        self.node_cache \u003d node_cache"},{"line_number":412,"context_line":"        self.node_cache_time \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_69264769","line":409,"updated":"2014-08-13 14:53:54.000000000","message":"node_uuids list not used.","commit_id":"7886be0710ad41ac7472f38f400c7413092c1024"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b1093f9aab76463fcda63ac2cfbf7726ebbb0088","unresolved":false,"context_lines":[{"line_number":406,"context_line":"        node_uuids \u003d []"},{"line_number":407,"context_line":"        node_cache \u003d {}"},{"line_number":408,"context_line":"        for node in node_list:"},{"line_number":409,"context_line":"            node_uuids.append(node.uuid)"},{"line_number":410,"context_line":"            node_cache[node.uuid] \u003d node"},{"line_number":411,"context_line":"        self.node_cache \u003d node_cache"},{"line_number":412,"context_line":"        self.node_cache_time \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_4c07d170","line":409,"in_reply_to":"baada198_69264769","updated":"2014-08-13 16:02:25.000000000","message":"+1","commit_id":"7886be0710ad41ac7472f38f400c7413092c1024"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b1093f9aab76463fcda63ac2cfbf7726ebbb0088","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        if not self.node_cache:"},{"line_number":446,"context_line":"            # Well, it\u0027s also called from init_host(), so if we have empty"},{"line_number":447,"context_line":"            # cache, let\u0027s try to populate it."},{"line_number":448,"context_line":"            self.get_available_nodes(refresh\u003dTrue)"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"        cache_age \u003d time.time() - self.node_cache_time"},{"line_number":451,"context_line":"        if nodename in self.node_cache:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_891f1b71","line":448,"updated":"2014-08-13 16:02:25.000000000","message":"self._refresh_cache()","commit_id":"7886be0710ad41ac7472f38f400c7413092c1024"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"280df6fc9979771722cda82af54efb340bca0f3c","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        :returns: a dictionary describing resources."},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        \"\"\""},{"line_number":440,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"        # NOTE(comstud): We can cheat and use caching here. This method is"},{"line_number":443,"context_line":"        # only called from a periodic task and right after the above"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_884c4744","line":440,"updated":"2014-08-19 19:47:19.000000000","message":"nit: this can be moved to the \u0027else\u0027 below, so that you do it only if you need it.","commit_id":"bdabea3bb75c5a34689fa9f54a1b82cfb6f139c1"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"baf8c5429580ca058b4126a65f0ac218705c6a59","unresolved":false,"context_lines":[{"line_number":437,"context_line":"        :returns: a dictionary describing resources."},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        \"\"\""},{"line_number":440,"context_line":"        icli \u003d client_wrapper.IronicClientWrapper()"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"        # NOTE(comstud): We can cheat and use caching here. This method is"},{"line_number":443,"context_line":"        # only called from a periodic task and right after the above"}],"source_content_type":"text/x-python","patch_set":10,"id":"1abeadc6_88f9a782","line":440,"in_reply_to":"1abeadc6_884c4744","updated":"2014-08-19 19:49:54.000000000","message":"This is a great idea, actually, thanks!","commit_id":"bdabea3bb75c5a34689fa9f54a1b82cfb6f139c1"}]}
