)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"change_message_id":"4d6921790057c90d66bc2bcef487e54c369a7bc9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Manish Godara \u003cmanishg@yahoo-inc.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-10-22 10:48:33 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add filter for provider network attributes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Added code to implement filters for provider network"},{"line_number":10,"context_line":"attributes."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9aa7fdbe_69561bd4","line":7,"updated":"2014-10-22 20:53:49.000000000","message":"After reviewing this commit, IMHO this is not a bug fix but rather a feature that needs to be addressed by a spec in Kilo. \nI would like to know if my core peers have the same understanding but if not I am happy to remove my -1","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f65d231f808f38477fb9989ed711f9f83b3ce0ed","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Manish Godara \u003cmanishg@yahoo-inc.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-01-21 16:24:15 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add filter for provider network attributes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Added code to implement filters for provider network attributes."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"1a930d6b_0d5583fa","line":7,"updated":"2015-01-24 14:29:15.000000000","message":"is it supported by others plugins?","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Manish Godara \u003cmanishg@yahoo-inc.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-01-21 16:24:15 -0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add filter for provider network attributes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Added code to implement filters for provider network attributes."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"1a930d6b_5371c142","line":7,"in_reply_to":"1a930d6b_0d5583fa","updated":"2015-01-26 19:31:49.000000000","message":"Done","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1bef856b5d528bf47c838da52c8468774570e701","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add filter for provider network attributes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Added code to implement filters for provider network attributes."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I9eaa8bd8fa35cfe2b94551f9c27336503f118ce6"},{"line_number":12,"context_line":"Closes-Bug: 1333475"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"1a930d6b_75b0ea8b","line":9,"updated":"2015-01-22 03:31:21.000000000","message":"I think you should add a comment in here that this is only done for ML2.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add filter for provider network attributes"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Added code to implement filters for provider network attributes."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I9eaa8bd8fa35cfe2b94551f9c27336503f118ce6"},{"line_number":12,"context_line":"Closes-Bug: 1333475"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"1a930d6b_9396c93d","line":9,"in_reply_to":"1a930d6b_75b0ea8b","updated":"2015-01-26 19:31:49.000000000","message":"Done","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"}],"neutron/plugins/ml2/managers.py":[{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"dd009038a537c59869103ddd74879553fc40f502","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        network_types \u003d filters and filters.get(provider.NETWORK_TYPE, [])"},{"line_number":124,"context_line":"        segment_match \u003d True"},{"line_number":125,"context_line":"        if not (physnets or sids or network_types):"},{"line_number":126,"context_line":"            return segment_match"},{"line_number":127,"context_line":"        if physnets:"},{"line_number":128,"context_line":"            segment_match \u003d \\"},{"line_number":129,"context_line":"                segment.get(provider.PHYSICAL_NETWORK) in physnets"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_d155b0fa","line":126,"updated":"2014-10-06 21:23:44.000000000","message":"return all([\n    not physnets or segment.get(provider.PHYSICAL_NETWORK) in physnets,\n    not sids or segment.get(provider.SEGMENTATION_ID) in sids,\n    not network_types or segment.get(provider.NETWORK_TYPE) in network_types\n])","commit_id":"9209efdd25ebbd2ca3aa84965977817a78deeca1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"5435ed9cdd717ec5a0543801d5c2ddd47f127830","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        msg \u003d _(\"network_type required\")"},{"line_number":89,"context_line":"        raise exc.InvalidInput(error_message\u003dmsg)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def _create_segment_attrib(self, network):"},{"line_number":92,"context_line":"        network_type \u003d self._get_attribute(network, provider.NETWORK_TYPE)"},{"line_number":93,"context_line":"        physical_network \u003d self._get_attribute(network,"},{"line_number":94,"context_line":"                                               provider.PHYSICAL_NETWORK)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_9f03a8b7","line":91,"updated":"2014-10-21 10:37:12.000000000","message":"Maybe it\u0027s a matter of taste...\n\nPROVIDER_NET_KEYS \u003d  [NETOWRK_TYPE, PHYSICAL_NETWORK, SEGMENTASION_ID]\ncan be used in those three methods.","commit_id":"0706323722806ab20bf8f2e2be288bf569b276c3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"5435ed9cdd717ec5a0543801d5c2ddd47f127830","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                                              provider.SEGMENTATION_ID)"},{"line_number":97,"context_line":"        return {provider.NETWORK_TYPE: network_type,"},{"line_number":98,"context_line":"                provider.PHYSICAL_NETWORK: physical_network,"},{"line_number":99,"context_line":"                provider.SEGMENTATION_ID: segmentation_id}"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def _process_provider_create(self, network):"},{"line_number":102,"context_line":"        if any(attributes.is_attr_set(network.get(f))"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_7ff604d9","line":99,"updated":"2014-10-21 10:37:12.000000000","message":"return dict((key, self._get_attribute(network, key)) for key in PROVIDER_NET_KEYS )","commit_id":"0706323722806ab20bf8f2e2be288bf569b276c3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"5435ed9cdd717ec5a0543801d5c2ddd47f127830","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                self.is_partial_segment)"},{"line_number":118,"context_line":"            return segments"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _process_segment_filter(self, segment, filters):"},{"line_number":121,"context_line":"        physnets \u003d filters and filters.get(provider.PHYSICAL_NETWORK, [])"},{"line_number":122,"context_line":"        sids \u003d filters and filters.get(provider.SEGMENTATION_ID, [])"},{"line_number":123,"context_line":"        network_types \u003d filters and filters.get(provider.NETWORK_TYPE, [])"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_9f9f285f","line":120,"updated":"2014-10-21 10:37:12.000000000","message":"This doesn\u0027t actually filtering, but match.\nIt should start with match or something.","commit_id":"0706323722806ab20bf8f2e2be288bf569b276c3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"5435ed9cdd717ec5a0543801d5c2ddd47f127830","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                    provider.SEGMENTATION_ID) in sids,"},{"line_number":129,"context_line":"                not network_types or segment.get("},{"line_number":130,"context_line":"                    provider.NETWORK_TYPE) in network_types"},{"line_number":131,"context_line":"                   ])"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _process_provider_filter(self, network, filters):"},{"line_number":134,"context_line":"        segments \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_dfa1b0aa","line":131,"updated":"2014-10-21 10:37:12.000000000","message":"return all(segment.get(key) in filters and filters.get(key, []) or [] for key in PROVIDER_NET_KEYS)","commit_id":"0706323722806ab20bf8f2e2be288bf569b276c3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0bcb0ec606d71db42dc71682df815dcc72f4495a","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        LOG.info(_(\"Loaded type driver names: %s\"), self.names())"},{"line_number":45,"context_line":"        self.PROVIDER_NET_KEYS \u003d [provider.NETWORK_TYPE,"},{"line_number":46,"context_line":"                                  provider.PHYSICAL_NETWORK,"},{"line_number":47,"context_line":"                                  provider.SEGMENTATION_ID]"},{"line_number":48,"context_line":"        self._register_types()"},{"line_number":49,"context_line":"        self._check_tenant_network_types(cfg.CONF.ml2.tenant_network_types)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_5c0e5c3c","line":47,"updated":"2014-10-23 15:52:42.000000000","message":"This can be class attribute, not instance attribute.","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4e4aa9033d21430678cc69ab7358d00d3e38bcf4","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        LOG.info(_(\"Loaded type driver names: %s\"), self.names())"},{"line_number":45,"context_line":"        self.PROVIDER_NET_KEYS \u003d [provider.NETWORK_TYPE,"},{"line_number":46,"context_line":"                                  provider.PHYSICAL_NETWORK,"},{"line_number":47,"context_line":"                                  provider.SEGMENTATION_ID]"},{"line_number":48,"context_line":"        self._register_types()"},{"line_number":49,"context_line":"        self._check_tenant_network_types(cfg.CONF.ml2.tenant_network_types)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_97fa5f41","line":47,"in_reply_to":"9aa7fdbe_5c0e5c3c","updated":"2014-10-23 16:04:14.000000000","message":"yeah, makes sense.  will do.","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0bcb0ec606d71db42dc71682df815dcc72f4495a","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _create_segment_attrib(self, network):"},{"line_number":95,"context_line":"        return dict((key, self._get_attribute(network, key))"},{"line_number":96,"context_line":"                    for key in self.PROVIDER_NET_KEYS)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def _process_provider_create(self, network):"},{"line_number":99,"context_line":"        if any(attributes.is_attr_set(network.get(f))"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_97497f62","line":96,"updated":"2014-10-23 15:52:42.000000000","message":"Since this is one liner and there is only one caller, please eliminate this method by expanding it.","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4e4aa9033d21430678cc69ab7358d00d3e38bcf4","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _create_segment_attrib(self, network):"},{"line_number":95,"context_line":"        return dict((key, self._get_attribute(network, key))"},{"line_number":96,"context_line":"                    for key in self.PROVIDER_NET_KEYS)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def _process_provider_create(self, network):"},{"line_number":99,"context_line":"        if any(attributes.is_attr_set(network.get(f))"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_b7f76358","line":96,"in_reply_to":"9aa7fdbe_97497f62","updated":"2014-10-23 16:04:14.000000000","message":"It\u0027s called on line 107 and line 129.","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0bcb0ec606d71db42dc71682df815dcc72f4495a","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":118,"context_line":"        if not filters:"},{"line_number":119,"context_line":"            return True"},{"line_number":120,"context_line":"        return all(not filters.get(key, []) or"},{"line_number":121,"context_line":"                   segment.get(key) in filters.get(key, [])"},{"line_number":122,"context_line":"                   for key in self.PROVIDER_NET_KEYS)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_97609fd0","line":119,"updated":"2014-10-23 15:52:42.000000000","message":"This condition should be before line 124","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4e4aa9033d21430678cc69ab7358d00d3e38bcf4","unresolved":false,"context_lines":[{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":118,"context_line":"        if not filters:"},{"line_number":119,"context_line":"            return True"},{"line_number":120,"context_line":"        return all(not filters.get(key, []) or"},{"line_number":121,"context_line":"                   segment.get(key) in filters.get(key, [])"},{"line_number":122,"context_line":"                   for key in self.PROVIDER_NET_KEYS)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_570e373c","line":119,"in_reply_to":"9aa7fdbe_97609fd0","updated":"2014-10-23 16:04:14.000000000","message":"not sure about this.  I think you mean line 134.  However, in future if someone decides to call this method it would be a problem.  It seems like it\u0027s much safer her than in caller unless you are worried about functional call overhead vs condition evaluation in python.\nLet me know what you think.  Maybe I can push this in the all() statement below.","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0bcb0ec606d71db42dc71682df815dcc72f4495a","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        segments \u003d []"},{"line_number":126,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":127,"context_line":"               for f in (provider.NETWORK_TYPE, provider.PHYSICAL_NETWORK,"},{"line_number":128,"context_line":"                         provider.SEGMENTATION_ID)):"},{"line_number":129,"context_line":"            segments \u003d [self._create_segment_attrib(network)]"},{"line_number":130,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":131,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_171f4f5c","line":128,"updated":"2014-10-23 15:52:42.000000000","message":"self.PROVIDER_NET_KEYS","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4e4aa9033d21430678cc69ab7358d00d3e38bcf4","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        segments \u003d []"},{"line_number":126,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":127,"context_line":"               for f in (provider.NETWORK_TYPE, provider.PHYSICAL_NETWORK,"},{"line_number":128,"context_line":"                         provider.SEGMENTATION_ID)):"},{"line_number":129,"context_line":"            segments \u003d [self._create_segment_attrib(network)]"},{"line_number":130,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":131,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_77889bc5","line":128,"in_reply_to":"9aa7fdbe_171f4f5c","updated":"2014-10-23 16:04:14.000000000","message":"ah, I missed this.  thanks!  will update.","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0bcb0ec606d71db42dc71682df815dcc72f4495a","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        for segment in segments:"},{"line_number":133,"context_line":"            if self._match_segment(segment, filters):"},{"line_number":134,"context_line":"                return True"},{"line_number":135,"context_line":"        return False"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _get_attribute(self, attrs, key):"},{"line_number":138,"context_line":"        value \u003d attrs.get(key)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_97b7bf39","line":135,"updated":"2014-10-23 15:52:42.000000000","message":"return any(self._match_segment(segment, filters) for ...)","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4e4aa9033d21430678cc69ab7358d00d3e38bcf4","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        for segment in segments:"},{"line_number":133,"context_line":"            if self._match_segment(segment, filters):"},{"line_number":134,"context_line":"                return True"},{"line_number":135,"context_line":"        return False"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def _get_attribute(self, attrs, key):"},{"line_number":138,"context_line":"        value \u003d attrs.get(key)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_d79787ea","line":135,"in_reply_to":"9aa7fdbe_97b7bf39","updated":"2014-10-23 16:04:14.000000000","message":"yep, good suggestion.  will do.","commit_id":"201ea89146031f37787de3de31cba6d7d3ce5e05"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f2a65d362afb4ca1ae3ea0a6b1495f3fe1823bc8","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        msg \u003d _(\"network_type required\")"},{"line_number":91,"context_line":"        raise exc.InvalidInput(error_message\u003dmsg)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def _create_segment_attribs(self, network):"},{"line_number":94,"context_line":"        return dict((key, self._get_attribute(network, key))"},{"line_number":95,"context_line":"                    for key in self.PROVIDER_NET_KEYS)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_76a574b4","line":93,"updated":"2014-10-29 16:20:03.000000000","message":"attribs sounds a little weird.\nmaybe attrs or attributes?","commit_id":"b76d5f776935d23b36e6301c254180176b9227a1"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"f2a65d362afb4ca1ae3ea0a6b1495f3fe1823bc8","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        segments \u003d []"},{"line_number":122,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":123,"context_line":"               for f in (provider.NETWORK_TYPE, provider.PHYSICAL_NETWORK,"},{"line_number":124,"context_line":"                         provider.SEGMENTATION_ID)):"},{"line_number":125,"context_line":"            segments \u003d [self._create_segment_attribs(network)]"},{"line_number":126,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":127,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_56dcf018","line":124,"updated":"2014-10-29 16:20:03.000000000","message":"why don\u0027t you use PROVIDER_NET_KEYS?","commit_id":"b76d5f776935d23b36e6301c254180176b9227a1"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"083dc0ba3f89fc33a66698a49883bc66f51b1cbc","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        msg \u003d _(\"network_type required\")"},{"line_number":91,"context_line":"        raise exc.InvalidInput(error_message\u003dmsg)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def _create_segment_attributes(self, network):"},{"line_number":94,"context_line":"        return dict((key, self._get_attribute(network, key))"},{"line_number":95,"context_line":"                    for key in self.PROVIDER_NET_KEYS)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a8c0949_3794da36","line":93,"updated":"2014-10-30 01:18:33.000000000","message":"i prefer _get_segment_attributes.\nbut i don\u0027t insist.","commit_id":"34ad0198609a4f0d67a1f3e53ba2bae7643af165"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"632fd2b8f285cb640cb1136ab7cd1be604eee670","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        msg \u003d _(\"network_type required\")"},{"line_number":91,"context_line":"        raise exc.InvalidInput(error_message\u003dmsg)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def _create_segment_attributes(self, network):"},{"line_number":94,"context_line":"        return dict((key, self._get_attribute(network, key))"},{"line_number":95,"context_line":"                    for key in self.PROVIDER_NET_KEYS)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a8c0949_d2b54bce","line":93,"in_reply_to":"7a8c0949_3794da36","updated":"2014-10-30 20:39:39.000000000","message":"yeah, makes sense.  will update.","commit_id":"34ad0198609a4f0d67a1f3e53ba2bae7643af165"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"0708066c8f881875cc974bd641df9da783fcae44","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        msg \u003d _(\"network_type required\")"},{"line_number":91,"context_line":"        raise exc.InvalidInput(error_message\u003dmsg)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def _create_segment_attributes(self, network):"},{"line_number":94,"context_line":"        return dict((key, self._get_attribute(network, key))"},{"line_number":95,"context_line":"                    for key in self.PROVIDER_NET_KEYS)"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a8c0949_f1867b64","line":93,"in_reply_to":"7a8c0949_d2b54bce","updated":"2014-11-06 13:12:33.000000000","message":"done in latest patch.","commit_id":"34ad0198609a4f0d67a1f3e53ba2bae7643af165"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"083dc0ba3f89fc33a66698a49883bc66f51b1cbc","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            segments \u003d [self._create_segment_attributes(network)]"},{"line_number":125,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":126,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":127,"context_line":"        return any(not filters or"},{"line_number":128,"context_line":"                   self._match_segment(segment, filters)"},{"line_number":129,"context_line":"                   for segment in segments)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a8c0949_f7eed2b3","line":127,"updated":"2014-10-30 01:18:33.000000000","message":"imo it\u0027s more readable if \"not filters\" check is out of any().\nor push it into _match_segment().","commit_id":"34ad0198609a4f0d67a1f3e53ba2bae7643af165"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"0708066c8f881875cc974bd641df9da783fcae44","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            segments \u003d [self._create_segment_attributes(network)]"},{"line_number":125,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":126,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":127,"context_line":"        return any(not filters or"},{"line_number":128,"context_line":"                   self._match_segment(segment, filters)"},{"line_number":129,"context_line":"                   for segment in segments)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a8c0949_71928ba0","line":127,"in_reply_to":"7a8c0949_92bbc3c3","updated":"2014-11-06 13:12:33.000000000","message":"changed.  moved to the method.","commit_id":"34ad0198609a4f0d67a1f3e53ba2bae7643af165"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"632fd2b8f285cb640cb1136ab7cd1be604eee670","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            segments \u003d [self._create_segment_attributes(network)]"},{"line_number":125,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":126,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":127,"context_line":"        return any(not filters or"},{"line_number":128,"context_line":"                   self._match_segment(segment, filters)"},{"line_number":129,"context_line":"                   for segment in segments)"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a8c0949_92bbc3c3","line":127,"in_reply_to":"7a8c0949_f7eed2b3","updated":"2014-10-30 20:39:39.000000000","message":"yamamoto, this was outside (in _match_segment) earlier.  can you see patchset7 ?  I personally prefer it in match_segment as future callers don\u0027t need to do the check before calling it.  Let me know.","commit_id":"34ad0198609a4f0d67a1f3e53ba2bae7643af165"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"b8e1e4d52d81dde00b6feb9749ebedeb5d136e86","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    PROVIDER_NET_KEYS \u003d [provider.NETWORK_TYPE,"},{"line_number":36,"context_line":"                         provider.PHYSICAL_NETWORK,"},{"line_number":37,"context_line":"                         provider.SEGMENTATION_ID]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def __init__(self):"},{"line_number":40,"context_line":"        # Mapping from type name to DriverManager"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_f6775b00","line":37,"updated":"2014-12-10 00:01:12.000000000","message":"I\u0027d suggest moving all the refactoring that makes use of the above list to a separate dependent patch that is nothing but refactoring and doesn\u0027t require any UT changes. These changes are nice, but take the focus away from the changes necessary for filtering.","commit_id":"91b6136b99ca3165db67b436d7ef43ae1624be90"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"ad003a7cde6361fb6d31e3d1232b42cb17c25409","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    PROVIDER_NET_KEYS \u003d [provider.NETWORK_TYPE,"},{"line_number":36,"context_line":"                         provider.PHYSICAL_NETWORK,"},{"line_number":37,"context_line":"                         provider.SEGMENTATION_ID]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def __init__(self):"},{"line_number":40,"context_line":"        # Mapping from type name to DriverManager"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_203e878c","line":37,"in_reply_to":"3a961159_f6775b00","updated":"2014-12-12 19:05:42.000000000","message":"rkukura: it looks like implementing filters is pretty ugly without the refactor.  The refactor is minor and was done only to facilitate filtering - otherwise it looks very clumsy.  Please take a look at prior patches.  Please update review if you agree.  If not, please keep me posted.","commit_id":"91b6136b99ca3165db67b436d7ef43ae1624be90"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"fce1f05d89f6a9d4536578f797ecd659149eeab5","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    PROVIDER_NET_KEYS \u003d [provider.NETWORK_TYPE,"},{"line_number":36,"context_line":"                         provider.PHYSICAL_NETWORK,"},{"line_number":37,"context_line":"                         provider.SEGMENTATION_ID]"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def __init__(self):"},{"line_number":40,"context_line":"        # Mapping from type name to DriverManager"}],"source_content_type":"text/x-python","patch_set":12,"id":"3a961159_ecadce89","line":37,"in_reply_to":"3a961159_f6775b00","updated":"2014-12-10 01:08:32.000000000","message":"will do.  thx for the review.","commit_id":"91b6136b99ca3165db67b436d7ef43ae1624be90"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f65d231f808f38477fb9989ed711f9f83b3ce0ed","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":116,"context_line":"        if not filters:"},{"line_number":117,"context_line":"            return True"},{"line_number":118,"context_line":"        return all(not filters.get(key, []) or"},{"line_number":119,"context_line":"                   segment.get(key) in filters.get(key, [])"},{"line_number":120,"context_line":"                   for key in self.PROVIDER_NET_KEYS)"},{"line_number":121,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_cd8b7b66","line":118,"updated":"2015-01-24 14:29:15.000000000","message":"the following is equivalent and more readable:\n\n  return all(not filters.get(key) or segment.get(key) in filters[key]\n\t\t  for key in self.PROVIDER_NET_KEYS)\n\nbecause:\n\n* [] and None are both evaluated to False\n* the 2nd part of the condition is not evaluated key is not in filters","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":116,"context_line":"        if not filters:"},{"line_number":117,"context_line":"            return True"},{"line_number":118,"context_line":"        return all(not filters.get(key, []) or"},{"line_number":119,"context_line":"                   segment.get(key) in filters.get(key, [])"},{"line_number":120,"context_line":"                   for key in self.PROVIDER_NET_KEYS)"},{"line_number":121,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_f3a46da7","line":118,"in_reply_to":"1a930d6b_cd8b7b66","updated":"2015-01-26 19:31:49.000000000","message":"makes sense.  done.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2cc2bcd935b310ddebcee566851fa57af17edd5","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":112,"context_line":"        if not filters:"},{"line_number":113,"context_line":"            return True"},{"line_number":114,"context_line":"        return all(not filters.get(key) or segment.get(key) in filters[key]"},{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_networks(self, network, filters):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_227e02e5","line":114,"updated":"2015-01-29 13:35:44.000000000","message":"could be changed into:\n\nreturn all(segment.get(key) in filters[key] for key in filters.keys())","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"03eb222a2b7c150a0dfc7915275c41411f4ddcf1","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":112,"context_line":"        if not filters:"},{"line_number":113,"context_line":"            return True"},{"line_number":114,"context_line":"        return all(not filters.get(key) or segment.get(key) in filters[key]"},{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_networks(self, network, filters):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_d6a5dab5","line":114,"in_reply_to":"fa81d914_227e02e5","updated":"2015-01-29 21:27:20.000000000","message":"How so?  These two are not equivalent :)  provider.KEYS !\u003d filter.keys .","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2cc2bcd935b310ddebcee566851fa57af17edd5","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(key) or segment.get(key) in filters[key]"},{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_networks(self, network, filters):"},{"line_number":118,"context_line":"        segments \u003d []"},{"line_number":119,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":120,"context_line":"               for f in provider.KEYS):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_f7966eef","line":117,"updated":"2015-01-29 13:35:44.000000000","message":"nit: it should be singular, filter_network\n\nAlso since you are returning a boolean, consider renaming \"network_match_filters\" or something like that","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"03eb222a2b7c150a0dfc7915275c41411f4ddcf1","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(key) or segment.get(key) in filters[key]"},{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_networks(self, network, filters):"},{"line_number":118,"context_line":"        segments \u003d []"},{"line_number":119,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":120,"context_line":"               for f in provider.KEYS):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_96728247","line":117,"in_reply_to":"fa81d914_f7966eef","updated":"2015-01-29 21:27:20.000000000","message":"will change to filter_network - network_match_filters seems more confusing I think.  filter_network seems more generic and clearer as was indicated by another reviewer in previous patchsets.","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"b97caf10177c938fe8a1fdb54979c6b6db54563b","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_networks(self, network, filters):"},{"line_number":118,"context_line":"        segments \u003d []"},{"line_number":119,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":120,"context_line":"               for f in provider.KEYS):"},{"line_number":121,"context_line":"            segments \u003d [self._get_segment_attributes(network)]"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_7a7273ae","line":118,"updated":"2015-01-29 07:08:24.000000000","message":"is there a case where L118 is necessary?","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"0219bdec92966a0ea5952921339db7910cc28850","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_networks(self, network, filters):"},{"line_number":118,"context_line":"        segments \u003d []"},{"line_number":119,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":120,"context_line":"               for f in provider.KEYS):"},{"line_number":121,"context_line":"            segments \u003d [self._get_segment_attributes(network)]"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_72199378","line":118,"in_reply_to":"fa81d914_7a7273ae","updated":"2015-01-29 22:00:41.000000000","message":"Yamamoto, if the first condition and subsequent elif aren\u0027t hit, return statement will throw an error (undefined - segments).  L118 makes sure that we return False \u003d no networks match.","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2fe62189525ce3e58a2c838029d35c2b4e699e59","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(key) or segment.get(key) in filters[key]"},{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_network(self, network, filters):"},{"line_number":118,"context_line":"        segments \u003d []"},{"line_number":119,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":120,"context_line":"               for f in provider.KEYS):"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa81d914_6ef0c791","line":117,"updated":"2015-01-30 01:51:36.000000000","message":"probably should return True here if no relevant filters are specified.\nsee the comment below.","commit_id":"aa25da77c61d36de27a6b1f7c9ae287326ada795"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"f9df42764a380918e3820d609e0e7f1975f8df2c","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(key) or segment.get(key) in filters[key]"},{"line_number":115,"context_line":"                   for key in provider.KEYS)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_network(self, network, filters):"},{"line_number":118,"context_line":"        segments \u003d []"},{"line_number":119,"context_line":"        if any(attributes.is_attr_set(network.get(f))"},{"line_number":120,"context_line":"               for f in provider.KEYS):"}],"source_content_type":"text/x-python","patch_set":21,"id":"da86d52c_c96e1201","line":117,"in_reply_to":"fa81d914_6ef0c791","updated":"2015-02-03 21:05:12.000000000","message":"Done","commit_id":"aa25da77c61d36de27a6b1f7c9ae287326ada795"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2fe62189525ce3e58a2c838029d35c2b4e699e59","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":123,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":124,"context_line":"        return any(self._match_segment(segment, filters)"},{"line_number":125,"context_line":"                   for segment in segments)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _get_attribute(self, attrs, key):"},{"line_number":128,"context_line":"        value \u003d attrs.get(key)"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa81d914_0eebcbb0","line":125,"updated":"2015-01-30 01:51:36.000000000","message":"this would be evaluated to False if segments\u003d[], even if no relevant filters are specified.\n(-1 for this)","commit_id":"aa25da77c61d36de27a6b1f7c9ae287326ada795"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"f9df42764a380918e3820d609e0e7f1975f8df2c","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":123,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":124,"context_line":"        return any(self._match_segment(segment, filters)"},{"line_number":125,"context_line":"                   for segment in segments)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _get_attribute(self, attrs, key):"},{"line_number":128,"context_line":"        value \u003d attrs.get(key)"}],"source_content_type":"text/x-python","patch_set":21,"id":"da86d52c_e97116e1","line":125,"in_reply_to":"fa81d914_0eebcbb0","updated":"2015-02-03 21:05:12.000000000","message":"Done","commit_id":"aa25da77c61d36de27a6b1f7c9ae287326ada795"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"5283338750987a8d8c62079b101d8c6dddd308f8","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":122,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            return True"},{"line_number":125,"context_line":"        return any(self._match_segment(s, filters) for s in segments)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _get_attribute(self, attrs, key):"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_bba3dab0","line":124,"updated":"2015-02-04 04:41:43.000000000","message":"should return true if and only if no relevant attributes are in filters.\n\nprobably it\u0027s simpler to do:\nif (mpnet):\n    L.122\nelse:\n    L.120","commit_id":"7ce821ea514a869bc9fe4522d122133340b4aa3c"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"77fc289bb3f4ae21f70f4771d47c0bf3cf8f1167","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":122,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            return True"},{"line_number":125,"context_line":"        return any(self._match_segment(s, filters) for s in segments)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _get_attribute(self, attrs, key):"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_edee54ec","line":124,"in_reply_to":"da86d52c_bba3dab0","updated":"2015-02-04 20:23:06.000000000","message":"yamamoto: I think there maybe some confusion here.  This method is called from filter_provider_net and it\u0027s only supposed to filter out the networks that do NOT match filters containing providernet attributes.  So I don\u0027t think the logic you suggest is quite right here.  Please see https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/plugin.py#L649 -- it filters out the network that don\u0027t match other attributes already (before the extension specific filtering is done - providernet and l3).\n\nPls let me know if you have question.  Maybe I should change the name of the method - providernet_filter_network?","commit_id":"7ce821ea514a869bc9fe4522d122133340b4aa3c"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"a1387375600af7acdf143c6e998449c0dbb3f1f3","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":122,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":123,"context_line":"        else:"},{"line_number":124,"context_line":"            return True"},{"line_number":125,"context_line":"        return any(self._match_segment(s, filters) for s in segments)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _get_attribute(self, attrs, key):"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_ab574d01","line":124,"in_reply_to":"da86d52c_edee54ec","updated":"2015-02-09 19:10:26.000000000","message":"I think I agree with Manish here. Also, I don\u0027t think its possible to actually have a network in ML2 with no providernet or multiprovidernet attributes, so the \"return True\" case should not be hit. But returning True would make sense if somehow there were none of these attributes, so I recommend keeping it.","commit_id":"7ce821ea514a869bc9fe4522d122133340b4aa3c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0f7952c62aeea009b3e25e098023ad12cf7ff80d","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            return segments"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":112,"context_line":"        if not filters:"},{"line_number":113,"context_line":"            return True"},{"line_number":114,"context_line":"        return all(not filters.get(attr) or segment.get(attr) in filters[attr]"},{"line_number":115,"context_line":"                   for attr in provider.ATTRIBUTES)"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_92adf99d","line":112,"updated":"2015-02-11 17:40:32.000000000","message":"Can we move this check at the beginning of filter_network()?\n\n  def filter_network(...):\n      if not filters:\n          return True\n      ....","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7eff15190b2e5c05c970ae57d48341fb9a19fa28","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            return segments"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    def _match_segment(self, segment, filters):"},{"line_number":112,"context_line":"        if not filters:"},{"line_number":113,"context_line":"            return True"},{"line_number":114,"context_line":"        return all(not filters.get(attr) or segment.get(attr) in filters[attr]"},{"line_number":115,"context_line":"                   for attr in provider.ATTRIBUTES)"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_a036f000","line":112,"in_reply_to":"da86d52c_92adf99d","updated":"2015-02-12 17:31:41.000000000","message":"Done","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"70100dedaa283d1e95f750f0485587b531d090d3","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(attr) or segment.get(attr) in filters[attr]"},{"line_number":115,"context_line":"                   for attr in provider.ATTRIBUTES)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_network(self, network, filters):"},{"line_number":118,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":119,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":120,"context_line":"            segments \u003d [self._get_segment_attributes(network)]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_5579862d","line":117,"updated":"2015-02-12 12:49:33.000000000","message":"I think a better name for this method would be network_matches_filter(), since it returns a boolean.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0f7952c62aeea009b3e25e098023ad12cf7ff80d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(attr) or segment.get(attr) in filters[attr]"},{"line_number":115,"context_line":"                   for attr in provider.ATTRIBUTES)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_network(self, network, filters):"},{"line_number":118,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":119,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":120,"context_line":"            segments \u003d [self._get_segment_attributes(network)]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_b2e75d11","line":117,"updated":"2015-02-11 17:40:32.000000000","message":"The logic looks good, but it would be nice if we have a method to get segments. I am not sure we have the exactly same logic, but I see the similar logic when reading ML2 plugin codes. This is just a comment  and let me clarify it.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ef54a1e03c7ae448676ed6474f09cf3443cd70f8","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(attr) or segment.get(attr) in filters[attr]"},{"line_number":115,"context_line":"                   for attr in provider.ATTRIBUTES)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_network(self, network, filters):"},{"line_number":118,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":119,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":120,"context_line":"            segments \u003d [self._get_segment_attributes(network)]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_7911c552","line":117,"in_reply_to":"da86d52c_43329ef2","updated":"2015-02-15 07:50:18.000000000","message":"Patch set 25 looks much nicer. Keeping the change small really make sense.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7eff15190b2e5c05c970ae57d48341fb9a19fa28","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(attr) or segment.get(attr) in filters[attr]"},{"line_number":115,"context_line":"                   for attr in provider.ATTRIBUTES)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_network(self, network, filters):"},{"line_number":118,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":119,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":120,"context_line":"            segments \u003d [self._get_segment_attributes(network)]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_43329ef2","line":117,"in_reply_to":"da86d52c_5579862d","updated":"2015-02-12 17:31:41.000000000","message":"Done.  called it network_matches_filters() since there are multiple filters.  Originally it was called filter_network to keep it consistent with naming of other methods in the plugin.py file (filter_providers, filter_l3..., etc. ).  But I think this maybe better, thanks for the suggestion.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7eff15190b2e5c05c970ae57d48341fb9a19fa28","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        return all(not filters.get(attr) or segment.get(attr) in filters[attr]"},{"line_number":115,"context_line":"                   for attr in provider.ATTRIBUTES)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def filter_network(self, network, filters):"},{"line_number":118,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":119,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":120,"context_line":"            segments \u003d [self._get_segment_attributes(network)]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_43b7fe39","line":117,"in_reply_to":"da86d52c_b2e75d11","updated":"2015-02-12 17:31:41.000000000","message":"Akhiro, yeah that would be good too I think.  I could do it with another patch instead of combining into this.  In the past other cores have objected (I think rightly) of over-complicating a given patch by refactors that are external to the key issue addressed by the patch.  pls let me know if you feel strongly about it.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"90b3c7fd97c2a7e424f6a1c1541249720f8fc683","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":116,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":117,"context_line":"            segments \u003d [{attr: self._get_attribute(network, attr)"},{"line_number":118,"context_line":"                         for attr in provider.ATTRIBUTES}]"},{"line_number":119,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":120,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":121,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"da86d52c_36a1b846","line":118,"updated":"2015-02-18 06:43:20.000000000","message":"It works. Or we can simply use \"network\" as \"segment\" as _process_provider_segment does.","commit_id":"a3cec968fa3431002b907ba39748b0e55e5b5348"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"ab29f78a5aff4c6d9c774024e80faef23c41885a","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":116,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":117,"context_line":"            segments \u003d [{attr: self._get_attribute(network, attr)"},{"line_number":118,"context_line":"                         for attr in provider.ATTRIBUTES}]"},{"line_number":119,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":120,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":121,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_07855b59","line":118,"in_reply_to":"ba7be1f8_8c46e74d","updated":"2015-02-24 20:57:04.000000000","message":"Done","commit_id":"a3cec968fa3431002b907ba39748b0e55e5b5348"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"ab29f78a5aff4c6d9c774024e80faef23c41885a","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":116,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":117,"context_line":"            segments \u003d [{attr: self._get_attribute(network, attr)"},{"line_number":118,"context_line":"                         for attr in provider.ATTRIBUTES}]"},{"line_number":119,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":120,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":121,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_c7b7c338","line":118,"in_reply_to":"ba7be1f8_b2d4f220","updated":"2015-02-24 20:57:04.000000000","message":"Done","commit_id":"a3cec968fa3431002b907ba39748b0e55e5b5348"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"a02f75b7ab59125a5e7fbc1c0a3930c43a45222f","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":116,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":117,"context_line":"            segments \u003d [{attr: self._get_attribute(network, attr)"},{"line_number":118,"context_line":"                         for attr in provider.ATTRIBUTES}]"},{"line_number":119,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":120,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":121,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_8c46e74d","line":118,"in_reply_to":"ba7be1f8_b2d4f220","updated":"2015-02-24 13:45:30.000000000","message":"it seems a good idea, and fairly simple to implement","commit_id":"a3cec968fa3431002b907ba39748b0e55e5b5348"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4ad0270d71457b47fbbb9fcca5db1bf11560cf31","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":116,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":117,"context_line":"            segments \u003d [{attr: self._get_attribute(network, attr)"},{"line_number":118,"context_line":"                         for attr in provider.ATTRIBUTES}]"},{"line_number":119,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":120,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":121,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_cd8b6f66","line":118,"in_reply_to":"ba7be1f8_b2d4f220","updated":"2015-02-24 17:36:23.000000000","message":"yep, makes perfect sense.  It was there earlier and got removed in a recent merge.  I\u0027ll add it again.  will do it shortly. thanks.","commit_id":"a3cec968fa3431002b907ba39748b0e55e5b5348"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7e8b75438cf8c9acc95ec0103e4f5e037c52921e","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":116,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":117,"context_line":"            segments \u003d [{attr: self._get_attribute(network, attr)"},{"line_number":118,"context_line":"                         for attr in provider.ATTRIBUTES}]"},{"line_number":119,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":120,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":121,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"da86d52c_a9bfebce","line":118,"in_reply_to":"da86d52c_36a1b846","updated":"2015-02-18 18:14:00.000000000","message":"I can do that too.  technically, that would bring in all attributes of network in segment.  I had thought about it but decided to leave it as-is - thought process below.\n\nThat will also work - passing network as segment, as long as the called function understands it\u0027s only a segment but not network and in future the devs don\u0027t assume it\u0027s only segment related attributes.  Although at this point it is same but it could be problematic in future (and that\u0027s why I had also put a comment in the patch related to process_provider_segment change).  It might seem odd to add segments \u003d [network] (L118) in case of single segment network and others may object to that change.\n\nI\u0027m fine either way though, please let me know if you\u0027d like me to respin this.","commit_id":"a3cec968fa3431002b907ba39748b0e55e5b5348"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"543f88d17cffdaf8afdfce55354ffcd614560b64","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":116,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":117,"context_line":"            segments \u003d [{attr: self._get_attribute(network, attr)"},{"line_number":118,"context_line":"                         for attr in provider.ATTRIBUTES}]"},{"line_number":119,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":120,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":121,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_b2d4f220","line":118,"in_reply_to":"da86d52c_a9bfebce","updated":"2015-02-24 05:56:19.000000000","message":"Sorry for my late response.\n\nJust what I concern is that we assume \"network\" is a superset of \"segment\" both at L.99 and here. Here we also assume a segment and a network have same name of attributes. These two have the same assumption but use the different logic.\n\nIf we take care of decoupling of network and segment for future, I think it is better to use a simple wrapper function to get a segment from a network for both places. For example,\n\n  def get_provider_segment(self, network):\n      return network\n\nThought?","commit_id":"a3cec968fa3431002b907ba39748b0e55e5b5348"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"73ee90b324555f046e99ecb8835d796a8fa01b73","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            # at the same time."},{"line_number":97,"context_line":"            if attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":98,"context_line":"                raise mpnet.SegmentsSetInConjunctionWithProviders()"},{"line_number":99,"context_line":"            return [self._process_provider_segment(network)]"},{"line_number":100,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":101,"context_line":"            segments \u003d [self._process_provider_segment(s)"},{"line_number":102,"context_line":"                        for s in network[mpnet.SEGMENTS]]"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_1bd2085c","line":99,"updated":"2015-02-25 05:15:08.000000000","message":"I believe Akihiro and Salvatore intended that we use _get_provider_segment() here too.","commit_id":"aa8e87c68ee90b60d14af5cbee7819da789cb7e8"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4c412711b752812b4e50f689a511fb4494e3c4e3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            # at the same time."},{"line_number":97,"context_line":"            if attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":98,"context_line":"                raise mpnet.SegmentsSetInConjunctionWithProviders()"},{"line_number":99,"context_line":"            return [self._process_provider_segment(network)]"},{"line_number":100,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":101,"context_line":"            segments \u003d [self._process_provider_segment(s)"},{"line_number":102,"context_line":"                        for s in network[mpnet.SEGMENTS]]"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_273eb18c","line":99,"in_reply_to":"ba7be1f8_1bd2085c","updated":"2015-02-25 17:49:18.000000000","message":"Done","commit_id":"aa8e87c68ee90b60d14af5cbee7819da789cb7e8"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"7930f90739f770b0341ca094ced4c9f7ba0b87e2","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            # at the same time."},{"line_number":97,"context_line":"            if attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":98,"context_line":"                raise mpnet.SegmentsSetInConjunctionWithProviders()"},{"line_number":99,"context_line":"            return [self._process_provider_segment(network)]"},{"line_number":100,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":101,"context_line":"            segments \u003d [self._process_provider_segment(s)"},{"line_number":102,"context_line":"                        for s in network[mpnet.SEGMENTS]]"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_64f04eca","line":99,"in_reply_to":"ba7be1f8_273eb18c","updated":"2015-02-27 10:58:33.000000000","message":"Yes, that is what I thought. The consistent logic is good and easy to understand.","commit_id":"aa8e87c68ee90b60d14af5cbee7819da789cb7e8"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"73ee90b324555f046e99ecb8835d796a8fa01b73","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def _get_provider_segment(self, network):"},{"line_number":113,"context_line":"        # Note that currently for a single segment"},{"line_number":114,"context_line":"        # the segment attributes are part of the"},{"line_number":115,"context_line":"        # network dictionary"},{"line_number":116,"context_line":"        return network"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def network_matches_filters(self, network, filters):"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_3bf0acfd","line":115,"updated":"2015-02-25 05:15:08.000000000","message":"To prevent questions about why this one line \"useless\" method is used, please add the reason (from Akihiro in patch set 26) to the comment:\n\n  # TODO(someone): Placeholder method\n  # Code intended for operating on a provider segment should use\n  # this method to extract the segment, even though currently the\n  # segment attributes are part of the network dictionary. In the\n  # future, network and segment information will be decoupled and\n  # here we will do the job of extracting the segment information.","commit_id":"aa8e87c68ee90b60d14af5cbee7819da789cb7e8"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"4c412711b752812b4e50f689a511fb4494e3c4e3","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def _get_provider_segment(self, network):"},{"line_number":113,"context_line":"        # Note that currently for a single segment"},{"line_number":114,"context_line":"        # the segment attributes are part of the"},{"line_number":115,"context_line":"        # network dictionary"},{"line_number":116,"context_line":"        return network"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def network_matches_filters(self, network, filters):"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_c754f5cb","line":115,"in_reply_to":"ba7be1f8_3bf0acfd","updated":"2015-02-25 17:49:18.000000000","message":"Done.  Captured this in comments here.  Current reviewers would know but for others this will be great.  New patchset uploaded.","commit_id":"aa8e87c68ee90b60d14af5cbee7819da789cb7e8"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"3c5f2b155b7c8bf95d37e86b3e7b326f4f7b1949","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def _get_provider_segment(self, network):"},{"line_number":113,"context_line":"        # Note that currently for a single segment"},{"line_number":114,"context_line":"        # the segment attributes are part of the"},{"line_number":115,"context_line":"        # network dictionary"},{"line_number":116,"context_line":"        return network"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def network_matches_filters(self, network, filters):"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_150b968e","line":115,"in_reply_to":"ba7be1f8_3bf0acfd","updated":"2015-02-25 17:33:42.000000000","message":"Thanks Henry for the clarification :)","commit_id":"aa8e87c68ee90b60d14af5cbee7819da789cb7e8"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"dd6fe9de6bc9167cb0c7faeb4561438e5db05093","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            return True"},{"line_number":121,"context_line":"        if any(attributes.is_attr_set(network.get(attr))"},{"line_number":122,"context_line":"               for attr in provider.ATTRIBUTES):"},{"line_number":123,"context_line":"            segments \u003d [self._get_provider_segment(network)]"},{"line_number":124,"context_line":"        elif attributes.is_attr_set(network.get(mpnet.SEGMENTS)):"},{"line_number":125,"context_line":"            segments \u003d self._get_attribute(network, mpnet.SEGMENTS)"},{"line_number":126,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba7be1f8_eea1f794","line":123,"updated":"2015-02-25 03:41:38.000000000","message":"Do we need helper method if we are simply returning network?\nIt could be like this also:\n     segments \u003d [network]","commit_id":"aa8e87c68ee90b60d14af5cbee7819da789cb7e8"}],"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"41280a23258c6ec2d60446a506f04a3a6b1de487","unresolved":false,"context_lines":[{"line_number":152,"context_line":"                                  fanout\u003dFalse)"},{"line_number":153,"context_line":"        return self.conn.consume_in_threads()"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def _filter_nets_provider(self, context, nets, filters):"},{"line_number":156,"context_line":"        physnets \u003d filters and filters.get(provider.PHYSICAL_NETWORK, [])"},{"line_number":157,"context_line":"        sids \u003d filters and filters.get(provider.SEGMENTATION_ID, [])"},{"line_number":158,"context_line":"        network_types \u003d filters and filters.get(provider.NETWORK_TYPE, [])"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_4eee12ee","line":155,"updated":"2014-09-30 00:26:39.000000000","message":"how about mpnet?","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"41280a23258c6ec2d60446a506f04a3a6b1de487","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        if physnets:"},{"line_number":163,"context_line":"            filtered_nets \u003d [n for v in physnets"},{"line_number":164,"context_line":"                            for n in nets"},{"line_number":165,"context_line":"                            if n[provider.PHYSICAL_NETWORK] \u003d\u003d v]"},{"line_number":166,"context_line":"        if sids:"},{"line_number":167,"context_line":"            filtered_nets \u003d [n for v in sids"},{"line_number":168,"context_line":"                             for n in nets"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_eee6e615","line":165,"updated":"2014-09-30 00:26:39.000000000","message":"it would be simpler to do:\nfiltered_nets \u003d [n for n in filtered_nets if n[...] in physnets]","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"41280a23258c6ec2d60446a506f04a3a6b1de487","unresolved":false,"context_lines":[{"line_number":165,"context_line":"                            if n[provider.PHYSICAL_NETWORK] \u003d\u003d v]"},{"line_number":166,"context_line":"        if sids:"},{"line_number":167,"context_line":"            filtered_nets \u003d [n for v in sids"},{"line_number":168,"context_line":"                             for n in nets"},{"line_number":169,"context_line":"                             if n[provider.SEGMENTATION_ID] \u003d\u003d v]"},{"line_number":170,"context_line":"        if network_types:"},{"line_number":171,"context_line":"            filtered_nets \u003d [n for v in network_types"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_2e1aae17","line":168,"range":{"start_line":168,"start_character":38,"end_line":168,"end_character":42},"updated":"2014-09-30 00:26:39.000000000","message":"why not filtered_nets?","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"41280a23258c6ec2d60446a506f04a3a6b1de487","unresolved":false,"context_lines":[{"line_number":169,"context_line":"                             if n[provider.SEGMENTATION_ID] \u003d\u003d v]"},{"line_number":170,"context_line":"        if network_types:"},{"line_number":171,"context_line":"            filtered_nets \u003d [n for v in network_types"},{"line_number":172,"context_line":"                             for n in nets"},{"line_number":173,"context_line":"                             if n[provider.PHYSICAL_NETWORK] \u003d\u003d v]"},{"line_number":174,"context_line":"        return filtered_nets"},{"line_number":175,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_4e17f2ed","line":172,"range":{"start_line":172,"start_character":38,"end_line":172,"end_character":42},"updated":"2014-09-30 00:26:39.000000000","message":"ditto","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"5435ed9cdd717ec5a0543801d5c2ddd47f127830","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        matching_networks \u003d []"},{"line_number":158,"context_line":"        for network in networks:"},{"line_number":159,"context_line":"            if self.type_manager._process_provider_filter(network, filters):"},{"line_number":160,"context_line":"                matching_networks.append(network)"},{"line_number":161,"context_line":"        return matching_networks"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def _notify_l3_agent_new_port(self, context, port):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_5f4b002b","line":160,"updated":"2014-10-21 10:37:12.000000000","message":"matching_networks \u003d [network for network in networks if self.type_manager._process_provider_filter(network, filters)]","commit_id":"0706323722806ab20bf8f2e2be288bf569b276c3"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f65d231f808f38477fb9989ed711f9f83b3ce0ed","unresolved":false,"context_lines":[{"line_number":159,"context_line":"    def _filter_nets_provider(self, context, networks, filters):"},{"line_number":160,"context_line":"        return [network"},{"line_number":161,"context_line":"                for network in networks"},{"line_number":162,"context_line":"                if self.type_manager._process_provider_filter(network,"},{"line_number":163,"context_line":"                                                              filters)]"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _notify_l3_agent_new_port(self, context, port):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_cde29b2e","line":162,"updated":"2015-01-24 14:29:15.000000000","message":"_process_provider_filter is not a public method, you should rename it. Moreover _\"process_provider_filter\" is not meaningful, \"filter_networks\" seems better","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":159,"context_line":"    def _filter_nets_provider(self, context, networks, filters):"},{"line_number":160,"context_line":"        return [network"},{"line_number":161,"context_line":"                for network in networks"},{"line_number":162,"context_line":"                if self.type_manager._process_provider_filter(network,"},{"line_number":163,"context_line":"                                                              filters)]"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def _notify_l3_agent_new_port(self, context, port):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_53a8e176","line":162,"in_reply_to":"1a930d6b_cde29b2e","updated":"2015-01-26 19:31:49.000000000","message":"Done","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"}],"neutron/tests/unit/ml2/test_ml2_plugin.py":[{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"d59d95da78bd031910f2fb73a756e8272fc1f998","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    def _verify_net_creation(self, network_req, data):"},{"line_number":138,"context_line":"        network \u003d self.deserialize(self.fmt,"},{"line_number":139,"context_line":"                                   network_req.get_response(self.api))"},{"line_number":140,"context_line":"        self.assertEqual(network[\u0027network\u0027][pnet.NETWORK_TYPE],"},{"line_number":141,"context_line":"                         data[pnet.NETWORK_TYPE])"},{"line_number":142,"context_line":"        self.assertEqual(network[\u0027network\u0027][pnet.PHYSICAL_NETWORK],"},{"line_number":143,"context_line":"                         data[pnet.PHYSICAL_NETWORK])"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_67be8d01","line":140,"updated":"2014-09-30 13:37:23.000000000","message":"nit: expected, observed in assertEqual (here and in other asserts)","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"d59d95da78bd031910f2fb73a756e8272fc1f998","unresolved":false,"context_lines":[{"line_number":161,"context_line":"        net_req \u003d self.new_show_request(\u0027networks\u0027, None,"},{"line_number":162,"context_line":"                                        params\u003d{pnet.SEGMENTATION_ID: 1})"},{"line_number":163,"context_line":"        networks \u003d self.deserialize(self.fmt, net_req.get_response(self.api))"},{"line_number":164,"context_line":"        self.assertTrue(networks)"},{"line_number":165,"context_line":"        self.assertEqual(len(networks[\u0027networks\u0027]), 1)"},{"line_number":166,"context_line":"        network \u003d networks[\u0027networks\u0027][0]"},{"line_number":167,"context_line":"        self.assertEqual(network[pnet.NETWORK_TYPE], \u0027vlan\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_875291db","line":164,"updated":"2014-09-30 13:37:23.000000000","message":"assertIsNotNone","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"d59d95da78bd031910f2fb73a756e8272fc1f998","unresolved":false,"context_lines":[{"line_number":186,"context_line":"                                                \u0027physnet2\u0027,"},{"line_number":187,"context_line":"                                                pnet.SEGMENTATION_ID: 21})"},{"line_number":188,"context_line":"        networks \u003d self.deserialize(self.fmt, net_req.get_response(self.api))"},{"line_number":189,"context_line":"        self.assertTrue(networks)"},{"line_number":190,"context_line":"        self.assertEqual(len(networks[\u0027networks\u0027]), 1)"},{"line_number":191,"context_line":"        network \u003d networks[\u0027networks\u0027][0]"},{"line_number":192,"context_line":"        self.assertEqual(network[pnet.NETWORK_TYPE], \u0027vlan\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_e758bdfc","line":189,"updated":"2014-09-30 13:37:23.000000000","message":"ditto","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"240855bac48f297766b07e23375cba1ffe14ab57","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                                              {\u0027network\u0027: self.nets[1]})"},{"line_number":173,"context_line":"        self._verify_net_creation(network_req, self.nets[1])"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        network_req \u003d self.new_create_request(\u0027networks\u0027,"},{"line_number":176,"context_line":"                                              {\u0027network\u0027: self.nets[2]})"},{"line_number":177,"context_line":"        self._verify_net_creation(network_req, self.nets[2])"},{"line_number":178,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_b17bcc8a","line":175,"updated":"2014-10-06 21:25:14.000000000","message":"This is very repetitive. Can you turn this into a loop?","commit_id":"9209efdd25ebbd2ca3aa84965977817a78deeca1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"5435ed9cdd717ec5a0543801d5c2ddd47f127830","unresolved":false,"context_lines":[{"line_number":151,"context_line":"                                   network_req.get_response(self.api))"},{"line_number":152,"context_line":"        if not mpnet.SEGMENTS in data:"},{"line_number":153,"context_line":"            self.assertEqual(data[pnet.NETWORK_TYPE],"},{"line_number":154,"context_line":"                             network[\u0027network\u0027][pnet.NETWORK_TYPE])"},{"line_number":155,"context_line":"            self.assertEqual(data[pnet.PHYSICAL_NETWORK],"},{"line_number":156,"context_line":"                             network[\u0027network\u0027][pnet.PHYSICAL_NETWORK])"},{"line_number":157,"context_line":"            self.assertEqual(data[pnet.SEGMENTATION_ID],"}],"source_content_type":"text/x-python","patch_set":3,"id":"9aa7fdbe_5fca2050","line":154,"updated":"2014-10-21 10:37:12.000000000","message":"please introduce intermediate variable to avoid repeating network[\u0027network\u0027]","commit_id":"0706323722806ab20bf8f2e2be288bf569b276c3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1bef856b5d528bf47c838da52c8468774570e701","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                               side_effect\u003dexc.SubnetNotFound(subnet_id\u003d\"1\")):"},{"line_number":147,"context_line":"            plugin._delete_subnets(None, [mock.MagicMock()])"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":150,"context_line":"        super(TestMl2NetworksV2, self).setUp()"},{"line_number":151,"context_line":"        self.nets \u003d [{\u0027name\u0027: \u0027net1\u0027,"},{"line_number":152,"context_line":"                      pnet.NETWORK_TYPE: \u0027vlan\u0027,"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_353ca2e2","line":149,"updated":"2015-01-22 03:31:21.000000000","message":"nit: can we move setUp() right after the start of this class instead.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                               side_effect\u003dexc.SubnetNotFound(subnet_id\u003d\"1\")):"},{"line_number":147,"context_line":"            plugin._delete_subnets(None, [mock.MagicMock()])"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":150,"context_line":"        super(TestMl2NetworksV2, self).setUp()"},{"line_number":151,"context_line":"        self.nets \u003d [{\u0027name\u0027: \u0027net1\u0027,"},{"line_number":152,"context_line":"                      pnet.NETWORK_TYPE: \u0027vlan\u0027,"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_d3ea11ab","line":149,"in_reply_to":"1a930d6b_353ca2e2","updated":"2015-01-26 19:31:49.000000000","message":"Done","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"cf13f06f7bb865ac3100113b42ca7010b0b9ba63","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                               side_effect\u003dexc.SubnetNotFound(subnet_id\u003d\"1\")):"},{"line_number":147,"context_line":"            plugin._delete_subnets(None, [mock.MagicMock()])"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":150,"context_line":"        super(TestMl2NetworksV2, self).setUp()"},{"line_number":151,"context_line":"        self.nets \u003d [{\u0027name\u0027: \u0027net1\u0027,"},{"line_number":152,"context_line":"                      pnet.NETWORK_TYPE: \u0027vlan\u0027,"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_382abb7e","line":149,"in_reply_to":"1a930d6b_353ca2e2","updated":"2015-01-22 18:01:46.000000000","message":"Will fix.  This resulted due to numerous rebase operations :)  Should have noted.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1bef856b5d528bf47c838da52c8468774570e701","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            tz \u003d network[mpnet.SEGMENTS]"},{"line_number":190,"context_line":"            expected_tz \u003d data[mpnet.SEGMENTS]"},{"line_number":191,"context_line":"            self.assertEqual(len(expected_tz), len(tz))"},{"line_number":192,"context_line":"            for i in range(len(expected_tz)):"},{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_15508631","line":192,"updated":"2015-01-22 03:31:21.000000000","message":"you don\u0027t need to wrap this in range as well.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"cf13f06f7bb865ac3100113b42ca7010b0b9ba63","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            tz \u003d network[mpnet.SEGMENTS]"},{"line_number":190,"context_line":"            expected_tz \u003d data[mpnet.SEGMENTS]"},{"line_number":191,"context_line":"            self.assertEqual(len(expected_tz), len(tz))"},{"line_number":192,"context_line":"            for i in range(len(expected_tz)):"},{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_58586732","line":192,"in_reply_to":"1a930d6b_15508631","updated":"2015-01-22 18:01:46.000000000","message":"doesn\u0027t the argument have to be iterable?  len() returns a literal and not a list.  am I missing something?","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":1297,"name":"Joshua Harlow","email":"jxharlow@godaddy.com","username":"harlowja"},"change_message_id":"126ff5bb67e203efcfc5e477f645bb04dcd00253","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            tz \u003d network[mpnet.SEGMENTS]"},{"line_number":190,"context_line":"            expected_tz \u003d data[mpnet.SEGMENTS]"},{"line_number":191,"context_line":"            self.assertEqual(len(expected_tz), len(tz))"},{"line_number":192,"context_line":"            for i in range(len(expected_tz)):"},{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_6aeb85b0","line":192,"in_reply_to":"1a930d6b_58586732","updated":"2015-01-22 20:48:56.000000000","message":"Did aaron mean?\n\n  for i, elem in enumerate(expected_tz):","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            tz \u003d network[mpnet.SEGMENTS]"},{"line_number":190,"context_line":"            expected_tz \u003d data[mpnet.SEGMENTS]"},{"line_number":191,"context_line":"            self.assertEqual(len(expected_tz), len(tz))"},{"line_number":192,"context_line":"            for i in range(len(expected_tz)):"},{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_b3e585dd","line":192,"in_reply_to":"1a930d6b_613bab9c","updated":"2015-01-26 19:31:49.000000000","message":"Done","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"04b7d1939162cc7e77006b49b8ccc683123e1bb8","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            tz \u003d network[mpnet.SEGMENTS]"},{"line_number":190,"context_line":"            expected_tz \u003d data[mpnet.SEGMENTS]"},{"line_number":191,"context_line":"            self.assertEqual(len(expected_tz), len(tz))"},{"line_number":192,"context_line":"            for i in range(len(expected_tz)):"},{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_613bab9c","line":192,"in_reply_to":"1a930d6b_6aeb85b0","updated":"2015-01-22 21:43:23.000000000","message":"whoops yea.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1bef856b5d528bf47c838da52c8468774570e701","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"},{"line_number":196,"context_line":"        for i in range(0, 3):"},{"line_number":197,"context_line":"            network_req \u003d self.new_create_request(\u0027networks\u0027,"},{"line_number":198,"context_line":"                                                  {\u0027network\u0027: self.nets[i]})"},{"line_number":199,"context_line":"            self._verify_net_creation(network_req, self.nets[i])"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_7589cac9","line":196,"updated":"2015-01-22 03:31:21.000000000","message":"range(3) or better yet len(self.nets)","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"cf13f06f7bb865ac3100113b42ca7010b0b9ba63","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"},{"line_number":196,"context_line":"        for i in range(0, 3):"},{"line_number":197,"context_line":"            network_req \u003d self.new_create_request(\u0027networks\u0027,"},{"line_number":198,"context_line":"                                                  {\u0027network\u0027: self.nets[i]})"},{"line_number":199,"context_line":"            self._verify_net_creation(network_req, self.nets[i])"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_b8630bdc","line":196,"in_reply_to":"1a930d6b_7589cac9","updated":"2015-01-22 18:01:46.000000000","message":"will replace with len(self.nets) - same question as earlier about iterable.  let me know.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                self.assertEqual(expected_tz[i], tz[i])"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def test_list_networks_with_sid(self):"},{"line_number":196,"context_line":"        for i in range(0, 3):"},{"line_number":197,"context_line":"            network_req \u003d self.new_create_request(\u0027networks\u0027,"},{"line_number":198,"context_line":"                                                  {\u0027network\u0027: self.nets[i]})"},{"line_number":199,"context_line":"            self._verify_net_creation(network_req, self.nets[i])"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_53bf01aa","line":196,"in_reply_to":"1a930d6b_b8630bdc","updated":"2015-01-26 19:31:49.000000000","message":"Done","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1bef856b5d528bf47c838da52c8468774570e701","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        tz \u003d network[mpnet.SEGMENTS]"},{"line_number":226,"context_line":"        expected_tz \u003d self.nets[3][mpnet.SEGMENTS]"},{"line_number":227,"context_line":"        self.assertEqual(len(expected_tz), len(tz))"},{"line_number":228,"context_line":"        for i in range(len(expected_tz)):"},{"line_number":229,"context_line":"            self.assertEqual(expected_tz[i], tz[i])"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def test_list_networks_with_physical_network_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_b5589257","line":228,"updated":"2015-01-22 03:31:21.000000000","message":"ditto","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"978dbda36ec16c1a756dcaac39a5add0d487c7b5","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        tz \u003d network[mpnet.SEGMENTS]"},{"line_number":226,"context_line":"        expected_tz \u003d self.nets[3][mpnet.SEGMENTS]"},{"line_number":227,"context_line":"        self.assertEqual(len(expected_tz), len(tz))"},{"line_number":228,"context_line":"        for i in range(len(expected_tz)):"},{"line_number":229,"context_line":"            self.assertEqual(expected_tz[i], tz[i])"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def test_list_networks_with_physical_network_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_d3b3f1e6","line":228,"in_reply_to":"1a930d6b_b5589257","updated":"2015-01-26 19:31:49.000000000","message":"Done","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"cf13f06f7bb865ac3100113b42ca7010b0b9ba63","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        tz \u003d network[mpnet.SEGMENTS]"},{"line_number":226,"context_line":"        expected_tz \u003d self.nets[3][mpnet.SEGMENTS]"},{"line_number":227,"context_line":"        self.assertEqual(len(expected_tz), len(tz))"},{"line_number":228,"context_line":"        for i in range(len(expected_tz)):"},{"line_number":229,"context_line":"            self.assertEqual(expected_tz[i], tz[i])"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def test_list_networks_with_physical_network_sid(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a930d6b_78a9a3de","line":228,"in_reply_to":"1a930d6b_b5589257","updated":"2015-01-22 18:01:46.000000000","message":"same question about iterable.  thx.","commit_id":"7d0b560fcdeb1b7bf9e7ae67b05be861815f5f98"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2cc2bcd935b310ddebcee566851fa57af17edd5","unresolved":false,"context_lines":[{"line_number":138,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":139,"context_line":"        super(TestMl2NetworksV2, self).setUp()"},{"line_number":140,"context_line":"        #physical networks (single segment; not multiprovider)"},{"line_number":141,"context_line":"        self.phys_nets \u003d [{\u0027name\u0027: \u0027net1\u0027,"},{"line_number":142,"context_line":"                           pnet.NETWORK_TYPE: \u0027vlan\u0027,"},{"line_number":143,"context_line":"                           pnet.PHYSICAL_NETWORK: \u0027physnet1\u0027,"},{"line_number":144,"context_line":"                           pnet.SEGMENTATION_ID: 1,"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_710a9122","line":141,"updated":"2015-01-29 13:35:44.000000000","message":"nit: instead of phys_net maybe single_provider_net would be more clear","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2cc2bcd935b310ddebcee566851fa57af17edd5","unresolved":false,"context_lines":[{"line_number":194,"context_line":"                self.assertEqual(elem, tz[i])"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def test_list_networks_with_sid(self):"},{"line_number":197,"context_line":"        for i, net in enumerate(self.phys_nets):"},{"line_number":198,"context_line":"            network_req \u003d self.new_create_request(\u0027networks\u0027,"},{"line_number":199,"context_line":"                                                  {\u0027network\u0027: net})"},{"line_number":200,"context_line":"            self._verify_net_creation(network_req, net)"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_2cea7e0f","line":197,"updated":"2015-01-29 13:35:44.000000000","message":"lines from 197 to 200 can be refactored in an internal method \n\ndef _create_provider_network(network)\n\nthis method can be called here and by test_list_mpnetworks_with_sid\n\nIf you prefer you can also move those lines in _verify_net_creation and rename it in _create_and_verify_network","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a2cc2bcd935b310ddebcee566851fa57af17edd5","unresolved":false,"context_lines":[{"line_number":203,"context_line":"        lookup_vid \u003d 1"},{"line_number":204,"context_line":"        expected_net \u003d [n for n in self.phys_nets"},{"line_number":205,"context_line":"                        if n[pnet.SEGMENTATION_ID] \u003d\u003d lookup_vid].pop()"},{"line_number":206,"context_line":"        net_req \u003d self.new_show_request(\u0027networks\u0027, None,"},{"line_number":207,"context_line":"                                        params\u003d{pnet.SEGMENTATION_ID:"},{"line_number":208,"context_line":"                                                lookup_vid})"},{"line_number":209,"context_line":"        networks \u003d self.deserialize(self.fmt, net_req.get_response(self.api))"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_ec0306b6","line":206,"updated":"2015-01-29 13:35:44.000000000","message":"lines from 206 to 211 can be moved in an internal method\n\ndef _show_and_check_network(lookup_vid, expected_number_networks)\n\nthis can be used here and in test_list_mpnetworks_with_sid","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"a1387375600af7acdf143c6e998449c0dbb3f1f3","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                        Ml2PluginV2TestCase):"},{"line_number":141,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":142,"context_line":"        super(TestMl2NetworksV2, self).setUp()"},{"line_number":143,"context_line":"        #provider networks"},{"line_number":144,"context_line":"        self.pnets \u003d [{\u0027name\u0027: \u0027net1\u0027,"},{"line_number":145,"context_line":"                       pnet.NETWORK_TYPE: \u0027vlan\u0027,"},{"line_number":146,"context_line":"                       pnet.PHYSICAL_NETWORK: \u0027physnet1\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_8066e827","line":143,"updated":"2015-02-09 19:10:26.000000000","message":"Nit - If updating this patch for other reasons, add a space after \u0027#\u0027 in all these comments for style consistency.","commit_id":"7ce821ea514a869bc9fe4522d122133340b4aa3c"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"daef64bfc079ac5ede0637d02b2329014e320c84","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                        Ml2PluginV2TestCase):"},{"line_number":141,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":142,"context_line":"        super(TestMl2NetworksV2, self).setUp()"},{"line_number":143,"context_line":"        #provider networks"},{"line_number":144,"context_line":"        self.pnets \u003d [{\u0027name\u0027: \u0027net1\u0027,"},{"line_number":145,"context_line":"                       pnet.NETWORK_TYPE: \u0027vlan\u0027,"},{"line_number":146,"context_line":"                       pnet.PHYSICAL_NETWORK: \u0027physnet1\u0027,"}],"source_content_type":"text/x-python","patch_set":23,"id":"da86d52c_38bffefd","line":143,"in_reply_to":"da86d52c_8066e827","updated":"2015-02-10 18:36:33.000000000","message":"Done","commit_id":"7ce821ea514a869bc9fe4522d122133340b4aa3c"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0f7952c62aeea009b3e25e098023ad12cf7ff80d","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    self.assertEqual(elem, tz[i])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _lookup_network_by_sid(self, sid, num_expected_nets):"},{"line_number":205,"context_line":"        net_req \u003d self.new_show_request(\u0027networks\u0027, None,"},{"line_number":206,"context_line":"                                        query_params\u003d{pnet."},{"line_number":207,"context_line":"                                                      SEGMENTATION_ID: sid})"},{"line_number":208,"context_line":"        networks \u003d self.deserialize(self.fmt, net_req.get_response(self.api))"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_6d96e43f","line":205,"updated":"2015-02-11 17:40:32.000000000","message":"Now we are testing list_network with filters of provider networks, but new_show_request is used. can\u0027t we use _new_list_requests with filters? I believe it is much clearer because new_show_request takes \"id\" argument and passing None as \"id\" is confusing.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7eff15190b2e5c05c970ae57d48341fb9a19fa28","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    self.assertEqual(elem, tz[i])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _lookup_network_by_sid(self, sid, num_expected_nets):"},{"line_number":205,"context_line":"        net_req \u003d self.new_show_request(\u0027networks\u0027, None,"},{"line_number":206,"context_line":"                                        query_params\u003d{pnet."},{"line_number":207,"context_line":"                                                      SEGMENTATION_ID: sid})"},{"line_number":208,"context_line":"        networks \u003d self.deserialize(self.fmt, net_req.get_response(self.api))"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_a3635aaf","line":205,"in_reply_to":"da86d52c_008b531f","updated":"2015-02-12 17:31:41.000000000","message":"I looked at other existing code in the test!  Thanks much for catching this :)  Updated code to use new_list_request .  Great catch - and good learning for me for next time!","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"a14981a3d31e6f9641106b0afa1748df85c3cf6e","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                    self.assertEqual(elem, tz[i])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _lookup_network_by_sid(self, sid, num_expected_nets):"},{"line_number":205,"context_line":"        net_req \u003d self.new_show_request(\u0027networks\u0027, None,"},{"line_number":206,"context_line":"                                        query_params\u003d{pnet."},{"line_number":207,"context_line":"                                                      SEGMENTATION_ID: sid})"},{"line_number":208,"context_line":"        networks \u003d self.deserialize(self.fmt, net_req.get_response(self.api))"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_008b531f","line":205,"in_reply_to":"da86d52c_6d96e43f","updated":"2015-02-12 09:28:17.000000000","message":"You\u0027re right. What Manish is doing works but we created new_list_request for that.\nIt\u0027s just that we probably never documented this so maybe Manish picked the first method that worked for me","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0f7952c62aeea009b3e25e098023ad12cf7ff80d","unresolved":false,"context_lines":[{"line_number":213,"context_line":"            self.assertIsNone(networks)"},{"line_number":214,"context_line":"        return networks"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def test_list_networks_with_sid(self):"},{"line_number":217,"context_line":"        self._create_and_verify_networks(self.pnets)"},{"line_number":218,"context_line":"        # verify we can find the network that we expect"},{"line_number":219,"context_line":"        lookup_vid \u003d 1"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_2d006c00","line":216,"updated":"2015-02-11 17:40:32.000000000","message":"Can we rename \"sid\" to \"segmentation_id\" or \"segid\" ?  At a quick look, I don\u0027t think \"sid\" has clear meaning.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7eff15190b2e5c05c970ae57d48341fb9a19fa28","unresolved":false,"context_lines":[{"line_number":213,"context_line":"            self.assertIsNone(networks)"},{"line_number":214,"context_line":"        return networks"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    def test_list_networks_with_sid(self):"},{"line_number":217,"context_line":"        self._create_and_verify_networks(self.pnets)"},{"line_number":218,"context_line":"        # verify we can find the network that we expect"},{"line_number":219,"context_line":"        lookup_vid \u003d 1"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_03fb46c1","line":216,"in_reply_to":"da86d52c_2d006c00","updated":"2015-02-12 17:31:41.000000000","message":"agree about the poor naming choice.  updated.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0f7952c62aeea009b3e25e098023ad12cf7ff80d","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        # verify we can find the network that we expect"},{"line_number":219,"context_line":"        lookup_vid \u003d 1"},{"line_number":220,"context_line":"        expected_net \u003d [n for n in self.pnets"},{"line_number":221,"context_line":"                        if n[pnet.SEGMENTATION_ID] \u003d\u003d lookup_vid].pop()"},{"line_number":222,"context_line":"        networks \u003d self._lookup_network_by_sid(lookup_vid, 1)"},{"line_number":223,"context_line":"        # verify all provider attributes"},{"line_number":224,"context_line":"        network \u003d networks[\u0027networks\u0027][0]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_ed8c9482","line":221,"updated":"2015-02-11 17:40:32.000000000","message":"Nit: I am not sure that using pop() is the way to pick up the last element of a list. I think [....][-1] is the usual way.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"ef54a1e03c7ae448676ed6474f09cf3443cd70f8","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        # verify we can find the network that we expect"},{"line_number":219,"context_line":"        lookup_vid \u003d 1"},{"line_number":220,"context_line":"        expected_net \u003d [n for n in self.pnets"},{"line_number":221,"context_line":"                        if n[pnet.SEGMENTATION_ID] \u003d\u003d lookup_vid].pop()"},{"line_number":222,"context_line":"        networks \u003d self._lookup_network_by_sid(lookup_vid, 1)"},{"line_number":223,"context_line":"        # verify all provider attributes"},{"line_number":224,"context_line":"        network \u003d networks[\u0027networks\u0027][0]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_39082d28","line":221,"in_reply_to":"da86d52c_a3bb5ac2","updated":"2015-02-15 07:50:18.000000000","message":"Thanks for the clarification. It is a taste of matter and there is no problem.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7eff15190b2e5c05c970ae57d48341fb9a19fa28","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        # verify we can find the network that we expect"},{"line_number":219,"context_line":"        lookup_vid \u003d 1"},{"line_number":220,"context_line":"        expected_net \u003d [n for n in self.pnets"},{"line_number":221,"context_line":"                        if n[pnet.SEGMENTATION_ID] \u003d\u003d lookup_vid].pop()"},{"line_number":222,"context_line":"        networks \u003d self._lookup_network_by_sid(lookup_vid, 1)"},{"line_number":223,"context_line":"        # verify all provider attributes"},{"line_number":224,"context_line":"        network \u003d networks[\u0027networks\u0027][0]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_a3bb5ac2","line":221,"in_reply_to":"da86d52c_ed8c9482","updated":"2015-02-12 17:31:41.000000000","message":"Thanks Salvatore for the details.  I think pop() is pretty standard in most of the languages including python.  [-1] works just as well.  The difference is [-1] returns the last element whereas pop() will also remove it and then return it.  And since the temporary anonymous list isn\u0027t needed both work.  Again, let me know if you feel strongly.  either way is fine with me.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"a14981a3d31e6f9641106b0afa1748df85c3cf6e","unresolved":false,"context_lines":[{"line_number":218,"context_line":"        # verify we can find the network that we expect"},{"line_number":219,"context_line":"        lookup_vid \u003d 1"},{"line_number":220,"context_line":"        expected_net \u003d [n for n in self.pnets"},{"line_number":221,"context_line":"                        if n[pnet.SEGMENTATION_ID] \u003d\u003d lookup_vid].pop()"},{"line_number":222,"context_line":"        networks \u003d self._lookup_network_by_sid(lookup_vid, 1)"},{"line_number":223,"context_line":"        # verify all provider attributes"},{"line_number":224,"context_line":"        network \u003d networks[\u0027networks\u0027][0]"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_2095b732","line":221,"in_reply_to":"da86d52c_ed8c9482","updated":"2015-02-12 09:28:17.000000000","message":"pop is ok\n\nHelp on built-in function pop:\n\npop(...)\n    L.pop([index]) -\u003e item -- remove and return item at index (default last).\n    Raises IndexError if list is empty or index is out of range.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"4c1ea6664450136a44b18a95787b93c947e04974","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        networks \u003d [n for n in networks[\u0027networks\u0027] if mpnet.SEGMENTS in n]"},{"line_number":237,"context_line":"        network \u003d networks.pop()"},{"line_number":238,"context_line":"        # verify attributes of the looked up item"},{"line_number":239,"context_line":"        tz \u003d network[mpnet.SEGMENTS]"},{"line_number":240,"context_line":"        expected_tz \u003d self.mp_nets[0][mpnet.SEGMENTS]"},{"line_number":241,"context_line":"        self.assertEqual(len(expected_tz), len(tz))"},{"line_number":242,"context_line":"        for i, net in enumerate(expected_tz):"}],"source_content_type":"text/x-python","patch_set":25,"id":"da86d52c_bcab2b74","line":239,"updated":"2015-02-15 13:20:36.000000000","message":"Just a quick question.. :)\nwhat\u0027s tz stands for?","commit_id":"2b294b86eb752a99f2850b1d26a8a27394dde3fb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"1d6c554a1966ce45374313ec049480a71ad26321","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        networks \u003d [n for n in networks[\u0027networks\u0027] if mpnet.SEGMENTS in n]"},{"line_number":237,"context_line":"        network \u003d networks.pop()"},{"line_number":238,"context_line":"        # verify attributes of the looked up item"},{"line_number":239,"context_line":"        tz \u003d network[mpnet.SEGMENTS]"},{"line_number":240,"context_line":"        expected_tz \u003d self.mp_nets[0][mpnet.SEGMENTS]"},{"line_number":241,"context_line":"        self.assertEqual(len(expected_tz), len(tz))"},{"line_number":242,"context_line":"        for i, net in enumerate(expected_tz):"}],"source_content_type":"text/x-python","patch_set":25,"id":"da86d52c_c2eee821","line":239,"in_reply_to":"da86d52c_bcab2b74","updated":"2015-02-17 19:57:13.000000000","message":"tz \u003d traffic zones.  but I think now that you mention it, perhaps I should just stick to segments.  thanks for pointing it out :)  updated in the new patch.","commit_id":"2b294b86eb752a99f2850b1d26a8a27394dde3fb"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"4ac516524837e8008d14617f4c5c6936102524c8","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                segments \u003d network[mpnet.SEGMENTS]"},{"line_number":199,"context_line":"                expected_segments \u003d net[mpnet.SEGMENTS]"},{"line_number":200,"context_line":"                self.assertEqual(len(expected_segments), len(segments))"},{"line_number":201,"context_line":"                for i, segment in enumerate(expected_segments):"},{"line_number":202,"context_line":"                    self.assertEqual(segment, segments[i])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _lookup_network_by_segmentation_id(self, seg_id, num_expected_nets):"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba7be1f8_2b672527","line":201,"updated":"2015-02-26 19:51:25.000000000","message":"Note: The outer loop uses \u0027i\u0027 (line 186) and then it is redefined here. Currently this is not a problem because the outer i is not used, but this is a potential bug landmine for future changes in this method.","commit_id":"12c68d3466ef967872c0e2434392ac69361befb2"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"3e4c582a32e9f215dac4d67b4ebf27a5a181cd49","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                segments \u003d network[mpnet.SEGMENTS]"},{"line_number":199,"context_line":"                expected_segments \u003d net[mpnet.SEGMENTS]"},{"line_number":200,"context_line":"                self.assertEqual(len(expected_segments), len(segments))"},{"line_number":201,"context_line":"                for i, segment in enumerate(expected_segments):"},{"line_number":202,"context_line":"                    self.assertEqual(segment, segments[i])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _lookup_network_by_segmentation_id(self, seg_id, num_expected_nets):"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba7be1f8_729e6509","line":201,"in_reply_to":"ba7be1f8_2b672527","updated":"2015-02-26 23:18:05.000000000","message":"yikes! thanks for the catch:)  let me update that!","commit_id":"12c68d3466ef967872c0e2434392ac69361befb2"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"933a27d258529d2c601e80d64be2c422eecf8c21","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                expected_segments \u003d net[mpnet.SEGMENTS]"},{"line_number":200,"context_line":"                self.assertEqual(len(expected_segments), len(segments))"},{"line_number":201,"context_line":"                for seg_idx, segment in enumerate(expected_segments):"},{"line_number":202,"context_line":"                    self.assertEqual(segment, segments[seg_idx])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _lookup_network_by_segmentation_id(self, seg_id, num_expected_nets):"},{"line_number":205,"context_line":"        params_str \u003d \"%s\u003d%s\" % (pnet.SEGMENTATION_ID, seg_id)"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba7be1f8_e4d0becb","line":202,"updated":"2015-02-27 11:08:47.000000000","message":"Some more brief way is to use \"zip\" (itertools.izip):\n\n  for actual, expected in zip(segments, expected_segments):\n      self.assertEqual(expected, actual)\n\nWe can avoid using an index :-)","commit_id":"407ee36bb4fd88352e5d0c53a701e12404a5058a"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7355003405d5a62447271e4ad827306064b4c2d8","unresolved":false,"context_lines":[{"line_number":199,"context_line":"                expected_segments \u003d net[mpnet.SEGMENTS]"},{"line_number":200,"context_line":"                self.assertEqual(len(expected_segments), len(segments))"},{"line_number":201,"context_line":"                for seg_idx, segment in enumerate(expected_segments):"},{"line_number":202,"context_line":"                    self.assertEqual(segment, segments[seg_idx])"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def _lookup_network_by_segmentation_id(self, seg_id, num_expected_nets):"},{"line_number":205,"context_line":"        params_str \u003d \"%s\u003d%s\" % (pnet.SEGMENTATION_ID, seg_id)"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba7be1f8_4a46e124","line":202,"in_reply_to":"ba7be1f8_e4d0becb","updated":"2015-02-27 17:39:58.000000000","message":"Akhiro, I think zip is perfect for this.  Although this is a test + the lists are small but I would update this so that in case others are writing similar test case they get a good sample ;)  I\u0027ll update the patch shortly.","commit_id":"407ee36bb4fd88352e5d0c53a701e12404a5058a"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"933a27d258529d2c601e80d64be2c422eecf8c21","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        expected_segments \u003d self.mp_nets[0][mpnet.SEGMENTS]"},{"line_number":241,"context_line":"        self.assertEqual(len(expected_segments), len(segments))"},{"line_number":242,"context_line":"        for i, segment in enumerate(expected_segments):"},{"line_number":243,"context_line":"            self.assertEqual(segment, segments[i])"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"class TestMl2SubnetsV2(test_plugin.TestSubnetsV2,"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba7be1f8_44d7cabf","line":243,"updated":"2015-02-27 11:08:47.000000000","message":"Same as the above.","commit_id":"407ee36bb4fd88352e5d0c53a701e12404a5058a"}],"neutron/tests/unit/test_db_plugin.py":[{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"d59d95da78bd031910f2fb73a756e8272fc1f998","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":192,"context_line":"                         subresource\u003dNone, fields\u003dNone, params\u003dNone):"},{"line_number":193,"context_line":"        if params:"},{"line_number":194,"context_line":"            params \u003d \"\u0026\".join([\"%s\u003d%s\" % (p, v)"},{"line_number":195,"context_line":"                               for p, v in params.iteritems()])"},{"line_number":196,"context_line":"        if fields:"},{"line_number":197,"context_line":"            fields_str \u003d \"\u0026\".join([\"fields\u003d%s\" % x for x in fields])"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_879c516b","line":194,"updated":"2014-09-30 13:37:23.000000000","message":"Why isn\u0027t this done after check in L198 instead?","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"cb193efbcb906f2d9fb3eb50444fb5664b6b558c","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":192,"context_line":"                         subresource\u003dNone, fields\u003dNone, params\u003dNone):"},{"line_number":193,"context_line":"        if params:"},{"line_number":194,"context_line":"            params \u003d \"\u0026\".join([\"%s\u003d%s\" % (p, v)"},{"line_number":195,"context_line":"                               for p, v in params.iteritems()])"},{"line_number":196,"context_line":"        if fields:"},{"line_number":197,"context_line":"            fields_str \u003d \"\u0026\".join([\"fields\u003d%s\" % x for x in fields])"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_07b5657d","line":194,"in_reply_to":"baa201ad_879c516b","updated":"2014-10-03 17:21:27.000000000","message":"not sure if it would change much of the logic (and perhaps make it relatively more complex)\n\nif fields:\n   if params:\n      convert-params to query-string\n      fields \u003d param-str + \u0027\u0026\u0027 + fields-str\n   else:\n      params\u003dfields\nelse:\n   if params:\n      convert params to query-string","commit_id":"4d0cb325857ac8745efa8d856f2d610b7e02b4cd"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"b97caf10177c938fe8a1fdb54979c6b6db54563b","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":204,"context_line":"                         subresource\u003dNone, fields\u003dNone, params\u003dNone):"},{"line_number":205,"context_line":"        if params:"},{"line_number":206,"context_line":"            params \u003d \"\u0026\".join([\"%s\u003d%s\" % (p, v)"},{"line_number":207,"context_line":"                               for p, v in params.iteritems()])"},{"line_number":208,"context_line":"        if fields:"},{"line_number":209,"context_line":"            fields_str \u003d \"\u0026\".join([\"fields\u003d%s\" % x for x in fields])"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_7af7d3f5","line":206,"range":{"start_line":206,"start_character":12,"end_line":206,"end_character":18},"updated":"2015-01-29 07:08:24.000000000","message":"the variable \"params\" seems heavily re-used for different purposes in this method.  it\u0027s a bad practice.","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"6d87f65f3ef1716495d0b157364686bd9275ca31","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":204,"context_line":"                         subresource\u003dNone, fields\u003dNone, params\u003dNone):"},{"line_number":205,"context_line":"        if params:"},{"line_number":206,"context_line":"            params \u003d \"\u0026\".join([\"%s\u003d%s\" % (p, v)"},{"line_number":207,"context_line":"                               for p, v in params.iteritems()])"},{"line_number":208,"context_line":"        if fields:"},{"line_number":209,"context_line":"            fields_str \u003d \"\u0026\".join([\"fields\u003d%s\" % x for x in fields])"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa81d914_b113295b","line":206,"in_reply_to":"fa81d914_7af7d3f5","updated":"2015-01-29 11:17:57.000000000","message":"+1","commit_id":"bfac2e5e62a1b0a0a63cb2d3c4a00f7d07724d46"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2fe62189525ce3e58a2c838029d35c2b4e699e59","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":204,"context_line":"                         subresource\u003dNone, fields\u003dNone, query_params\u003dNone):"},{"line_number":205,"context_line":"        if query_params:"},{"line_number":206,"context_line":"            query_params \u003d \"\u0026\".join([\"%s\u003d%s\" % (p, v)"},{"line_number":207,"context_line":"                               for p, v in query_params.iteritems()])"},{"line_number":208,"context_line":"        if fields:"},{"line_number":209,"context_line":"            fields_str \u003d \"\u0026\".join([\"fields\u003d%s\" % x for x in fields])"}],"source_content_type":"text/x-python","patch_set":21,"id":"fa81d914_ae7b9ff3","line":206,"range":{"start_line":206,"start_character":12,"end_line":206,"end_character":24},"updated":"2015-01-30 01:51:36.000000000","message":"how about using another variable \"params_str\", instead of re-using the argument variable, so that it\u0027s consistent with fields_str?","commit_id":"aa25da77c61d36de27a6b1f7c9ae287326ada795"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"f9df42764a380918e3820d609e0e7f1975f8df2c","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":204,"context_line":"                         subresource\u003dNone, fields\u003dNone, query_params\u003dNone):"},{"line_number":205,"context_line":"        if query_params:"},{"line_number":206,"context_line":"            query_params \u003d \"\u0026\".join([\"%s\u003d%s\" % (p, v)"},{"line_number":207,"context_line":"                               for p, v in query_params.iteritems()])"},{"line_number":208,"context_line":"        if fields:"},{"line_number":209,"context_line":"            fields_str \u003d \"\u0026\".join([\"fields\u003d%s\" % x for x in fields])"}],"source_content_type":"text/x-python","patch_set":21,"id":"da86d52c_09782ac3","line":206,"in_reply_to":"fa81d914_ae7b9ff3","updated":"2015-02-03 21:05:12.000000000","message":"Done","commit_id":"aa25da77c61d36de27a6b1f7c9ae287326ada795"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"0f7952c62aeea009b3e25e098023ad12cf7ff80d","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            \u0027GET\u0027, resource, None, fmt, params\u003dparams, subresource\u003dsubresource"},{"line_number":209,"context_line":"        )"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":212,"context_line":"                         subresource\u003dNone, fields\u003dNone, query_params\u003dNone):"},{"line_number":213,"context_line":"        params_str \u003d \"\""},{"line_number":214,"context_line":"        if query_params:"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_0dec88ba","line":211,"updated":"2015-02-11 17:40:32.000000000","message":"I wonder why we need to change new_show_request. Now we try to implement provider network filter for list_networks, but new_show_request is usually used for show_network(), so I think it is better to use new_list_request instead.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"},{"author":{"_account_id":8792,"name":"Manish Godara","email":"manishg@yahoo-inc.com","username":"manishg"},"change_message_id":"7eff15190b2e5c05c970ae57d48341fb9a19fa28","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            \u0027GET\u0027, resource, None, fmt, params\u003dparams, subresource\u003dsubresource"},{"line_number":209,"context_line":"        )"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def new_show_request(self, resource, id, fmt\u003dNone,"},{"line_number":212,"context_line":"                         subresource\u003dNone, fields\u003dNone, query_params\u003dNone):"},{"line_number":213,"context_line":"        params_str \u003d \"\""},{"line_number":214,"context_line":"        if query_params:"}],"source_content_type":"text/x-python","patch_set":24,"id":"da86d52c_a330ba56","line":211,"in_reply_to":"da86d52c_0dec88ba","updated":"2015-02-12 17:31:41.000000000","message":"This is great catch as I mentioned earlier and I should have noticed it!  This change is not needed and new_list_request already does what is needed.  So I will use that instead of this method.","commit_id":"41550ff85b3b289ff97c007a3e2ce7abca0e74eb"}]}
