)]}'
{"ironic/common/exception.py":[{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":606,"context_line":""},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"class NodeTagNotFound(IronicException):"},{"line_number":609,"context_line":"    _msg_fmt \u003d _(\"Node %(node_id)s has no tag \u0027%(tag)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_9076baa2","line":609,"updated":"2015-10-21 10:27:56.000000000","message":"nit:How about below message?\n\nNo %(tag)s tag found in node %(node_id)s","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"473ce3d0022627a3158f565a96f3e6cf0a37c260","unresolved":false,"context_lines":[{"line_number":606,"context_line":""},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"class NodeTagNotFound(IronicException):"},{"line_number":609,"context_line":"    _msg_fmt \u003d _(\"Node %(node_id)s has no tag \u0027%(tag)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_d0572b58","line":609,"in_reply_to":"3a29b11f_9076baa2","updated":"2015-10-22 02:10:21.000000000","message":"hi Haomeng, both are ok with me, I think we should wait some native speaker\u0027s suggestion.","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2063629fc7a2ee9b369daa7fdc8d2bd61240475","unresolved":false,"context_lines":[{"line_number":606,"context_line":""},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"class NodeTagNotFound(IronicException):"},{"line_number":609,"context_line":"    _msg_fmt \u003d _(\"Node %(node_id)s has no tag \u0027%(tag)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_3a0a8a27","line":609,"updated":"2015-11-25 09:48:36.000000000","message":"nit: \"doesn\u0027t have a tag\" sounds more naturally to me, but I\u0027m not native","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1a9d34bf73ecae8422c7b1dbe21022f704535b5b","unresolved":false,"context_lines":[{"line_number":606,"context_line":""},{"line_number":607,"context_line":""},{"line_number":608,"context_line":"class NodeTagNotFound(IronicException):"},{"line_number":609,"context_line":"    _msg_fmt \u003d _(\"Node %(node_id)s has no tag \u0027%(tag)s\u0027\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_fe403fa7","line":609,"in_reply_to":"9a8ffd7b_3a0a8a27","updated":"2015-11-26 07:49:52.000000000","message":"Done","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"}],"ironic/db/api.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"519f6fb92a1b8d2bf832eac7782d064eba6fe8aa","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        \"\"\"Set node tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        \"\"\""},{"line_number":423,"context_line":""},{"line_number":424,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_add0c3f8","line":421,"updated":"2015-10-12 13:19:32.000000000","message":"Please add returns, raises (for all these methods if applicable).","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"39f18f3b0161430386da25e12152de99d6a92edc","unresolved":false,"context_lines":[{"line_number":418,"context_line":"        \"\"\"Set node tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        \"\"\""},{"line_number":423,"context_line":""},{"line_number":424,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a2ca52d_3979fec8","line":421,"in_reply_to":"7a2fa921_add0c3f8","updated":"2015-10-15 10:00:48.000000000","message":"Done","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @abc.abstractmethod"},{"line_number":427,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":428,"context_line":"        \"\"\"Delete node tags."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_10e06a28","line":427,"updated":"2015-10-21 10:27:56.000000000","message":"I understand this call will remove all tags for an input node, how about node_tags_empty?","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"473ce3d0022627a3158f565a96f3e6cf0a37c260","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @abc.abstractmethod"},{"line_number":427,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":428,"context_line":"        \"\"\"Delete node tags."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_2ba2b4fd","line":427,"in_reply_to":"3a29b11f_10e06a28","updated":"2015-10-22 02:10:21.000000000","message":"I think node_tags_delete is more common, not sure why node_tags_empty is better.","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @abc.abstractmethod"},{"line_number":427,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":428,"context_line":"        \"\"\"Delete node tags."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        :param node_id: The id of a node."},{"line_number":431,"context_line":"        :raises: NodeNotFound if the node is not found."}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_d0e51238","line":428,"updated":"2015-10-21 10:27:56.000000000","message":"should be \"Remove all tags for an input node\"?","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        \"\"\"Add tag to the node."},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple string."},{"line_number":449,"context_line":"        :returns: the specified tag."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_705bdef6","line":448,"updated":"2015-10-21 10:27:56.000000000","message":"confusing about \u0027simple string\u0027, can we have mode details such as to add doc to indicate the max length is 255 unicode chars?","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple string."},{"line_number":449,"context_line":"        :returns: the specified tag."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""},{"line_number":452,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_d00192b0","line":449,"updated":"2015-10-21 10:27:56.000000000","message":"I understand we will return all tags for the input node, including the new tag which is added in this call, right?","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"473ce3d0022627a3158f565a96f3e6cf0a37c260","unresolved":false,"context_lines":[{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple string."},{"line_number":449,"context_line":"        :returns: the specified tag."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""},{"line_number":452,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_309c5f0e","line":449,"in_reply_to":"3a29b11f_d00192b0","updated":"2015-10-22 02:10:21.000000000","message":"this is adding a single tag, why should we return all tags? that will add an extra calling to db.","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple string."},{"line_number":449,"context_line":"        :returns: the specified tag."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""},{"line_number":452,"context_line":""},{"line_number":453,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_f0b92e16","line":450,"updated":"2015-10-21 10:27:56.000000000","message":"how about the case which input tag to be added is existing, can we raise tag duplication exception?","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"473ce3d0022627a3158f565a96f3e6cf0a37c260","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple string."},{"line_number":449,"context_line":"        :returns: the specified tag."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""},{"line_number":452,"context_line":""},{"line_number":453,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_0b01f804","line":450,"in_reply_to":"3a29b11f_f0b92e16","updated":"2015-10-22 02:10:21.000000000","message":"Haomeng, please reference the sqlachemy api file, I ignore tags duplicates, I think it\u0027s ok and then users could not care whether a tag is exist or not before adding a tag, they can directly do it, as the result is just what they expected always.","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        :param node_id: The id of a node."},{"line_number":458,"context_line":"        :param tags: A simple string."},{"line_number":459,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":460,"context_line":"        :raises: NodeTagNotFound if the tag is not found."},{"line_number":461,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_30200648","line":460,"updated":"2015-10-21 10:27:56.000000000","message":"how about TagNotFound?","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"473ce3d0022627a3158f565a96f3e6cf0a37c260","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        :param node_id: The id of a node."},{"line_number":458,"context_line":"        :param tags: A simple string."},{"line_number":459,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":460,"context_line":"        :raises: NodeTagNotFound if the tag is not found."},{"line_number":461,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_ab400435","line":460,"in_reply_to":"3a29b11f_30200648","updated":"2015-10-22 02:10:21.000000000","message":"I think NodeTagNotFound is more better, which is more clear to specify it\u0027s a node tag exception.","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":10765,"name":"Andre Aranha","email":"afaranha@lsd.ufcg.edu.br","username":"afaranha"},"change_message_id":"40aead55617925c6f478cd5a53b3aa1181e35375","unresolved":false,"context_lines":[{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        :returns: A list of tags."},{"line_number":423,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_21639543","line":423,"updated":"2015-11-12 13:47:54.000000000","message":"See comment on /ironic/db/sqlalchemy/api.py","commit_id":"c7239cf022c2a19d84b8597d401d59d5b0221774"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2063629fc7a2ee9b369daa7fdc8d2bd61240475","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    @abc.abstractmethod"},{"line_number":417,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":418,"context_line":"        \"\"\"Set node tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_5509612b","line":418,"updated":"2015-11-25 09:48:36.000000000","message":"what does it do: replace tags or add them? please extend","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1a9d34bf73ecae8422c7b1dbe21022f704535b5b","unresolved":false,"context_lines":[{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    @abc.abstractmethod"},{"line_number":417,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":418,"context_line":"        \"\"\"Set node tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_3e36c752","line":418,"in_reply_to":"9a8ffd7b_5509612b","updated":"2015-11-26 07:49:52.000000000","message":"Done","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2063629fc7a2ee9b369daa7fdc8d2bd61240475","unresolved":false,"context_lines":[{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        :returns: A list of tags."},{"line_number":423,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_750ee535","line":422,"updated":"2015-11-25 09:48:36.000000000","message":"is it resulting list of tags or what? it\u0027s not clear that it\u0027s not the same as \"tags\" parameter","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1a9d34bf73ecae8422c7b1dbe21022f704535b5b","unresolved":false,"context_lines":[{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        :returns: A list of tags."},{"line_number":423,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_5e394b40","line":422,"in_reply_to":"9a8ffd7b_750ee535","updated":"2015-11-26 07:49:52.000000000","message":"Done","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        \"\"\""},{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    @abc.abstractmethod"},{"line_number":417,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":418,"context_line":"        \"\"\"Replace all of the node tags with specified list of tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_11e78fe5","line":417,"updated":"2016-01-27 23:10:18.000000000","message":"the rest of the methods are of the form \u003caction/verb\u003e_\u003cnoun\u003e. I was wondering why you decided to do \u003cnoun\u003e_\u003caction/verb\u003e.\n\nUnless there\u0027s a good reason, it would be nice if it was consistent.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        \"\"\""},{"line_number":415,"context_line":""},{"line_number":416,"context_line":"    @abc.abstractmethod"},{"line_number":417,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":418,"context_line":"        \"\"\"Replace all of the node tags with specified list of tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_a06c1f9d","line":417,"in_reply_to":"7a5de9d1_11e78fe5","updated":"2016-01-28 02:16:47.000000000","message":"Done","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        :returns: A list of NodeTag object."},{"line_number":423,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_91761f3d","line":422,"updated":"2016-01-27 23:10:18.000000000","message":"s/object/objects/","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        :returns: A list of NodeTag object."},{"line_number":423,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_6005c7c0","line":422,"in_reply_to":"7a5de9d1_91761f3d","updated":"2016-01-28 02:16:47.000000000","message":"Done","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @abc.abstractmethod"},{"line_number":427,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":428,"context_line":"        \"\"\"Remove all tags of the node."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_51ee678c","line":427,"updated":"2016-01-27 23:10:18.000000000","message":"I was looking at the openstackclient documentation. They have a list of actions [1]. I know this is at a lower level but the actions might be useful here too.\n\nIf we have node_tags_set (above), maybe this should be node_tags_unset?\n\n[1] http://docs.openstack.org/developer/python-openstackclient/commands.html","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        \"\"\""},{"line_number":425,"context_line":""},{"line_number":426,"context_line":"    @abc.abstractmethod"},{"line_number":427,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":428,"context_line":"        \"\"\"Remove all tags of the node."},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_a01adf15","line":427,"in_reply_to":"7a5de9d1_51ee678c","updated":"2016-01-28 02:16:47.000000000","message":"Done","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":432,"context_line":"        \"\"\""},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    @abc.abstractmethod"},{"line_number":435,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":436,"context_line":"        \"\"\"Get node tags."},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_548f3523","line":435,"updated":"2016-01-27 23:10:18.000000000","message":"Do you think there might be a case where someone might want to get all the tags for all the nodes, not just for a particular node?\n\nOr what about get all the nodes that have the same tag?\n\nOr get a node-tag with specified node_id \u0026 tag? (eg, if someone wants to check existence of a tag.)","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":432,"context_line":"        \"\"\""},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    @abc.abstractmethod"},{"line_number":435,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":436,"context_line":"        \"\"\"Get node tags."},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_6004e77d","line":435,"in_reply_to":"7a5de9d1_548f3523","updated":"2016-01-28 02:16:47.000000000","message":"as the api-wg guidelines said, we will support getting nodes that have the same list of tags, or any tag in a specified list.\n\nand I think tag is just an extra attribute bond with nodes just like metadata, we don\u0027t need to care about whether tags exist or not, you can always set a tag to a node.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        \"\"\"Get node tags."},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        :param node_id: The id of a node."},{"line_number":439,"context_line":"        :returns: A list of NodeTag object."},{"line_number":440,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":441,"context_line":"        \"\"\""},{"line_number":442,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_d102573e","line":439,"updated":"2016-01-27 23:10:18.000000000","message":"s/object/objects/","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        \"\"\"Get node tags."},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        :param node_id: The id of a node."},{"line_number":439,"context_line":"        :returns: A list of NodeTag object."},{"line_number":440,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":441,"context_line":"        \"\"\""},{"line_number":442,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_00f6538f","line":439,"in_reply_to":"7a5de9d1_d102573e","updated":"2016-01-28 02:16:47.000000000","message":"Done","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        \"\"\"Add tag to the node."},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple tag string."},{"line_number":449,"context_line":"        :returns: the NodeTag object."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_519507e2","line":448,"updated":"2016-01-27 23:10:18.000000000","message":"Are there non-simple tag strings too? (Wondering why you put \u0027simple\u0027 there.)\n\nWhat happens if the node is already associated with the tag?","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d469c521daa7a04ccf1e96230728b493a1323969","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        \"\"\"Add tag to the node."},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple tag string."},{"line_number":449,"context_line":"        :returns: the NodeTag object."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_5a097adc","line":448,"in_reply_to":"7a5de9d1_20834fce","updated":"2016-01-28 15:53:21.000000000","message":"You don\u0027t have control over what a user uses for the tag string, whether simple or not, and at this level, we shouldn\u0027t care :)","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":445,"context_line":"        \"\"\"Add tag to the node."},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: a simple tag string."},{"line_number":449,"context_line":"        :returns: the NodeTag object."},{"line_number":450,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":451,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_20834fce","line":448,"in_reply_to":"7a5de9d1_519507e2","updated":"2016-01-28 02:16:47.000000000","message":"yeah, maybe simple is not proper here, I just think a tag should be a simple string, not like a description filed.\n\nif the node is already associated with the tag, the db duplicate exception will be ignored, please reference sqlalchemy/api.py, and this will succeed as the result is just what expected.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":455,"context_line":"        \"\"\"Delete specified tag from the node."},{"line_number":456,"context_line":""},{"line_number":457,"context_line":"        :param node_id: The id of a node."},{"line_number":458,"context_line":"        :param tags: A simple tag string."},{"line_number":459,"context_line":"        :raises: NodeNotFound if the node is not found."},{"line_number":460,"context_line":"        :raises: NodeTagNotFound if the tag is not found."},{"line_number":461,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_11b6af8a","line":458,"updated":"2016-01-27 23:10:18.000000000","message":"s/tags/tag/\n\nSame question about \u0027simple\u0027 tag.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3dfd7b69e992b0b798ee0142bcb8b7664e820921","unresolved":false,"context_lines":[{"line_number":416,"context_line":"    @abc.abstractmethod"},{"line_number":417,"context_line":"    def set_node_tags(self, node_id, tags):"},{"line_number":418,"context_line":"        \"\"\"Replace all of the node tags with specified list of tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        :returns: A list of NodeTag objects."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_3c4a7bad","line":419,"updated":"2016-01-28 15:55:26.000000000","message":"Maybe mention that this ignores duplicated tags or something like that. Basically, I want it to be clear that a duplicate tag is not an error/exception.\n\nAlthough maybe it should be. I don\u0027t really have an opinion on it. But if you put it here, then some other reviewer may comment on it :)","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"84f2d26c2b09b9befb68c3dd341cda3ca2e61e7e","unresolved":false,"context_lines":[{"line_number":416,"context_line":"    @abc.abstractmethod"},{"line_number":417,"context_line":"    def set_node_tags(self, node_id, tags):"},{"line_number":418,"context_line":"        \"\"\"Replace all of the node tags with specified list of tags."},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        :param node_id: The id of a node."},{"line_number":421,"context_line":"        :param tags: List of tags."},{"line_number":422,"context_line":"        :returns: A list of NodeTag objects."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_1ecc3669","line":419,"in_reply_to":"7a5de9d1_3c4a7bad","updated":"2016-01-29 03:30:17.000000000","message":"Done","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3dfd7b69e992b0b798ee0142bcb8b7664e820921","unresolved":false,"context_lines":[{"line_number":432,"context_line":"        \"\"\""},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    @abc.abstractmethod"},{"line_number":435,"context_line":"    def get_node_tags(self, node_id):"},{"line_number":436,"context_line":"        \"\"\"Get node tags."},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_da0faa2c","line":435,"updated":"2016-01-28 15:55:26.000000000","message":"To sort of continue the discussion in revision 15 -- I think to make this more consistent with other methods and *just* in case we decide later that we want to be able to get ALL node_tags, I\u0027d like this to be renamed get_node_tags_by_node_id() (similar to get_ports_by_node_id()).\n\nI can almost bet you that we\u0027ll need to add parameters like limit/marker/sort_key/sort_dir but I\u0027m ok deferring that to a future patch when someone wants/does it.","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"84f2d26c2b09b9befb68c3dd341cda3ca2e61e7e","unresolved":false,"context_lines":[{"line_number":432,"context_line":"        \"\"\""},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"    @abc.abstractmethod"},{"line_number":435,"context_line":"    def get_node_tags(self, node_id):"},{"line_number":436,"context_line":"        \"\"\"Get node tags."},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_3ed812ef","line":435,"in_reply_to":"7a5de9d1_da0faa2c","updated":"2016-01-29 03:30:17.000000000","message":"thanks Ruby, will rename it in the coming patch set, and for pagination and sort related parameters, I\u0027d like to defer it if you are ok.","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3dfd7b69e992b0b798ee0142bcb8b7664e820921","unresolved":false,"context_lines":[{"line_number":443,"context_line":"    @abc.abstractmethod"},{"line_number":444,"context_line":"    def add_node_tag(self, node_id, tag):"},{"line_number":445,"context_line":"        \"\"\"Add tag to the node."},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: A tag string."},{"line_number":449,"context_line":"        :returns: the NodeTag object."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_baf98e82","line":446,"updated":"2016-01-28 15:55:26.000000000","message":"(continuing discussion in prev. revision). We should mention here that if the tag already exists, this should still succeed. Which seems a bit contrary to how the other code works but I guess tags are a bit different.","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"84f2d26c2b09b9befb68c3dd341cda3ca2e61e7e","unresolved":false,"context_lines":[{"line_number":443,"context_line":"    @abc.abstractmethod"},{"line_number":444,"context_line":"    def add_node_tag(self, node_id, tag):"},{"line_number":445,"context_line":"        \"\"\"Add tag to the node."},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        :param node_id: The id of a node."},{"line_number":448,"context_line":"        :param tag: A tag string."},{"line_number":449,"context_line":"        :returns: the NodeTag object."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_5ee94e7f","line":446,"in_reply_to":"7a5de9d1_baf98e82","updated":"2016-01-29 03:30:17.000000000","message":"Done","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":446,"context_line":"    def add_node_tag(self, node_id, tag):"},{"line_number":447,"context_line":"        \"\"\"Add tag to the node."},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        If the node_id and tag pair alrady exists, this should still"},{"line_number":450,"context_line":"        succeed, as the result is just what expected."},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_c145f642","line":449,"updated":"2016-02-01 16:01:14.000000000","message":"s/alrady/already/","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":446,"context_line":"    def add_node_tag(self, node_id, tag):"},{"line_number":447,"context_line":"        \"\"\"Add tag to the node."},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        If the node_id and tag pair alrady exists, this should still"},{"line_number":450,"context_line":"        succeed, as the result is just what expected."},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"        :param node_id: The id of a node."}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_09578d27","line":449,"in_reply_to":"7a5de9d1_c145f642","updated":"2016-02-02 10:01:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        \"\"\"Add tag to the node."},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        If the node_id and tag pair alrady exists, this should still"},{"line_number":450,"context_line":"        succeed, as the result is just what expected."},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"        :param node_id: The id of a node."},{"line_number":453,"context_line":"        :param tag: A tag string."}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_613a029b","line":450,"updated":"2016-02-01 16:01:14.000000000","message":"I wouldn\u0027t mention \u0027as the result...\u0027 part because i\u0027m not quite sure what folks expect, and one could argue that it should fail because it already exists and it doesn\u0027t make sense to add it again.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":447,"context_line":"        \"\"\"Add tag to the node."},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        If the node_id and tag pair alrady exists, this should still"},{"line_number":450,"context_line":"        succeed, as the result is just what expected."},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"        :param node_id: The id of a node."},{"line_number":453,"context_line":"        :param tag: A tag string."}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_09054d13","line":450,"in_reply_to":"7a5de9d1_613a029b","updated":"2016-02-02 10:01:17.000000000","message":"OK, will remove this part.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"}],"ironic/db/sqlalchemy/api.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"519f6fb92a1b8d2bf832eac7782d064eba6fe8aa","unresolved":false,"context_lines":[{"line_number":623,"context_line":"                node_tag.tag \u003d tag"},{"line_number":624,"context_line":"                node_tag.node_id \u003d node_id"},{"line_number":625,"context_line":"                session.add(node_tag)"},{"line_number":626,"context_line":"                session.flush()"},{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags or None"},{"line_number":629,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_d8813fc5","line":626,"updated":"2015-10-12 13:19:32.000000000","message":"1) Do session.flush() after one row is more slowly than implicit flush at session context exit. 2) Because node_id is ForeignKey a DB exception possible here, please convert it to Ironic exception and add proper test.","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"39f18f3b0161430386da25e12152de99d6a92edc","unresolved":false,"context_lines":[{"line_number":623,"context_line":"                node_tag.tag \u003d tag"},{"line_number":624,"context_line":"                node_tag.node_id \u003d node_id"},{"line_number":625,"context_line":"                session.add(node_tag)"},{"line_number":626,"context_line":"                session.flush()"},{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags or None"},{"line_number":629,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a2ca52d_f9e86612","line":626,"in_reply_to":"7a2fa921_d8813fc5","updated":"2015-10-15 10:00:48.000000000","message":"Yuriy, I will add NodeNotFound exception in node_tags_delete, and it\u0027s called at L619 which will raise exception before the ForeignKey exception here if the node not in tables.","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"519f6fb92a1b8d2bf832eac7782d064eba6fe8aa","unresolved":false,"context_lines":[{"line_number":625,"context_line":"                session.add(node_tag)"},{"line_number":626,"context_line":"                session.flush()"},{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags or None"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":631,"context_line":"        with _session_for_write():"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_7816ebf2","line":628,"updated":"2015-10-12 13:19:32.000000000","message":"Is it needed to return None instead of empty list?","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"f8401de37802aa9b4e4678f94f8f78c1c5af49d4","unresolved":false,"context_lines":[{"line_number":625,"context_line":"                session.add(node_tag)"},{"line_number":626,"context_line":"                session.flush()"},{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags or None"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":631,"context_line":"        with _session_for_write():"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_b993fe4e","line":628,"in_reply_to":"7a2fa921_7816ebf2","updated":"2015-10-13 09:19:01.000000000","message":"seems empty list is ok, no need to return None here.","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"519f6fb92a1b8d2bf832eac7782d064eba6fe8aa","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags or None"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":631,"context_line":"        with _session_for_write():"},{"line_number":632,"context_line":"            model_query(models.Tag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":633,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_5880cf8b","line":630,"updated":"2015-10-12 13:19:32.000000000","message":"It\u0027s OK if no exception from here if we got node_id that does not present in the nodes table?","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"f8401de37802aa9b4e4678f94f8f78c1c5af49d4","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags or None"},{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":631,"context_line":"        with _session_for_write():"},{"line_number":632,"context_line":"            model_query(models.Tag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":633,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_7987a6d7","line":630,"in_reply_to":"7a2fa921_5880cf8b","updated":"2015-10-13 09:19:01.000000000","message":"will update to raise NodeNotFound if node_id does not present, thanks Yuriy.","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"519f6fb92a1b8d2bf832eac7782d064eba6fe8aa","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        with _session_for_write():"},{"line_number":632,"context_line":"            model_query(models.Tag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":635,"context_line":"        result \u003d (model_query(models.Tag)"},{"line_number":636,"context_line":"                  .filter_by(node_id\u003dnode_id)"},{"line_number":637,"context_line":"                  .all())"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_f8475b75","line":634,"updated":"2015-10-12 13:19:32.000000000","message":"ditto l630.","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"519f6fb92a1b8d2bf832eac7782d064eba6fe8aa","unresolved":false,"context_lines":[{"line_number":635,"context_line":"        result \u003d (model_query(models.Tag)"},{"line_number":636,"context_line":"                  .filter_by(node_id\u003dnode_id)"},{"line_number":637,"context_line":"                  .all())"},{"line_number":638,"context_line":"        return result or None"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a2fa921_78ed8bee","line":638,"updated":"2015-10-12 13:19:32.000000000","message":"ditto l628","commit_id":"986e061b3f21efc37b6ae32fb57db57d9c98b395"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"95ed57cedba6667a875f0ca7179a775e021e2dc3","unresolved":false,"context_lines":[{"line_number":614,"context_line":"            if count \u003d\u003d 0:"},{"line_number":615,"context_line":"                raise exception.NodeNotFound(node_id)"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":618,"context_line":"        with _session_for_write() as session:"},{"line_number":619,"context_line":"            self.node_tags_delete(node_id)"},{"line_number":620,"context_line":"            node_tags \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_5448412d","line":617,"updated":"2015-10-15 10:21:58.000000000","message":"Spec also says about adding and removing tags one by one, but here you only allow adding and deleting all of them. Are you going to handle this in HTTP API?","commit_id":"5933e78f55b813d05b30ba80beba9c23671f027b"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"a646cda1775bc1ccd8bdd3bfb04220a2071142c1","unresolved":false,"context_lines":[{"line_number":614,"context_line":"            if count \u003d\u003d 0:"},{"line_number":615,"context_line":"                raise exception.NodeNotFound(node_id)"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":618,"context_line":"        with _session_for_write() as session:"},{"line_number":619,"context_line":"            self.node_tags_delete(node_id)"},{"line_number":620,"context_line":"            node_tags \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a29b11f_366d6631","line":617,"in_reply_to":"5a2ca52d_5448412d","updated":"2015-10-21 08:36:57.000000000","message":"will update adding and removing single tag in the next patch set.","commit_id":"5933e78f55b813d05b30ba80beba9c23671f027b"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"3bfce588f7c77a69a30a561f5d84e7a60ebdb2a0","unresolved":false,"context_lines":[{"line_number":616,"context_line":""},{"line_number":617,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":618,"context_line":"        with _session_for_write() as session:"},{"line_number":619,"context_line":"            self.node_tags_delete(node_id)"},{"line_number":620,"context_line":"            node_tags \u003d []"},{"line_number":621,"context_line":"            for tag in tags:"},{"line_number":622,"context_line":"                node_tag \u003d models.NodeTag()"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_6916bb56","line":619,"updated":"2015-10-15 12:51:29.000000000","message":"Agree, It seems like you can only add several tags at once. Can you add functions like node_tags_update()","commit_id":"5933e78f55b813d05b30ba80beba9c23671f027b"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"a646cda1775bc1ccd8bdd3bfb04220a2071142c1","unresolved":false,"context_lines":[{"line_number":616,"context_line":""},{"line_number":617,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":618,"context_line":"        with _session_for_write() as session:"},{"line_number":619,"context_line":"            self.node_tags_delete(node_id)"},{"line_number":620,"context_line":"            node_tags \u003d []"},{"line_number":621,"context_line":"            for tag in tags:"},{"line_number":622,"context_line":"                node_tag \u003d models.NodeTag()"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a29b11f_76ebde78","line":619,"in_reply_to":"5a2ca52d_6916bb56","updated":"2015-10-21 08:36:57.000000000","message":"according to API Working Group\u0027s specification for tagging, there\u0027s no tags update support.","commit_id":"5933e78f55b813d05b30ba80beba9c23671f027b"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"95ed57cedba6667a875f0ca7179a775e021e2dc3","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        with _session_for_write():"},{"line_number":632,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":635,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":636,"context_line":"        result \u003d (model_query(models.NodeTag)"},{"line_number":637,"context_line":"                  .filter_by(node_id\u003dnode_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_4f10a84e","line":634,"updated":"2015-10-15 10:21:58.000000000","message":"Spec also says about \u0027Added DB API layer for node tag-list filtering support.\u0027, but I don\u0027t see any filtering added here.","commit_id":"5933e78f55b813d05b30ba80beba9c23671f027b"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"a646cda1775bc1ccd8bdd3bfb04220a2071142c1","unresolved":false,"context_lines":[{"line_number":631,"context_line":"        with _session_for_write():"},{"line_number":632,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":633,"context_line":""},{"line_number":634,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":635,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":636,"context_line":"        result \u003d (model_query(models.NodeTag)"},{"line_number":637,"context_line":"                  .filter_by(node_id\u003dnode_id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a29b11f_f644ceb7","line":634,"in_reply_to":"5a2ca52d_4f10a84e","updated":"2015-10-21 08:36:57.000000000","message":"yeah, that will be a separate patch after tags CRUD operations finished.","commit_id":"5933e78f55b813d05b30ba80beba9c23671f027b"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"4a028d123d300ee9de5d142e095685b8d2096932","unresolved":false,"context_lines":[{"line_number":657,"context_line":"        return node_tag"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    def node_tag_delete(self, node_id, tag):"},{"line_number":660,"context_line":"        # Check node exists."},{"line_number":661,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":662,"context_line":"        with _session_for_write():"},{"line_number":663,"context_line":"            result \u003d model_query(models.NodeTag).filter_by("}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_10d4eae9","line":660,"updated":"2015-10-21 10:27:56.000000000","message":"check if a node exists?","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"988559f7fb194852b2e677b65e86bee8db2cbd5e","unresolved":false,"context_lines":[{"line_number":657,"context_line":"        return node_tag"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"    def node_tag_delete(self, node_id, tag):"},{"line_number":660,"context_line":"        # Check node exists."},{"line_number":661,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":662,"context_line":"        with _session_for_write():"},{"line_number":663,"context_line":"            result \u003d model_query(models.NodeTag).filter_by("}],"source_content_type":"text/x-python","patch_set":6,"id":"3a29b11f_2b8074bf","line":660,"in_reply_to":"3a29b11f_10d4eae9","updated":"2015-10-22 03:27:31.000000000","message":"I think zhenguo want to different two exception, NodeNotFound and NodeTagNotFound, looks reasonable.","commit_id":"66d43fb9081007471977896a7de88a96730b5211"},{"author":{"_account_id":10765,"name":"Andre Aranha","email":"afaranha@lsd.ufcg.edu.br","username":"afaranha"},"change_message_id":"40aead55617925c6f478cd5a53b3aa1181e35375","unresolved":false,"context_lines":[{"line_number":615,"context_line":"                raise exception.NodeNotFound(node_id)"},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":618,"context_line":"        with _session_for_write() as session:"},{"line_number":619,"context_line":"            self.node_tags_delete(node_id)"},{"line_number":620,"context_line":"            node_tags \u003d []"},{"line_number":621,"context_line":"            for tag in tags:"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_f46f8dc1","line":618,"updated":"2015-11-12 13:47:54.000000000","message":"If its suitable to change the comments below, we should check if node exists before entering the session.\nIf not, I think we should explicitly check if node exists, just to be same in case of a future change on \"node_tags_delete\" doesn\u0027t throw exception when the Node doesn\u0027t exists.","commit_id":"c7239cf022c2a19d84b8597d401d59d5b0221774"},{"author":{"_account_id":10765,"name":"Andre Aranha","email":"afaranha@lsd.ufcg.edu.br","username":"afaranha"},"change_message_id":"40aead55617925c6f478cd5a53b3aa1181e35375","unresolved":false,"context_lines":[{"line_number":628,"context_line":""},{"line_number":629,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":630,"context_line":"        # Check node exists."},{"line_number":631,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":632,"context_line":"        with _session_for_write():"},{"line_number":633,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":634,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_0128d131","line":631,"updated":"2015-11-12 13:47:54.000000000","message":"I think that the node doesn\u0027t exists, this method will just do nothing.\nIMO we should just ignore when there is no Node, like here: https://github.com/openstack/ironic/blob/master/ironic/db/sqlalchemy/api.py#L406 .\n\nSame for \"node_tags_get\" and \"node_tag_delete\"","commit_id":"c7239cf022c2a19d84b8597d401d59d5b0221774"},{"author":{"_account_id":10765,"name":"Andre Aranha","email":"afaranha@lsd.ufcg.edu.br","username":"afaranha"},"change_message_id":"40aead55617925c6f478cd5a53b3aa1181e35375","unresolved":false,"context_lines":[{"line_number":646,"context_line":"        node_tag.node_id \u003d node_id"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"        # Check node exists."},{"line_number":649,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":650,"context_line":"        try:"},{"line_number":651,"context_line":"            with _session_for_write() as session:"},{"line_number":652,"context_line":"                session.add(node_tag)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_411819d3","line":649,"updated":"2015-11-12 13:47:54.000000000","message":"i think checking if node exists should be in the first line, so we could prevent unnecessary computation when there is no Node.","commit_id":"c7239cf022c2a19d84b8597d401d59d5b0221774"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2063629fc7a2ee9b369daa7fdc8d2bd61240475","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":619,"context_line":"        with _session_for_write() as session:"},{"line_number":620,"context_line":"            self.node_tags_delete(node_id)"},{"line_number":621,"context_line":"            node_tags \u003d []"},{"line_number":622,"context_line":"            for tag in tags:"},{"line_number":623,"context_line":"                node_tag \u003d models.NodeTag()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_da06de1f","line":620,"updated":"2015-11-25 09:48:36.000000000","message":"now I see that you delete existing tags... maybe node_tags_replace would be a better name for this call?","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1a9d34bf73ecae8422c7b1dbe21022f704535b5b","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":619,"context_line":"        with _session_for_write() as session:"},{"line_number":620,"context_line":"            self.node_tags_delete(node_id)"},{"line_number":621,"context_line":"            node_tags \u003d []"},{"line_number":622,"context_line":"            for tag in tags:"},{"line_number":623,"context_line":"                node_tag \u003d models.NodeTag()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_3e9a4764","line":620,"in_reply_to":"9a8ffd7b_da06de1f","updated":"2015-11-26 07:49:52.000000000","message":"thanks Dmitry, if it\u0027s not a hard request, I would like to keep the name node_tags_set, as setting the node tags with the specified also make sense.","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2063629fc7a2ee9b369daa7fdc8d2bd61240475","unresolved":false,"context_lines":[{"line_number":622,"context_line":"            for tag in tags:"},{"line_number":623,"context_line":"                node_tag \u003d models.NodeTag()"},{"line_number":624,"context_line":"                node_tag.tag \u003d tag"},{"line_number":625,"context_line":"                node_tag.node_id \u003d node_id"},{"line_number":626,"context_line":"                session.add(node_tag)"},{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_fa03a20d","line":625,"updated":"2015-11-25 09:48:36.000000000","message":"shorter:\n\n node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1a9d34bf73ecae8422c7b1dbe21022f704535b5b","unresolved":false,"context_lines":[{"line_number":622,"context_line":"            for tag in tags:"},{"line_number":623,"context_line":"                node_tag \u003d models.NodeTag()"},{"line_number":624,"context_line":"                node_tag.tag \u003d tag"},{"line_number":625,"context_line":"                node_tag.node_id \u003d node_id"},{"line_number":626,"context_line":"                session.add(node_tag)"},{"line_number":627,"context_line":"                node_tags.append(node_tag)"},{"line_number":628,"context_line":"        return node_tags"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_3e21e79f","line":625,"in_reply_to":"9a8ffd7b_fa03a20d","updated":"2015-11-26 07:49:52.000000000","message":"Done","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2063629fc7a2ee9b369daa7fdc8d2bd61240475","unresolved":false,"context_lines":[{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":631,"context_line":"        # Check node exists."},{"line_number":632,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":633,"context_line":"        with _session_for_write():"},{"line_number":634,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":635,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_95ffc900","line":632,"updated":"2015-11-25 09:48:36.000000000","message":"I\u0027m not convinced that fetching the whole node is a good way to check for it, node object can be pretty big right now. Let\u0027s have a separate function that only checks for presence and does not load node object itself.","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1a9d34bf73ecae8422c7b1dbe21022f704535b5b","unresolved":false,"context_lines":[{"line_number":629,"context_line":""},{"line_number":630,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":631,"context_line":"        # Check node exists."},{"line_number":632,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":633,"context_line":"        with _session_for_write():"},{"line_number":634,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":635,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_9e09f3df","line":632,"in_reply_to":"9a8ffd7b_95ffc900","updated":"2015-11-26 07:49:52.000000000","message":"thanks Dmitry, will add a _check_node_exists method for this.","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2063629fc7a2ee9b369daa7fdc8d2bd61240475","unresolved":false,"context_lines":[{"line_number":650,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":651,"context_line":"        try:"},{"line_number":652,"context_line":"            with _session_for_write() as session:"},{"line_number":653,"context_line":"                session.add(node_tag)"},{"line_number":654,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":655,"context_line":"            # NOTE(Zhenguo): ignore tags duplicates"},{"line_number":656,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_b5044d15","line":653,"updated":"2015-11-25 09:48:36.000000000","message":"ditto about shorter version","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1a9d34bf73ecae8422c7b1dbe21022f704535b5b","unresolved":false,"context_lines":[{"line_number":650,"context_line":"        self.get_node_by_id(node_id)"},{"line_number":651,"context_line":"        try:"},{"line_number":652,"context_line":"            with _session_for_write() as session:"},{"line_number":653,"context_line":"                session.add(node_tag)"},{"line_number":654,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":655,"context_line":"            # NOTE(Zhenguo): ignore tags duplicates"},{"line_number":656,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a8ffd7b_7e2d2f45","line":653,"in_reply_to":"9a8ffd7b_b5044d15","updated":"2015-11-26 07:49:52.000000000","message":"Done","commit_id":"75240115fd8161e4b7f1878851813dc7c15ab972"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"33a452ff60dee0ebe25b1f308dda90b042ea7985","unresolved":false,"context_lines":[{"line_number":616,"context_line":"                raise exception.NodeNotFound(node_id)"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    def _check_node_exists(self, node_id):"},{"line_number":619,"context_line":"        if not model_query(models.Node).filter_by(id\u003dnode_id).first():"},{"line_number":620,"context_line":"            raise exception.NodeNotFound(node\u003dnode_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    def node_tags_set(self, node_id, tags):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_97e8f111","line":619,"updated":"2015-11-26 08:37:31.000000000","message":"There is no much difference between _check_node_exists and get_node_by_id, I think.\n\nfirst() return the first result and one() return exactly one result or raise an exception.\n\nWhat about using scalar() which returns the first column of the result row\n\nOr only query a column of Node.\nBoth of them should be OK to check if the node exist","commit_id":"4f76ec01e6c9cca193fc487c2398935f9baf1d0e"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"32e6d9bf3ce02622b8d519c55fb7ca04613ff452","unresolved":false,"context_lines":[{"line_number":616,"context_line":"                raise exception.NodeNotFound(node_id)"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    def _check_node_exists(self, node_id):"},{"line_number":619,"context_line":"        if not model_query(models.Node).filter_by(id\u003dnode_id).first():"},{"line_number":620,"context_line":"            raise exception.NodeNotFound(node\u003dnode_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    def node_tags_set(self, node_id, tags):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_43ea7475","line":619,"in_reply_to":"9a8ffd7b_97e8f111","updated":"2015-11-28 02:06:28.000000000","message":"good point, thanks Tan, will update to use scalar here.","commit_id":"4f76ec01e6c9cca193fc487c2398935f9baf1d0e"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    def _check_node_exists(self, node_id):"},{"line_number":619,"context_line":"        if not model_query(models.Node).filter_by(id\u003dnode_id).scalar():"},{"line_number":620,"context_line":"            raise exception.NodeNotFound(node\u003dnode_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":623,"context_line":"        with _session_for_write() as session:"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_d43a45cd","line":620,"updated":"2016-01-27 23:10:18.000000000","message":"Instead of this, what about calling get_node_by_id() (line 274)","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d469c521daa7a04ccf1e96230728b493a1323969","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    def _check_node_exists(self, node_id):"},{"line_number":619,"context_line":"        if not model_query(models.Node).filter_by(id\u003dnode_id).scalar():"},{"line_number":620,"context_line":"            raise exception.NodeNotFound(node\u003dnode_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":623,"context_line":"        with _session_for_write() as session:"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_dc4d6773","line":620,"in_reply_to":"7a5de9d1_0023b3be","updated":"2016-01-28 15:53:21.000000000","message":"ok, so for efficiency reasons. Fair enough.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    def _check_node_exists(self, node_id):"},{"line_number":619,"context_line":"        if not model_query(models.Node).filter_by(id\u003dnode_id).scalar():"},{"line_number":620,"context_line":"            raise exception.NodeNotFound(node\u003dnode_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    def node_tags_set(self, node_id, tags):"},{"line_number":623,"context_line":"        with _session_for_write() as session:"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_0023b3be","line":620,"in_reply_to":"7a5de9d1_d43a45cd","updated":"2016-01-28 02:16:47.000000000","message":"hi Ruby, please see comments here https://review.openstack.org/#/c/232598/8/ironic/db/sqlalchemy/api.py it\u0027s no need to fetch the whole node to check this.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":626,"context_line":"            for tag in tags:"},{"line_number":627,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":628,"context_line":"                session.add(node_tag)"},{"line_number":629,"context_line":"                node_tags.append(node_tag)"},{"line_number":630,"context_line":"        return node_tags"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def node_tags_delete(self, node_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_545e55ea","line":629,"updated":"2016-01-27 23:10:18.000000000","message":"I see that other methods call session.flush(). Should it be called here, or is it unnecessary?\n\nSame question for all the methods where it is applicable.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"f302cbd2436e423172286f78b85ac70b993d5d0f","unresolved":false,"context_lines":[{"line_number":626,"context_line":"            for tag in tags:"},{"line_number":627,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":628,"context_line":"                session.add(node_tag)"},{"line_number":629,"context_line":"                node_tags.append(node_tag)"},{"line_number":630,"context_line":"        return node_tags"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def node_tags_delete(self, node_id):"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_56c73512","line":629,"in_reply_to":"7a5de9d1_545e55ea","updated":"2016-01-28 08:47:33.000000000","message":"Done","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":628,"context_line":"                session.add(node_tag)"},{"line_number":629,"context_line":"                node_tags.append(node_tag)"},{"line_number":630,"context_line":"        return node_tags"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":633,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_94e7ed3f","line":630,"updated":"2016-01-27 23:10:18.000000000","message":"what happens if the same tag occurs more than once in tags. An exception will be raised I think. Is that what we want?","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"f302cbd2436e423172286f78b85ac70b993d5d0f","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":628,"context_line":"                session.add(node_tag)"},{"line_number":629,"context_line":"                node_tags.append(node_tag)"},{"line_number":630,"context_line":"        return node_tags"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":633,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_07742233","line":630,"in_reply_to":"7a5de9d1_206d8f04","updated":"2016-01-28 08:47:33.000000000","message":"Ruby, I can use set() to remove the duplicate tags before add to db.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":627,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":628,"context_line":"                session.add(node_tag)"},{"line_number":629,"context_line":"                node_tags.append(node_tag)"},{"line_number":630,"context_line":"        return node_tags"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":633,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_206d8f04","line":630,"in_reply_to":"7a5de9d1_94e7ed3f","updated":"2016-01-28 02:16:47.000000000","message":"thanks Ruby, in this case, I think we should not raise exception, will ignore the duplicate exception here.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        return node_tags"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":633,"context_line":"        # Check node exists."},{"line_number":634,"context_line":"        self._check_node_exists(node_id)"},{"line_number":635,"context_line":"        with _session_for_write():"},{"line_number":636,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_b12c7bac","line":633,"updated":"2016-01-27 23:10:18.000000000","message":"I don\u0027t think this comment is necessary. self._check_node_exists() is self-explanatory!","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        return node_tags"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"    def node_tags_delete(self, node_id):"},{"line_number":633,"context_line":"        # Check node exists."},{"line_number":634,"context_line":"        self._check_node_exists(node_id)"},{"line_number":635,"context_line":"        with _session_for_write():"},{"line_number":636,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_c07efbad","line":633,"in_reply_to":"7a5de9d1_b12c7bac","updated":"2016-01-28 02:16:47.000000000","message":"Done","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":633,"context_line":"        # Check node exists."},{"line_number":634,"context_line":"        self._check_node_exists(node_id)"},{"line_number":635,"context_line":"        with _session_for_write():"},{"line_number":636,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":639,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_5405f5bf","line":636,"updated":"2016-01-27 23:10:18.000000000","message":"Instead of the check for node existence, what do you think about using a similar pattern as eg destroy_port() (line 448)?\n\nSame question for all the methods.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"08b7c920f31b46c3356a2cf79f311e286d449527","unresolved":false,"context_lines":[{"line_number":633,"context_line":"        # Check node exists."},{"line_number":634,"context_line":"        self._check_node_exists(node_id)"},{"line_number":635,"context_line":"        with _session_for_write():"},{"line_number":636,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":639,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_dfeeb98a","line":636,"in_reply_to":"7a5de9d1_3ced9bef","updated":"2016-01-28 16:06:23.000000000","message":"During delete node process, we will delete the associated ports first, and then delete the tags like ports. please reference the subsequent patch: https://review.openstack.org/#/c/250478/11/ironic/db/sqlalchemy/api.py","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"7d562a0a642a41a1b1c3ecc00e80e79f4c26e74c","unresolved":false,"context_lines":[{"line_number":633,"context_line":"        # Check node exists."},{"line_number":634,"context_line":"        self._check_node_exists(node_id)"},{"line_number":635,"context_line":"        with _session_for_write():"},{"line_number":636,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":639,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_bb5f740d","line":636,"in_reply_to":"7a5de9d1_5405f5bf","updated":"2016-01-28 02:16:47.000000000","message":"yeah, I think we can use the same way as destroy_port in this delete method, but not for other methods.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d469c521daa7a04ccf1e96230728b493a1323969","unresolved":false,"context_lines":[{"line_number":633,"context_line":"        # Check node exists."},{"line_number":634,"context_line":"        self._check_node_exists(node_id)"},{"line_number":635,"context_line":"        with _session_for_write():"},{"line_number":636,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":639,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_3ced9bef","line":636,"in_reply_to":"7a5de9d1_98f87be7","updated":"2016-01-28 15:53:21.000000000","message":"OH. What happens if we have a NodeTag for node x, and then node x is deleted? Will we still have this NodeTag? If so, we need a way for users to delete them.\n\nAnd/or if a node is being deleted, should the nodetags associated with that node be deleted as well?","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"f302cbd2436e423172286f78b85ac70b993d5d0f","unresolved":false,"context_lines":[{"line_number":633,"context_line":"        # Check node exists."},{"line_number":634,"context_line":"        self._check_node_exists(node_id)"},{"line_number":635,"context_line":"        with _session_for_write():"},{"line_number":636,"context_line":"            model_query(models.NodeTag).filter_by(node_id\u003dnode_id).delete()"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"    def node_tags_get(self, node_id):"},{"line_number":639,"context_line":"        # Check node exists."}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_98f87be7","line":636,"in_reply_to":"7a5de9d1_bb5f740d","updated":"2016-01-28 08:47:33.000000000","message":"after thinking this more, I think it\u0027s not same.\n\nIt checks for node existence, not node tag existence, maybe I should remove _check_node_exists() and just leave this here as we should allow delete node tags whether the node exists or not, and no need to raise NodeTagNotFound exception.","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":641,"context_line":"        result \u003d (model_query(models.NodeTag)"},{"line_number":642,"context_line":"                  .filter_by(node_id\u003dnode_id)"},{"line_number":643,"context_line":"                  .all())"},{"line_number":644,"context_line":"        return result"},{"line_number":645,"context_line":""},{"line_number":646,"context_line":"    def node_tag_add(self, node_id, tag):"},{"line_number":647,"context_line":"        node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_f41d0110","line":644,"updated":"2016-01-27 23:10:18.000000000","message":"ditto about checking for node existence in a different way","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"d934e2e30fba6e4745e7b1c6a357d545af2814e4","unresolved":false,"context_lines":[{"line_number":650,"context_line":"        self._check_node_exists(node_id)"},{"line_number":651,"context_line":"        try:"},{"line_number":652,"context_line":"            with _session_for_write() as session:"},{"line_number":653,"context_line":"                session.add(node_tag)"},{"line_number":654,"context_line":"        except db_exc.DBDuplicateEntry:"},{"line_number":655,"context_line":"            # NOTE(zhenguo): ignore tags duplicates"},{"line_number":656,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":15,"id":"7a5de9d1_b4eea9ea","line":653,"updated":"2016-01-27 23:10:18.000000000","message":"ditto about session.flush()","commit_id":"a0928c10c82c05f0e161e42f6e8e2948c941b5bf"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3dfd7b69e992b0b798ee0142bcb8b7664e820921","unresolved":false,"context_lines":[{"line_number":620,"context_line":"            raise exception.NodeNotFound(node\u003dnode_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    def set_node_tags(self, node_id, tags):"},{"line_number":623,"context_line":"        self._check_node_exists(node_id)"},{"line_number":624,"context_line":"        with _session_for_write() as session:"},{"line_number":625,"context_line":"            self.unset_node_tags(node_id)"},{"line_number":626,"context_line":"            node_tags \u003d []"}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_bccd0bb9","line":623,"updated":"2016-01-28 15:55:26.000000000","message":".unset_node_tags already checks this so this isn\u0027t necessary. You could add a comment about it being done in .unset_node_tags if you want.","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"84f2d26c2b09b9befb68c3dd341cda3ca2e61e7e","unresolved":false,"context_lines":[{"line_number":620,"context_line":"            raise exception.NodeNotFound(node\u003dnode_id)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    def set_node_tags(self, node_id, tags):"},{"line_number":623,"context_line":"        self._check_node_exists(node_id)"},{"line_number":624,"context_line":"        with _session_for_write() as session:"},{"line_number":625,"context_line":"            self.unset_node_tags(node_id)"},{"line_number":626,"context_line":"            node_tags \u003d []"}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_20654ce0","line":623,"in_reply_to":"7a5de9d1_bccd0bb9","updated":"2016-01-29 03:30:17.000000000","message":"Done","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"3dfd7b69e992b0b798ee0142bcb8b7664e820921","unresolved":false,"context_lines":[{"line_number":625,"context_line":"            self.unset_node_tags(node_id)"},{"line_number":626,"context_line":"            node_tags \u003d []"},{"line_number":627,"context_line":"            # remove duplicate tags"},{"line_number":628,"context_line":"            tags \u003d set(tags)"},{"line_number":629,"context_line":"            for tag in tags:"},{"line_number":630,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":631,"context_line":"                session.add(node_tag)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_bcf66bf7","line":628,"updated":"2016-01-28 15:55:26.000000000","message":"you could do this above, before the session.","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"84f2d26c2b09b9befb68c3dd341cda3ca2e61e7e","unresolved":false,"context_lines":[{"line_number":625,"context_line":"            self.unset_node_tags(node_id)"},{"line_number":626,"context_line":"            node_tags \u003d []"},{"line_number":627,"context_line":"            # remove duplicate tags"},{"line_number":628,"context_line":"            tags \u003d set(tags)"},{"line_number":629,"context_line":"            for tag in tags:"},{"line_number":630,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":631,"context_line":"                session.add(node_tag)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7a5de9d1_407de86c","line":628,"in_reply_to":"7a5de9d1_bcf66bf7","updated":"2016-01-29 03:30:17.000000000","message":"Done","commit_id":"56ea78695832e231badaf92a40183c91191a0906"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        # TODO(zhenguo): Support creating node with tags"},{"line_number":259,"context_line":"        if \u0027tags\u0027 in values:"},{"line_number":260,"context_line":"            del values[\u0027tags\u0027]"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        node \u003d models.Node()"},{"line_number":263,"context_line":"        node.update(values)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_4137c64c","line":260,"updated":"2016-02-01 16:01:14.000000000","message":"Should we log a warning if we do this? Presumably, code at the API layer will handle/remove this but since you coded it here, seems like we should log it too.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        # TODO(zhenguo): Support creating node with tags"},{"line_number":259,"context_line":"        if \u0027tags\u0027 in values:"},{"line_number":260,"context_line":"            del values[\u0027tags\u0027]"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        node \u003d models.Node()"},{"line_number":263,"context_line":"        node.update(values)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_4c259308","line":260,"in_reply_to":"7a5de9d1_4137c64c","updated":"2016-02-02 10:01:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":668,"context_line":"        return node_tag"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def delete_node_tag(self, node_id, tag):"},{"line_number":671,"context_line":"        with _session_for_write():"},{"line_number":672,"context_line":"            result \u003d model_query(models.NodeTag).filter_by("},{"line_number":673,"context_line":"                node_id\u003dnode_id, tag\u003dtag).delete()"},{"line_number":674,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_29a2b099","line":671,"updated":"2016-02-01 16:01:14.000000000","message":"I see you removed the call to ._check_node_exists().\n\nWill this still cause NodeNotFound to be raised? (mentioned in db/api.py) From the user\u0027s perspective, I think it might be useful to be able to distinguish if the node id is incorrect, or the tag is.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":668,"context_line":"        return node_tag"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def delete_node_tag(self, node_id, tag):"},{"line_number":671,"context_line":"        with _session_for_write():"},{"line_number":672,"context_line":"            result \u003d model_query(models.NodeTag).filter_by("},{"line_number":673,"context_line":"                node_id\u003dnode_id, tag\u003dtag).delete()"},{"line_number":674,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_ef3a3198","line":671,"in_reply_to":"7a5de9d1_29a2b099","updated":"2016-02-02 10:01:17.000000000","message":"yeah, NodeNotFound will not be raised if the check is removed, will add it back for users to distinguish the error.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"f83b10270af5e63008f2369e1f08a98b68bd3b13","unresolved":false,"context_lines":[{"line_number":260,"context_line":"            del values[\u0027tags\u0027]"},{"line_number":261,"context_line":"            LOG.warning("},{"line_number":262,"context_line":"                _LW(\u0027Ignore the specified tags value when creating node: \u0027"},{"line_number":263,"context_line":"                    \u0027%(node)s.\u0027), {\u0027node\u0027: values[\u0027uuid\u0027]})"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"        node \u003d models.Node()"},{"line_number":266,"context_line":"        node.update(values)"}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_df5103da","line":263,"updated":"2016-02-02 21:17:15.000000000","message":"oh. Maybe log this before you delete it, that way you could also include values[\u0027tags\u0027] in the log.","commit_id":"525303653af2cf61d7bf12aa4f1d5e3be745ffc7"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"d898cd04404fe7c8e7667ef24cc5f9ab51800bcf","unresolved":false,"context_lines":[{"line_number":260,"context_line":"            del values[\u0027tags\u0027]"},{"line_number":261,"context_line":"            LOG.warning("},{"line_number":262,"context_line":"                _LW(\u0027Ignore the specified tags value when creating node: \u0027"},{"line_number":263,"context_line":"                    \u0027%(node)s.\u0027), {\u0027node\u0027: values[\u0027uuid\u0027]})"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"        node \u003d models.Node()"},{"line_number":266,"context_line":"        node.update(values)"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a5ae5dd_d417ca52","line":263,"in_reply_to":"7a5de9d1_df5103da","updated":"2016-02-03 02:56:59.000000000","message":"yeah, that would be better.","commit_id":"525303653af2cf61d7bf12aa4f1d5e3be745ffc7"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"197d48e82b307e50ced376968fe8389e86e1edd5","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                _LW(\u0027Ignore the specified tags %(tags)s when creating node: \u0027"},{"line_number":296,"context_line":"                    \u0027%(node)s.\u0027), {\u0027tags\u0027: values[\u0027tags\u0027],"},{"line_number":297,"context_line":"                                   \u0027node\u0027: values[\u0027uuid\u0027]})"},{"line_number":298,"context_line":"            del values[\u0027tags\u0027]"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        node \u003d models.Node()"},{"line_number":301,"context_line":"        node.update(values)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bae84128_abc9d9ae","line":298,"updated":"2016-02-25 09:01:15.000000000","message":"nit: we should mention this in commit messages too","commit_id":"a7abd4a523ae1f7b1404a7838161207ffe83e514"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"2b325e459d6dafd4c5670abb64fe9cacc75ee7fa","unresolved":false,"context_lines":[{"line_number":295,"context_line":"                _LW(\u0027Ignore the specified tags %(tags)s when creating node: \u0027"},{"line_number":296,"context_line":"                    \u0027%(node)s.\u0027), {\u0027tags\u0027: values[\u0027tags\u0027],"},{"line_number":297,"context_line":"                                   \u0027node\u0027: values[\u0027uuid\u0027]})"},{"line_number":298,"context_line":"            del values[\u0027tags\u0027]"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"        node \u003d models.Node()"},{"line_number":301,"context_line":"        node.update(values)"}],"source_content_type":"text/x-python","patch_set":23,"id":"bae84128_863a07e6","line":298,"in_reply_to":"bae84128_abc9d9ae","updated":"2016-02-25 09:55:21.000000000","message":"that would be more clear, thanks!","commit_id":"a7abd4a523ae1f7b1404a7838161207ffe83e514"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"197d48e82b307e50ced376968fe8389e86e1edd5","unresolved":false,"context_lines":[{"line_number":789,"context_line":"            for tag in tags:"},{"line_number":790,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":791,"context_line":"                session.add(node_tag)"},{"line_number":792,"context_line":"                session.flush()"},{"line_number":793,"context_line":"                node_tags.append(node_tag)"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":"        return node_tags"}],"source_content_type":"text/x-python","patch_set":23,"id":"bae84128_abaf197c","line":792,"updated":"2016-02-25 09:01:15.000000000","message":"why flush for every tags? you should add several node_tag(or use add_all) and flush once. each flush action will communicate with database once, and this is not efficiency in your case","commit_id":"a7abd4a523ae1f7b1404a7838161207ffe83e514"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"2b325e459d6dafd4c5670abb64fe9cacc75ee7fa","unresolved":false,"context_lines":[{"line_number":789,"context_line":"            for tag in tags:"},{"line_number":790,"context_line":"                node_tag \u003d models.NodeTag(tag\u003dtag, node_id\u003dnode_id)"},{"line_number":791,"context_line":"                session.add(node_tag)"},{"line_number":792,"context_line":"                session.flush()"},{"line_number":793,"context_line":"                node_tags.append(node_tag)"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":"        return node_tags"}],"source_content_type":"text/x-python","patch_set":23,"id":"bae84128_26c05be0","line":792,"in_reply_to":"bae84128_abaf197c","updated":"2016-02-25 09:55:21.000000000","message":"for the purpose of catching the duplicate entry, but as the logic of removing duplication have been added at L785 in the recent patch set, seems it\u0027s not needed now, will update soon, thanks Tan!","commit_id":"a7abd4a523ae1f7b1404a7838161207ffe83e514"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"da4eba9f3cf50f69448ebae36675a1dca58e4d84","unresolved":false,"context_lines":[{"line_number":828,"context_line":"            if not result:"},{"line_number":829,"context_line":"                raise exception.NodeTagNotFound(node_id\u003dnode_id, tag\u003dtag)"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":"    def node_tag_exists(self, node_id, tag):"},{"line_number":832,"context_line":"        q \u003d model_query(models.NodeTag).filter_by(node_id\u003dnode_id, tag\u003dtag)"},{"line_number":833,"context_line":"        return model_query(q.exists()).scalar()"}],"source_content_type":"text/x-python","patch_set":24,"id":"bae84128_0c9b9fca","line":831,"updated":"2016-02-25 16:48:55.000000000","message":"Maybe also _check_node_exists() here? Node with node_id might not be present.","commit_id":"5c0bcf5470833ebe4ca4a2a9e0fcd09053232c0d"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"b6ba044bff34336928d871430a556fa210d54405","unresolved":false,"context_lines":[{"line_number":828,"context_line":"            if not result:"},{"line_number":829,"context_line":"                raise exception.NodeTagNotFound(node_id\u003dnode_id, tag\u003dtag)"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":"    def node_tag_exists(self, node_id, tag):"},{"line_number":832,"context_line":"        q \u003d model_query(models.NodeTag).filter_by(node_id\u003dnode_id, tag\u003dtag)"},{"line_number":833,"context_line":"        return model_query(q.exists()).scalar()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9aed3d3a_fd81de90","line":831,"in_reply_to":"9aed3d3a_f362c1d7","updated":"2016-02-26 09:26:48.000000000","message":"If foreign key constraint works on DB backend node with tags can not be deleted from nodes table. But OK as is.","commit_id":"5c0bcf5470833ebe4ca4a2a9e0fcd09053232c0d"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"3db3ca6b848cab4efcd22ae0a3aa054f9123e2ea","unresolved":false,"context_lines":[{"line_number":828,"context_line":"            if not result:"},{"line_number":829,"context_line":"                raise exception.NodeTagNotFound(node_id\u003dnode_id, tag\u003dtag)"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":"    def node_tag_exists(self, node_id, tag):"},{"line_number":832,"context_line":"        q \u003d model_query(models.NodeTag).filter_by(node_id\u003dnode_id, tag\u003dtag)"},{"line_number":833,"context_line":"        return model_query(q.exists()).scalar()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9aed3d3a_f362c1d7","line":831,"in_reply_to":"bae84128_0c9b9fca","updated":"2016-02-26 02:37:14.000000000","message":"hi Yuriy, I would like to give users the opportunity to check whether tag exists regardless of node present or not, in case of node destroyed but the related tags left.","commit_id":"5c0bcf5470833ebe4ca4a2a9e0fcd09053232c0d"}],"ironic/tests/unit/db/test_node_tags.py":[{"author":{"_account_id":10765,"name":"Andre Aranha","email":"afaranha@lsd.ufcg.edu.br","username":"afaranha"},"change_message_id":"40aead55617925c6f478cd5a53b3aa1181e35375","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        self.assertEqual(\u0027tag1\u0027, tags[0].tag)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def test_node_tags_get_node_not_exist(self):"},{"line_number":46,"context_line":"        self.assertRaises(exception.NodeNotFound,"},{"line_number":47,"context_line":"                          self.dbapi.node_tags_get, \u0027123\u0027)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_node_tags_delete(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_9442c1ac","line":46,"updated":"2015-11-12 13:47:54.000000000","message":"If change on /ironic/db/sqlalchemy/api.py is suitable, change this and some tests below.","commit_id":"c7239cf022c2a19d84b8597d401d59d5b0221774"},{"author":{"_account_id":10765,"name":"Andre Aranha","email":"afaranha@lsd.ufcg.edu.br","username":"afaranha"},"change_message_id":"40aead55617925c6f478cd5a53b3aa1181e35375","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        tag \u003d self.dbapi.node_tag_add(self.node.id, \u0027tag1\u0027)"},{"line_number":66,"context_line":"        tag \u003d self.dbapi.node_tag_add(self.node.id, \u0027tag1\u0027)"},{"line_number":67,"context_line":"        self.assertEqual(self.node.id, tag.node_id)"},{"line_number":68,"context_line":"        self.assertEqual(\u0027tag1\u0027, tag.tag)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_node_tag_delete(self):"},{"line_number":71,"context_line":"        self.dbapi.node_tags_set(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"da85f559_3450b531","line":68,"updated":"2015-11-12 13:47:54.000000000","message":"Should a test be added to check if when a node with no tags receives the same tags twice, the node tag list is 1 instead of 2?","commit_id":"c7239cf022c2a19d84b8597d401d59d5b0221774"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"\"\"\"Tests for manipulating Tags via the DB API\"\"\""},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from ironic.common import exception"},{"line_number":16,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_53823dc9","line":13,"updated":"2016-02-01 16:01:14.000000000","message":"s/Tags/NodeTags/? or /Node Tags/?","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"\"\"\"Tests for manipulating Tags via the DB API\"\"\""},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from ironic.common import exception"},{"line_number":16,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_6f6e4198","line":13,"in_reply_to":"7a5de9d1_53823dc9","updated":"2016-02-02 10:01:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from ironic.tests.unit.db import utils as db_utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class DbTagTestCase(base.DbTestCase):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    def setUp(self):"},{"line_number":24,"context_line":"        super(DbTagTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_d3762d05","line":21,"updated":"2016-02-01 16:01:14.000000000","message":"s/Tag/NodeTag/","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from ironic.tests.unit.db import utils as db_utils"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class DbTagTestCase(base.DbTestCase):"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    def setUp(self):"},{"line_number":24,"context_line":"        super(DbTagTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_0f6b0d87","line":21,"in_reply_to":"7a5de9d1_d3762d05","updated":"2016-02-02 10:01:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":47,"context_line":"        tags \u003d self.dbapi.get_node_tags_by_node_id(self.node.id)"},{"line_number":48,"context_line":"        self.assertEqual(self.node.id, tags[0].node_id)"},{"line_number":49,"context_line":"        self.assertEqual(\u0027tag1\u0027, tags[0].tag)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_get_node_tags_node_not_exist(self):"},{"line_number":52,"context_line":"        self.assertRaises(exception.NodeNotFound,"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_16d27328","line":49,"updated":"2016-02-01 16:01:14.000000000","message":"I\u0027m surprised you didn\u0027t use a similar assert like line 39 above. You get two tags back right? This only checks that there is one tag.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":47,"context_line":"        tags \u003d self.dbapi.get_node_tags_by_node_id(self.node.id)"},{"line_number":48,"context_line":"        self.assertEqual(self.node.id, tags[0].node_id)"},{"line_number":49,"context_line":"        self.assertEqual(\u0027tag1\u0027, tags[0].tag)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_get_node_tags_node_not_exist(self):"},{"line_number":52,"context_line":"        self.assertRaises(exception.NodeNotFound,"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_8f24dd60","line":49,"in_reply_to":"7a5de9d1_16d27328","updated":"2016-02-02 10:01:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_get_node_tags_node_not_exist(self):"},{"line_number":52,"context_line":"        self.assertRaises(exception.NodeNotFound,"},{"line_number":53,"context_line":"                          self.dbapi.get_node_tags_by_node_id, \u0027123\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def test_unset_node_tags(self):"},{"line_number":56,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_d6da9b16","line":53,"updated":"2016-02-01 16:01:14.000000000","message":"Should we test getting node tags for a node that doesn\u0027t have any tags?","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_get_node_tags_node_not_exist(self):"},{"line_number":52,"context_line":"        self.assertRaises(exception.NodeNotFound,"},{"line_number":53,"context_line":"                          self.dbapi.get_node_tags_by_node_id, \u0027123\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def test_unset_node_tags(self):"},{"line_number":56,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_0fc78d65","line":53,"in_reply_to":"7a5de9d1_d6da9b16","updated":"2016-02-02 10:01:17.000000000","message":"yeah, will add that in the coming patch set.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def test_unset_node_tags_node_not_exist(self):"},{"line_number":62,"context_line":"        self.assertRaises(exception.NodeNotFound,"},{"line_number":63,"context_line":"                          self.dbapi.unset_node_tags, \u0027123\u0027)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_add_node_tag(self):"},{"line_number":66,"context_line":"        tag \u003d self.dbapi.add_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":67,"context_line":"        self.assertEqual(self.node.id, tag.node_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_f64317ad","line":64,"updated":"2016-02-01 16:01:14.000000000","message":"Should we test unsetting node tags for a node that doesn\u0027t have any tags?","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def test_unset_node_tags_node_not_exist(self):"},{"line_number":62,"context_line":"        self.assertRaises(exception.NodeNotFound,"},{"line_number":63,"context_line":"                          self.dbapi.unset_node_tags, \u0027123\u0027)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def test_add_node_tag(self):"},{"line_number":66,"context_line":"        tag \u003d self.dbapi.add_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":67,"context_line":"        self.assertEqual(self.node.id, tag.node_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_cf8df52b","line":64,"in_reply_to":"7a5de9d1_f64317ad","updated":"2016-02-02 10:01:17.000000000","message":"yeah, will add that in the coming patch set.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        tag \u003d self.dbapi.add_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":73,"context_line":"        self.assertEqual(self.node.id, tag.node_id)"},{"line_number":74,"context_line":"        self.assertEqual(\u0027tag1\u0027, tag.tag)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def test_delete_node_tag(self):"},{"line_number":77,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":78,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag1\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_56430b6c","line":75,"updated":"2016-02-01 16:01:14.000000000","message":"What happens if you add a tag to a node (ID) that doesn\u0027t exist?","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        tag \u003d self.dbapi.add_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":73,"context_line":"        self.assertEqual(self.node.id, tag.node_id)"},{"line_number":74,"context_line":"        self.assertEqual(\u0027tag1\u0027, tag.tag)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def test_delete_node_tag(self):"},{"line_number":77,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":78,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag1\u0027)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_4fd025f8","line":75,"in_reply_to":"7a5de9d1_56430b6c","updated":"2016-02-02 10:01:17.000000000","message":"will raise NodeNotFound, should test that too.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def test_delete_node_tag(self):"},{"line_number":77,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":78,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":79,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag2\u0027)"},{"line_number":80,"context_line":"        tags \u003d self.dbapi.get_node_tags_by_node_id(self.node.id)"},{"line_number":81,"context_line":"        self.assertEqual([], tags)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_b61eff6d","line":79,"updated":"2016-02-01 16:01:14.000000000","message":"I would prefer if the test only deleted one tag.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    def test_delete_node_tag(self):"},{"line_number":77,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":78,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":79,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag2\u0027)"},{"line_number":80,"context_line":"        tags \u003d self.dbapi.get_node_tags_by_node_id(self.node.id)"},{"line_number":81,"context_line":"        self.assertEqual([], tags)"},{"line_number":82,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_6ff40187","line":79,"in_reply_to":"7a5de9d1_b61eff6d","updated":"2016-02-02 10:01:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"f83b10270af5e63008f2369e1f08a98b68bd3b13","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":91,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":92,"context_line":"        tags \u003d self.dbapi.get_node_tags_by_node_id(self.node.id)"},{"line_number":93,"context_line":"        self.assertEqual([\u0027tag2\u0027], [tag.tag for tag in tags])"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_delete_node_tag_not_found(self):"},{"line_number":96,"context_line":"        self.assertRaises(exception.NodeTagNotFound,"}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_71936350","line":93,"updated":"2016-02-02 21:17:15.000000000","message":"there were only two tags and you deleted one. so you should be able to assert that len(tags) is 1 and that this is equal to tags[0].tag.\n\nWhich this does, but doing a for loop over a list of 1 makes it seem odd.","commit_id":"525303653af2cf61d7bf12aa4f1d5e3be745ffc7"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"d898cd04404fe7c8e7667ef24cc5f9ab51800bcf","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        self.dbapi.set_node_tags(self.node.id, [\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":91,"context_line":"        self.dbapi.delete_node_tag(self.node.id, \u0027tag1\u0027)"},{"line_number":92,"context_line":"        tags \u003d self.dbapi.get_node_tags_by_node_id(self.node.id)"},{"line_number":93,"context_line":"        self.assertEqual([\u0027tag2\u0027], [tag.tag for tag in tags])"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_delete_node_tag_not_found(self):"},{"line_number":96,"context_line":"        self.assertRaises(exception.NodeTagNotFound,"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a5ae5dd_7f37cfe3","line":93,"in_reply_to":"7a5de9d1_71936350","updated":"2016-02-03 02:56:59.000000000","message":"Done","commit_id":"525303653af2cf61d7bf12aa4f1d5e3be745ffc7"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"da4eba9f3cf50f69448ebae36675a1dca58e4d84","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        self.assertEqual(1, len(tags))"},{"line_number":94,"context_line":"        self.assertEqual(\u0027tag2\u0027, tags[0].tag)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_delete_node_tag_not_found(self):"},{"line_number":97,"context_line":"        self.assertRaises(exception.NodeTagNotFound,"},{"line_number":98,"context_line":"                          self.dbapi.delete_node_tag, self.node.id, \u0027tag1\u0027)"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"bae84128_c7c4f041","line":96,"updated":"2016-02-25 16:48:55.000000000","message":"missing test_delete_node_tag_node_not_exist","commit_id":"5c0bcf5470833ebe4ca4a2a9e0fcd09053232c0d"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"3db3ca6b848cab4efcd22ae0a3aa054f9123e2ea","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        self.assertEqual(1, len(tags))"},{"line_number":94,"context_line":"        self.assertEqual(\u0027tag2\u0027, tags[0].tag)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_delete_node_tag_not_found(self):"},{"line_number":97,"context_line":"        self.assertRaises(exception.NodeTagNotFound,"},{"line_number":98,"context_line":"                          self.dbapi.delete_node_tag, self.node.id, \u0027tag1\u0027)"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"9aed3d3a_b3f8397e","line":96,"in_reply_to":"bae84128_c7c4f041","updated":"2016-02-26 02:37:14.000000000","message":"Done","commit_id":"5c0bcf5470833ebe4ca4a2a9e0fcd09053232c0d"}],"ironic/tests/unit/db/test_nodes.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class DbNodeTestCase(base.DbTestCase):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def test_create_node(self):"},{"line_number":34,"context_line":"        utils.create_test_node()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_create_node_already_exists(self):"},{"line_number":37,"context_line":"        utils.create_test_node()"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_937c35ed","line":34,"updated":"2016-02-01 16:01:14.000000000","message":"You added that code that removes tags info from nodes being created, so shouldn\u0027t there be a test for that?","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"edc1ae83250d4627b463cc9e4d7343e0341cfd0f","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class DbNodeTestCase(base.DbTestCase):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def test_create_node(self):"},{"line_number":34,"context_line":"        utils.create_test_node()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_create_node_already_exists(self):"},{"line_number":37,"context_line":"        utils.create_test_node()"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_4f3ee52a","line":34,"in_reply_to":"7a5de9d1_937c35ed","updated":"2016-02-02 10:01:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        self.dbapi.destroy_node(node.id)"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        self.assertRaises(exception.NodeTagNotFound,"},{"line_number":333,"context_line":"                          self.dbapi.delete_node_tag, node.id, tag.tag)"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"    def test_tags_get_destroyed_after_destroying_a_node_by_uuid(self):"},{"line_number":336,"context_line":"        node \u003d utils.create_test_node()"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_1324c55b","line":333,"updated":"2016-02-01 16:01:14.000000000","message":"This works but my first thought was to call this twice; before and after the .destroy_node():\n\n    get_node_tags_by_node_id()\n\nI see the above test_ports_get_destroyed_after_destroying_a.. only calls a similar method once so I guess that is OK too.\n\nReally, I\u0027d like a get_node_tag(node_id, tag) but that doesn\u0027t exist. Future work maybe.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"bcc784777bc0c68a09b6e74352ebc481496e0dd4","unresolved":false,"context_lines":[{"line_number":330,"context_line":"        self.dbapi.destroy_node(node.id)"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":"        self.assertRaises(exception.NodeTagNotFound,"},{"line_number":333,"context_line":"                          self.dbapi.delete_node_tag, node.id, tag.tag)"},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"    def test_tags_get_destroyed_after_destroying_a_node_by_uuid(self):"},{"line_number":336,"context_line":"        node \u003d utils.create_test_node()"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_5db8d12a","line":333,"in_reply_to":"7a5de9d1_1324c55b","updated":"2016-02-02 14:30:17.000000000","message":"yes, as I will add check_node_exists back in delete_node_tag, this will raise NodeNotFound instead of NodeTagNotFound, there\u0027s no way to test that tags get destroyed after node deleted unless we add another method get_node_tag() or maybe node_tag_exist().","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        self.dbapi.destroy_node(node.uuid)"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        self.assertRaises(exception.NodeTagNotFound,"},{"line_number":343,"context_line":"                          self.dbapi.delete_node_tag, node.id, tag.tag)"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def test_update_node(self):"},{"line_number":346,"context_line":"        node \u003d utils.create_test_node()"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_73b659fa","line":343,"updated":"2016-02-01 16:01:14.000000000","message":"ditto","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"f83b10270af5e63008f2369e1f08a98b68bd3b13","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        utils.create_test_node()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_create_node_with_tags(self):"},{"line_number":37,"context_line":"        utils.create_test_node(tags\u003d[\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def test_create_node_already_exists(self):"},{"line_number":40,"context_line":"        utils.create_test_node()"}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_71f28371","line":37,"updated":"2016-02-02 21:17:15.000000000","message":"I guess we want to see if anything was logged. Take a look at [1] to see how to mock LOG.warning()\n\n[1] https://github.com/openstack/ironic/blob/a18361903bc7f90218197e41808e81169582e895/ironic/tests/unit/drivers/modules/test_image_cache.py#L472","commit_id":"525303653af2cf61d7bf12aa4f1d5e3be745ffc7"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"d898cd04404fe7c8e7667ef24cc5f9ab51800bcf","unresolved":false,"context_lines":[{"line_number":34,"context_line":"        utils.create_test_node()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def test_create_node_with_tags(self):"},{"line_number":37,"context_line":"        utils.create_test_node(tags\u003d[\u0027tag1\u0027, \u0027tag2\u0027])"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def test_create_node_already_exists(self):"},{"line_number":40,"context_line":"        utils.create_test_node()"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a5ae5dd_df3603b4","line":37,"in_reply_to":"7a5de9d1_71f28371","updated":"2016-02-03 02:56:59.000000000","message":"Done","commit_id":"525303653af2cf61d7bf12aa4f1d5e3be745ffc7"}],"ironic/tests/unit/db/utils.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":346,"context_line":"    }"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"def get_test_tag(**kw):"},{"line_number":350,"context_line":"    return {"},{"line_number":351,"context_line":"        \"tag\": kw.get(\"tag\", \"tag1\"),"},{"line_number":352,"context_line":"        \"node_id\": kw.get(\"node_id\", \"123\"),"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_e1059245","line":349,"updated":"2016-02-01 16:01:14.000000000","message":"in case we ever add tags to other things besides nodes, I think we should be clear and call this get_test_nodetag. or get_test_node_tag. (whatever is consistent with the other methods related to node tags).","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"bcc784777bc0c68a09b6e74352ebc481496e0dd4","unresolved":false,"context_lines":[{"line_number":346,"context_line":"    }"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"def get_test_tag(**kw):"},{"line_number":350,"context_line":"    return {"},{"line_number":351,"context_line":"        \"tag\": kw.get(\"tag\", \"tag1\"),"},{"line_number":352,"context_line":"        \"node_id\": kw.get(\"node_id\", \"123\"),"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_ddf12103","line":349,"in_reply_to":"7a5de9d1_e1059245","updated":"2016-02-02 14:30:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":355,"context_line":"    }"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"def create_test_tag(**kw):"},{"line_number":359,"context_line":"    \"\"\"Create test tag entry in DB and return NodeTag DB object."},{"line_number":360,"context_line":""},{"line_number":361,"context_line":"    Function to be used to create test NodeTag objects in the database."}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_8137fefd","line":358,"updated":"2016-02-01 16:01:14.000000000","message":"ditto","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"bcc784777bc0c68a09b6e74352ebc481496e0dd4","unresolved":false,"context_lines":[{"line_number":355,"context_line":"    }"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":""},{"line_number":358,"context_line":"def create_test_tag(**kw):"},{"line_number":359,"context_line":"    \"\"\"Create test tag entry in DB and return NodeTag DB object."},{"line_number":360,"context_line":""},{"line_number":361,"context_line":"    Function to be used to create test NodeTag objects in the database."}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_fdf65df8","line":358,"in_reply_to":"7a5de9d1_8137fefd","updated":"2016-02-02 14:30:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"beda19387c8a79ff5df47697162952af02252a45","unresolved":false,"context_lines":[{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    \"\"\""},{"line_number":367,"context_line":"    tag \u003d get_test_tag(**kw)"},{"line_number":368,"context_line":"    # Let DB generate ID if it isn\u0027t specified explicitly"},{"line_number":369,"context_line":"    dbapi \u003d db_api.get_instance()"},{"line_number":370,"context_line":"    return dbapi.add_node_tag(tag[\u0027node_id\u0027], tag[\u0027tag\u0027])"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_d3338df4","line":368,"updated":"2016-02-01 16:01:14.000000000","message":"Wondering if this is a copy/paste error. I don\u0027t see that the code is doing this.","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"bcc784777bc0c68a09b6e74352ebc481496e0dd4","unresolved":false,"context_lines":[{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    \"\"\""},{"line_number":367,"context_line":"    tag \u003d get_test_tag(**kw)"},{"line_number":368,"context_line":"    # Let DB generate ID if it isn\u0027t specified explicitly"},{"line_number":369,"context_line":"    dbapi \u003d db_api.get_instance()"},{"line_number":370,"context_line":"    return dbapi.add_node_tag(tag[\u0027node_id\u0027], tag[\u0027tag\u0027])"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_7de34d34","line":368,"in_reply_to":"7a5de9d1_d3338df4","updated":"2016-02-02 14:30:17.000000000","message":"Done","commit_id":"98438e2986627d7fee4d147adb7e5c6f35135ba4"}]}
