)]}'
{"neutron/tests/functional/agent/linux/base.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"9e0c5c95a731c54b966e0e36718ebbb9e9ceb66a","unresolved":false,"context_lines":[{"line_number":37,"context_line":"VETH_PREFIX \u003d \u0027tst-vth\u0027"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"# TODO(jschwarz): Move these two functions to neutron/tests/common/"},{"line_number":41,"context_line":"get_rand_name \u003d sub_base.get_rand_name"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a930d6b_94882ac8","line":40,"updated":"2015-01-20 21:40:26.000000000","message":"unrelated non-functional change - please revert","commit_id":"7a82f2f3e2685fae23c87d243da484b816630394"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"d6333ed9f5614abfaf0fdf671cd3ffcb7d1e5a3c","unresolved":false,"context_lines":[{"line_number":37,"context_line":"VETH_PREFIX \u003d \u0027tst-vth\u0027"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"# TODO(jschwarz): Move these two functions to neutron/tests/common/"},{"line_number":41,"context_line":"get_rand_name \u003d sub_base.get_rand_name"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1a930d6b_ffedc7f0","line":40,"in_reply_to":"1a930d6b_94882ac8","updated":"2015-01-20 21:57:50.000000000","message":"Can I please keep it? My editor complains every time I edit this file because it technically violates PEP8: https://www.python.org/dev/peps/pep-0008/#block-comments\n\n    Each line of a block comment starts with a # and a single space","commit_id":"7a82f2f3e2685fae23c87d243da484b816630394"}],"neutron/tests/functional/agent/test_ovs_lib.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.tests.functional.agent.linux import base"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"def get_rand_port_name():"},{"line_number":22,"context_line":"    return base.get_rand_name(prefix\u003dbase.PORT_PREFIX,"},{"line_number":23,"context_line":"                              max_length\u003dconstants.DEVICE_NAME_MAX_LEN)"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_8963f1db","line":21,"updated":"2015-01-16 02:39:55.000000000","message":"This helper probably belongs in the base module","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.tests.functional.agent.linux import base"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"def get_rand_port_name():"},{"line_number":22,"context_line":"    return base.get_rand_name(prefix\u003dbase.PORT_PREFIX,"},{"line_number":23,"context_line":"                              max_length\u003dconstants.DEVICE_NAME_MAX_LEN)"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_52e5e23c","line":21,"in_reply_to":"3a961159_8963f1db","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        super(OVSBridgeTestCase, self).setUp()"},{"line_number":29,"context_line":"        self.br \u003d self.create_ovs_bridge()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def create_ovs_port(self, *interface_attrs):"},{"line_number":32,"context_line":"        attrs \u003d dict(interface_attrs)"},{"line_number":33,"context_line":"        if \u0027type\u0027 not in attrs:"},{"line_number":34,"context_line":"            attrs[\u0027type\u0027] \u003d \u0027internal\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_8e4f77bd","line":31,"updated":"2015-01-16 02:39:55.000000000","message":"Using *args instead of **kwargs is really confusing.  Does order of the provided attributes matter?  If not, I think add_port and replace_port should be fixed to take kwargs instead.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        super(OVSBridgeTestCase, self).setUp()"},{"line_number":29,"context_line":"        self.br \u003d self.create_ovs_bridge()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def create_ovs_port(self, *interface_attrs):"},{"line_number":32,"context_line":"        attrs \u003d dict(interface_attrs)"},{"line_number":33,"context_line":"        if \u0027type\u0027 not in attrs:"},{"line_number":34,"context_line":"            attrs[\u0027type\u0027] \u003d \u0027internal\u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_d277123b","line":31,"in_reply_to":"3a961159_8e4f77bd","updated":"2015-01-19 20:53:08.000000000","message":"I agree that it is confusing, at least at first. I\u0027ve gotten used to it now so it doesn\u0027t bother me as much. I can\u0027t find any information that definitely says that order doesn\u0027t matter in this particular case (order between different fields in a table), and this format has been there since replace_port() was added. If I had to guess, the order was preserved just to make assert_called_with() tests easier for the execute() function since assert_called_with() doesn\u0027t really handle unordered positional arguments.\n\nI like the idea of being able to pass in kwargs when the caller knows that the order doesn\u0027t matter. It would be easy enough to merge args/kwargs since args is ((\u0027field\u0027, \u0027value\u0027),) , so args \u003d OrderedDict(args);args.update(kwargs).\n\nWith that said, it is probably out of scope for a patch that is just adding functional tests. For now, I\u0027ll just add a comment explaining the very weird looking dict() call.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        self.br \u003d self.create_ovs_bridge()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def create_ovs_port(self, *interface_attrs):"},{"line_number":32,"context_line":"        attrs \u003d dict(interface_attrs)"},{"line_number":33,"context_line":"        if \u0027type\u0027 not in attrs:"},{"line_number":34,"context_line":"            attrs[\u0027type\u0027] \u003d \u0027internal\u0027"},{"line_number":35,"context_line":"            interface_attrs \u003d attrs.items()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_893cd1c0","line":32,"updated":"2015-01-16 02:39:55.000000000","message":"If the order of attributes does matter, collections.OrderedDict might be what you want.  dict.items() returns key/value pairs in hash order, not the order that they are provided.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        self.br \u003d self.create_ovs_bridge()"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def create_ovs_port(self, *interface_attrs):"},{"line_number":32,"context_line":"        attrs \u003d dict(interface_attrs)"},{"line_number":33,"context_line":"        if \u0027type\u0027 not in attrs:"},{"line_number":34,"context_line":"            attrs[\u0027type\u0027] \u003d \u0027internal\u0027"},{"line_number":35,"context_line":"            interface_attrs \u003d attrs.items()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_12a99a7c","line":32,"in_reply_to":"3a961159_893cd1c0","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def create_ovs_port(self, *interface_attrs):"},{"line_number":32,"context_line":"        attrs \u003d dict(interface_attrs)"},{"line_number":33,"context_line":"        if \u0027type\u0027 not in attrs:"},{"line_number":34,"context_line":"            attrs[\u0027type\u0027] \u003d \u0027internal\u0027"},{"line_number":35,"context_line":"            interface_attrs \u003d attrs.items()"},{"line_number":36,"context_line":"        port_name \u003d get_rand_port_name()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_496e69c9","line":33,"updated":"2015-01-16 02:39:55.000000000","message":"(No action required) dict.setdefault(key, value) might be preferable here.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def create_ovs_port(self, *interface_attrs):"},{"line_number":32,"context_line":"        attrs \u003d dict(interface_attrs)"},{"line_number":33,"context_line":"        if \u0027type\u0027 not in attrs:"},{"line_number":34,"context_line":"            attrs[\u0027type\u0027] \u003d \u0027internal\u0027"},{"line_number":35,"context_line":"            interface_attrs \u003d attrs.items()"},{"line_number":36,"context_line":"        port_name \u003d get_rand_port_name()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_f2f08e94","line":33,"in_reply_to":"3a961159_496e69c9","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            mac \u003d base.get_rand_name()"},{"line_number":45,"context_line":"        attrs \u003d {"},{"line_number":46,"context_line":"            \u0027external_ids:%s\u0027 % iface_field: iface_id,"},{"line_number":47,"context_line":"            \u0027external_ids:attached-mac\u0027: mac}"},{"line_number":48,"context_line":"        port_name, ofport \u003d self.create_ovs_port(*attrs.items())"},{"line_number":49,"context_line":"        return ovs_lib.VifPort(port_name, ofport, iface_id, mac, self.br)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_8991319c","line":47,"updated":"2015-01-16 02:39:55.000000000","message":"(nit) Style guide sez: alignment of closing bracket and brace of multi-line statement should be at the start of opening line, e.g.\n\nattrs \u003d {\n    ...\n}","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            mac \u003d base.get_rand_name()"},{"line_number":45,"context_line":"        attrs \u003d {"},{"line_number":46,"context_line":"            \u0027external_ids:%s\u0027 % iface_field: iface_id,"},{"line_number":47,"context_line":"            \u0027external_ids:attached-mac\u0027: mac}"},{"line_number":48,"context_line":"        port_name, ofport \u003d self.create_ovs_port(*attrs.items())"},{"line_number":49,"context_line":"        return ovs_lib.VifPort(port_name, ofport, iface_id, mac, self.br)"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_722c9e02","line":47,"in_reply_to":"3a961159_8991319c","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        port_name, ofport \u003d self.create_ovs_port(*attrs.items())"},{"line_number":49,"context_line":"        return ovs_lib.VifPort(port_name, ofport, iface_id, mac, self.br)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _repeat(self, times, fn, *args, **kwargs):"},{"line_number":52,"context_line":"        results \u003d []"},{"line_number":53,"context_line":"        for _ in range(times):"},{"line_number":54,"context_line":"            results.append(fn(*args, **kwargs))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_c9ded969","line":51,"updated":"2015-01-16 02:39:55.000000000","message":"code golf:\n\nresults \u003d [fn(*args, **kwargs) for x in times]\n\nActually, I\u0027m going to suggest you simply inline this pattern rather than relying on a function.  It will be more comprehensible to the average developer.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        port_name, ofport \u003d self.create_ovs_port(*attrs.items())"},{"line_number":49,"context_line":"        return ovs_lib.VifPort(port_name, ofport, iface_id, mac, self.br)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _repeat(self, times, fn, *args, **kwargs):"},{"line_number":52,"context_line":"        results \u003d []"},{"line_number":53,"context_line":"        for _ in range(times):"},{"line_number":54,"context_line":"            results.append(fn(*args, **kwargs))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_f26faef8","line":51,"in_reply_to":"3a961159_c9ded969","updated":"2015-01-19 20:53:08.000000000","message":"For some reason it feels dirtier to throw away the list created by the list comprehension than throwing away the _repeat() results. Which really makes absolutely no sense...weird. Changing to inline.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _repeat(self, times, fn, *args, **kwargs):"},{"line_number":52,"context_line":"        results \u003d []"},{"line_number":53,"context_line":"        for _ in range(times):"},{"line_number":54,"context_line":"            results.append(fn(*args, **kwargs))"},{"line_number":55,"context_line":"        return results"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_fbd35835","line":53,"updated":"2015-01-16 02:39:55.000000000","message":"Please avoid using _ - it\u0027s actually a magical value in python.  It can represent the value of the last statement in the REPL, and is also the used by gettext in many applications.  \u0027x\u0027 or \u0027i\u0027 is more commonly used as an index variable and has no potential side-effects.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def _repeat(self, times, fn, *args, **kwargs):"},{"line_number":52,"context_line":"        results \u003d []"},{"line_number":53,"context_line":"        for _ in range(times):"},{"line_number":54,"context_line":"            results.append(fn(*args, **kwargs))"},{"line_number":55,"context_line":"        return results"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_327a16bb","line":53,"in_reply_to":"3a961159_fbd35835","updated":"2015-01-19 20:53:08.000000000","message":"function gone now","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            results.append(fn(*args, **kwargs))"},{"line_number":55,"context_line":"        return results"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_add_exists_del_port(self):"},{"line_number":58,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port((\u0027type\u0027, \u0027internal\u0027))"},{"line_number":59,"context_line":"        # ofport should always be an integer string with value -1 or \u003e 0."},{"line_number":60,"context_line":"        self.assertTrue(int(ofport))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_e9a1d5a9","line":57,"updated":"2015-01-16 02:39:55.000000000","message":"(No action required) Consider using a more general name, e.g. test_port_lifecycle().  Sometimes less is more!","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            results.append(fn(*args, **kwargs))"},{"line_number":55,"context_line":"        return results"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def test_add_exists_del_port(self):"},{"line_number":58,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port((\u0027type\u0027, \u0027internal\u0027))"},{"line_number":59,"context_line":"        # ofport should always be an integer string with value -1 or \u003e 0."},{"line_number":60,"context_line":"        self.assertTrue(int(ofport))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_32285697","line":57,"in_reply_to":"3a961159_e9a1d5a9","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.br.delete_port(port_name)"},{"line_number":68,"context_line":"        self.assertFalse(self.br.port_exists(port_name))"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_set_get_clear_db_val(self):"},{"line_number":71,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":72,"context_line":"        # TODO(twilson) The existing set/get/clear functions are horribly"},{"line_number":73,"context_line":"        # limited by not understanding what types should actually be returned"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_8990514f","line":70,"updated":"2015-01-16 02:39:55.000000000","message":"(No action required) Similarly, test_attribute_lifecycle()","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.br.delete_port(port_name)"},{"line_number":68,"context_line":"        self.assertFalse(self.br.port_exists(port_name))"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_set_get_clear_db_val(self):"},{"line_number":71,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":72,"context_line":"        # TODO(twilson) The existing set/get/clear functions are horribly"},{"line_number":73,"context_line":"        # limited by not understanding what types should actually be returned"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_52140250","line":70,"in_reply_to":"3a961159_8990514f","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":72,"context_line":"        # TODO(twilson) The existing set/get/clear functions are horribly"},{"line_number":73,"context_line":"        # limited by not understanding what types should actually be returned"},{"line_number":74,"context_line":"        # In the OVSDB Abstract Interface, they should understand deal with"},{"line_number":75,"context_line":"        # real python types"},{"line_number":76,"context_line":"        tag \u003d \u002742\u0027"},{"line_number":77,"context_line":"        self.ovs.set_db_attribute(\u0027Port\u0027, port_name, \u0027tag\u0027, tag)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_8977713a","line":74,"updated":"2015-01-16 02:39:55.000000000","message":"(nit) understand deal -\u003e understand/deal\n\nAlso, +1 to automatic marshalling","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":72,"context_line":"        # TODO(twilson) The existing set/get/clear functions are horribly"},{"line_number":73,"context_line":"        # limited by not understanding what types should actually be returned"},{"line_number":74,"context_line":"        # In the OVSDB Abstract Interface, they should understand deal with"},{"line_number":75,"context_line":"        # real python types"},{"line_number":76,"context_line":"        tag \u003d \u002742\u0027"},{"line_number":77,"context_line":"        self.ovs.set_db_attribute(\u0027Port\u0027, port_name, \u0027tag\u0027, tag)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_7219fe86","line":74,"in_reply_to":"3a961159_8977713a","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        # limited by not understanding what types should actually be returned"},{"line_number":74,"context_line":"        # In the OVSDB Abstract Interface, they should understand deal with"},{"line_number":75,"context_line":"        # real python types"},{"line_number":76,"context_line":"        tag \u003d \u002742\u0027"},{"line_number":77,"context_line":"        self.ovs.set_db_attribute(\u0027Port\u0027, port_name, \u0027tag\u0027, tag)"},{"line_number":78,"context_line":"        self.assertEqual(self.ovs.db_get_val(\u0027Port\u0027, port_name, \u0027tag\u0027), tag)"},{"line_number":79,"context_line":"        self.assertEqual(self.br.get_port_tag_dict()[port_name], int(tag))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_9b3c14c1","line":76,"updated":"2015-01-16 02:39:55.000000000","message":"Yes!","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        # limited by not understanding what types should actually be returned"},{"line_number":74,"context_line":"        # In the OVSDB Abstract Interface, they should understand deal with"},{"line_number":75,"context_line":"        # real python types"},{"line_number":76,"context_line":"        tag \u003d \u002742\u0027"},{"line_number":77,"context_line":"        self.ovs.set_db_attribute(\u0027Port\u0027, port_name, \u0027tag\u0027, tag)"},{"line_number":78,"context_line":"        self.assertEqual(self.ovs.db_get_val(\u0027Port\u0027, port_name, \u0027tag\u0027), tag)"},{"line_number":79,"context_line":"        self.assertEqual(self.br.get_port_tag_dict()[port_name], int(tag))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_32ff7604","line":76,"in_reply_to":"3a961159_9b3c14c1","updated":"2015-01-19 20:53:08.000000000","message":"If you look in the changes made for OVSDB Abstract Interface patch, you can see that it is much less ugly. :)","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        self.assertEqual(self.ovs.db_get_val(\u0027Port\u0027, port_name, \u0027tag\u0027), \u0027[]\u0027)"},{"line_number":83,"context_line":"        self.assertEqual(self.br.get_port_tag_dict()[port_name], [])"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def test_set_get_del_controller(self):"},{"line_number":86,"context_line":"        controllers \u003d {\u0027tcp:127.0.0.1:6633\u0027, \u0027tcp:172.17.16.10:55\u0027}"},{"line_number":87,"context_line":"        self.br.set_controller(controllers)"},{"line_number":88,"context_line":"        self.assertSetEqual(controllers, set(self.br.get_controller()))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_098c6134","line":85,"updated":"2015-01-16 02:39:55.000000000","message":"(No action required) ditto","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        self.assertEqual(0, len(self.br.get_controller()))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_set_fail_mode(self):"},{"line_number":96,"context_line":"        self.br.set_secure_mode()"},{"line_number":97,"context_line":"        self.assertEqual("},{"line_number":98,"context_line":"            self.br.db_get_val(\u0027Bridge\u0027, self.br.br_name, \u0027fail_mode\u0027),"},{"line_number":99,"context_line":"            \u0027secure\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_9b6334dc","line":96,"updated":"2015-01-16 02:39:55.000000000","message":"Is there any chance the bridge is already in secure mode due to a host-local configuration setting?","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4357705415793b20230418696cb473cfc96f72aa","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        self.assertEqual(0, len(self.br.get_controller()))"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def test_set_fail_mode(self):"},{"line_number":96,"context_line":"        self.br.set_secure_mode()"},{"line_number":97,"context_line":"        self.assertEqual("},{"line_number":98,"context_line":"            self.br.db_get_val(\u0027Bridge\u0027, self.br.br_name, \u0027fail_mode\u0027),"},{"line_number":99,"context_line":"            \u0027secure\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_11d48345","line":96,"in_reply_to":"3a961159_9b6334dc","updated":"2015-01-16 04:04:43.000000000","message":"If there is, I\u0027m not aware of it. Unless specifically set, it should just be empty.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            self.br.db_get_val(\u0027Bridge\u0027, self.br.br_name, \u0027protocols\u0027),"},{"line_number":108,"context_line":"            \u0027[\"OpenFlow10\"]\u0027)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def test_get_datapath_id(self):"},{"line_number":111,"context_line":"        brdev \u003d self.ip.device(self.br.br_name)"},{"line_number":112,"context_line":"        dpid \u003d brdev.link.attributes[\u0027link/ether\u0027].replace(\u0027:\u0027, \u0027\u0027)"},{"line_number":113,"context_line":"        self.br.set_db_attribute(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_3ba240fc","line":110,"updated":"2015-01-16 02:39:55.000000000","message":"test_datapath_id_lifecycle?","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            self.br.db_get_val(\u0027Bridge\u0027, self.br.br_name, \u0027protocols\u0027),"},{"line_number":108,"context_line":"            \u0027[\"OpenFlow10\"]\u0027)"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def test_get_datapath_id(self):"},{"line_number":111,"context_line":"        brdev \u003d self.ip.device(self.br.br_name)"},{"line_number":112,"context_line":"        dpid \u003d brdev.link.attributes[\u0027link/ether\u0027].replace(\u0027:\u0027, \u0027\u0027)"},{"line_number":113,"context_line":"        self.br.set_db_attribute(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_0d5edf13","line":110,"in_reply_to":"3a961159_3ba240fc","updated":"2015-01-19 20:53:08.000000000","message":"datapath_id is only get-able.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    def test_add_tunnel_port(self):"},{"line_number":118,"context_line":"        attrs \u003d {"},{"line_number":119,"context_line":"            \u0027remote_ip\u0027: \u0027192.0.2.1\u0027,  # RFC 5737 TEST-NET-1"},{"line_number":120,"context_line":"            \u0027local_ip\u0027: \u0027198.51.100.1\u0027}  # RFC 5737 TEST-NET-2"},{"line_number":121,"context_line":"        port_name \u003d get_rand_port_name()"},{"line_number":122,"context_line":"        self.br.add_tunnel_port(port_name, attrs[\u0027remote_ip\u0027],"},{"line_number":123,"context_line":"                                attrs[\u0027local_ip\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_fb827850","line":120,"updated":"2015-01-16 02:39:55.000000000","message":"(nit) style!","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":117,"context_line":"    def test_add_tunnel_port(self):"},{"line_number":118,"context_line":"        attrs \u003d {"},{"line_number":119,"context_line":"            \u0027remote_ip\u0027: \u0027192.0.2.1\u0027,  # RFC 5737 TEST-NET-1"},{"line_number":120,"context_line":"            \u0027local_ip\u0027: \u0027198.51.100.1\u0027}  # RFC 5737 TEST-NET-2"},{"line_number":121,"context_line":"        port_name \u003d get_rand_port_name()"},{"line_number":122,"context_line":"        self.br.add_tunnel_port(port_name, attrs[\u0027remote_ip\u0027],"},{"line_number":123,"context_line":"                                attrs[\u0027local_ip\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_4d97079d","line":120,"in_reply_to":"3a961159_fb827850","updated":"2015-01-19 20:53:08.000000000","message":"Done","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        # Note that ovs-vsctl\u0027s list-ports does not include the port created"},{"line_number":141,"context_line":"        # with the same name as the bridge"},{"line_number":142,"context_line":"        num_ports \u003d 5"},{"line_number":143,"context_line":"        ports \u003d set()"},{"line_number":144,"context_line":"        for _ in range(num_ports):"},{"line_number":145,"context_line":"            (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":146,"context_line":"            ports.add(port_name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_dbde9c69","line":143,"updated":"2015-01-16 02:39:55.000000000","message":"(No action required) code golf\n\nports \u003d set(self.create_ovs_port()[0] for x in range(5))\n\n(not really sure why num_ports is required)","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        # Note that ovs-vsctl\u0027s list-ports does not include the port created"},{"line_number":141,"context_line":"        # with the same name as the bridge"},{"line_number":142,"context_line":"        num_ports \u003d 5"},{"line_number":143,"context_line":"        ports \u003d set()"},{"line_number":144,"context_line":"        for _ in range(num_ports):"},{"line_number":145,"context_line":"            (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":146,"context_line":"            ports.add(port_name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_ed43530f","line":143,"in_reply_to":"3a961159_dbde9c69","updated":"2015-01-19 20:53:08.000000000","message":"I used to have a little more code here that used it. Since we\u0027re playing golf, I\u0027ll go ahead and shorten it to:\nports \u003d {self.create_ovs_port()[0] for i in range(5)}\n\n:)","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        self.assertSetEqual(ports, set(self.br.get_port_name_list()))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def test_get_port_stats(self):"},{"line_number":150,"context_line":"        # Nothing seems to use this function?"},{"line_number":151,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":152,"context_line":"        stats \u003d set(self.br.get_port_stats(port_name).keys())"},{"line_number":153,"context_line":"        self.assertTrue(set([\u0027rx_packets\u0027, \u0027tx_packets\u0027]).issubset(stats))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_1b3bc49c","line":150,"updated":"2015-01-16 02:39:55.000000000","message":"Then maybe remove it - YAGNI?","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        self.assertSetEqual(ports, set(self.br.get_port_name_list()))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def test_get_port_stats(self):"},{"line_number":150,"context_line":"        # Nothing seems to use this function?"},{"line_number":151,"context_line":"        (port_name, ofport) \u003d self.create_ovs_port()"},{"line_number":152,"context_line":"        stats \u003d set(self.br.get_port_stats(port_name).keys())"},{"line_number":153,"context_line":"        self.assertTrue(set([\u0027rx_packets\u0027, \u0027tx_packets\u0027]).issubset(stats))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_2de0fb25","line":150,"in_reply_to":"3a961159_1b3bc49c","updated":"2015-01-19 20:53:08.000000000","message":"Wasn\u0027t sure whether something out-of-tree used it? I\u0027m not opposed to deleting it, but I want to keep this patch testing-only.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":200,"context_line":"class OVSLibTestCase(base.BaseOVSLinuxTestCase):"},{"line_number":201,"context_line":"    def test_add_exists_destroy_bridge(self):"},{"line_number":202,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":203,"context_line":"        br \u003d self.ovs.add_bridge(name)"},{"line_number":204,"context_line":"        self.assertEqual(br.br_name, name)"},{"line_number":205,"context_line":"        self.assertTrue(self.ovs.bridge_exists(name))"},{"line_number":206,"context_line":"        self.ovs.delete_bridge(name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_fba198a9","line":203,"updated":"2015-01-16 02:39:55.000000000","message":"Please use create_bridge() (or manually call addCleanup here) to ensure that cleanup is always attempted even in the event of an assertion failure.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4357705415793b20230418696cb473cfc96f72aa","unresolved":false,"context_lines":[{"line_number":200,"context_line":"class OVSLibTestCase(base.BaseOVSLinuxTestCase):"},{"line_number":201,"context_line":"    def test_add_exists_destroy_bridge(self):"},{"line_number":202,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":203,"context_line":"        br \u003d self.ovs.add_bridge(name)"},{"line_number":204,"context_line":"        self.assertEqual(br.br_name, name)"},{"line_number":205,"context_line":"        self.assertTrue(self.ovs.bridge_exists(name))"},{"line_number":206,"context_line":"        self.ovs.delete_bridge(name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_9e8402b2","line":203,"in_reply_to":"3a961159_fba198a9","updated":"2015-01-16 04:04:43.000000000","message":"I\u0027d like to keep manually calling BaseOVS.add_bridge/delete_bridge just to ensure that those are actually tested even if create_ovs_bridge() somehow changes. I\u0027ll go ahead and add the addCleanup call as delete_bridge should pass --if-exists to ovs-vsctl and I need to delete the bridge in the test.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                   for _ in range(num_bridges)}"},{"line_number":213,"context_line":"        self.assertTrue(set(self.ovs.get_bridges()).issuperset(bridges))"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def test_ovsbridge_create_destroy(self):"},{"line_number":216,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":217,"context_line":"        br \u003d ovs_lib.OVSBridge(name, self.root_helper)"},{"line_number":218,"context_line":"        self.assertEqual(br.br_name, name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_5b82acff","line":215,"updated":"2015-01-16 02:39:55.000000000","message":"I think this is better validated in a unit test.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4357705415793b20230418696cb473cfc96f72aa","unresolved":false,"context_lines":[{"line_number":212,"context_line":"                   for _ in range(num_bridges)}"},{"line_number":213,"context_line":"        self.assertTrue(set(self.ovs.get_bridges()).issuperset(bridges))"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def test_ovsbridge_create_destroy(self):"},{"line_number":216,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":217,"context_line":"        br \u003d ovs_lib.OVSBridge(name, self.root_helper)"},{"line_number":218,"context_line":"        self.assertEqual(br.br_name, name)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_3e9cee0d","line":215,"in_reply_to":"3a961159_5b82acff","updated":"2015-01-16 04:04:43.000000000","message":"I\u0027m not sure of a really good way with unit tests to ensure that instantiating an OVSBridge object doesn\u0027t create an actual OVS bridge, especially after we have multiple OVS backends.\n\nAlso, I plan to break the connection between BaseOVS.add_bridge and OVSBridge.create because it bothers me that add_bridge creates an OVSBridge object that we throw away in OVSBridge.create. The interface abstraction will still give us code re-use as both will just call self.ovsdb.add_br(bridge_name). So it makes sense to me to test both add_bridge and OVSBridge() with separate functional tests.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c89be690af752ef808c930c9e1e1bf103b7b0940","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        br.destroy()"},{"line_number":224,"context_line":"        self.assertFalse(self.ovs.bridge_exists(name))"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def test_ovsbridge_contextmanager(self):"},{"line_number":227,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":228,"context_line":"        with ovs_lib.OVSBridge(name, self.root_helper):"},{"line_number":229,"context_line":"            self.assertTrue(self.ovs.bridge_exists(name))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_bb9b9071","line":226,"updated":"2015-01-16 02:39:55.000000000","message":"I think this is better validated in a unit test.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2fb09198068ed55513c68943bcdb95d4d49a45af","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        br.destroy()"},{"line_number":224,"context_line":"        self.assertFalse(self.ovs.bridge_exists(name))"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def test_ovsbridge_contextmanager(self):"},{"line_number":227,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":228,"context_line":"        with ovs_lib.OVSBridge(name, self.root_helper):"},{"line_number":229,"context_line":"            self.assertTrue(self.ovs.bridge_exists(name))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_6db763d8","line":226,"in_reply_to":"3a961159_71414738","updated":"2015-01-19 20:53:08.000000000","message":"Removed.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4357705415793b20230418696cb473cfc96f72aa","unresolved":false,"context_lines":[{"line_number":223,"context_line":"        br.destroy()"},{"line_number":224,"context_line":"        self.assertFalse(self.ovs.bridge_exists(name))"},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"    def test_ovsbridge_contextmanager(self):"},{"line_number":227,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":228,"context_line":"        with ovs_lib.OVSBridge(name, self.root_helper):"},{"line_number":229,"context_line":"            self.assertTrue(self.ovs.bridge_exists(name))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_71414738","line":226,"in_reply_to":"3a961159_bb9b9071","updated":"2015-01-16 04:04:43.000000000","message":"We can assert that OVSBridge.create/destroy are called in a unit test, so as long as I have a functional test verifying that those do create/destroy actual OVS bridges, I\u0027m happy with this becoming a unit test.","commit_id":"bd33e5354a86592b373decd4c60ef15156941281"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4bc2808264aff45661a7b46e3e2bec68f7a4c1e9","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":"import collections"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from neutron.agent.linux import ovs_lib"},{"line_number":18,"context_line":"from neutron.tests.functional.agent.linux import base"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_188c5b80","line":15,"updated":"2015-01-19 21:23:34.000000000","message":"(No action required) the convention is to include a blank line between license and imports.","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4bc2808264aff45661a7b46e3e2bec68f7a4c1e9","unresolved":false,"context_lines":[{"line_number":64,"context_line":"        # real python types"},{"line_number":65,"context_line":"        tag \u003d \u002742\u0027"},{"line_number":66,"context_line":"        self.ovs.set_db_attribute(\u0027Port\u0027, port_name, \u0027tag\u0027, tag)"},{"line_number":67,"context_line":"        self.assertEqual(self.ovs.db_get_val(\u0027Port\u0027, port_name, \u0027tag\u0027), tag)"},{"line_number":68,"context_line":"        self.assertEqual(self.br.get_port_tag_dict()[port_name], int(tag))"},{"line_number":69,"context_line":"        self.ovs.clear_db_attribute(\u0027Port\u0027, port_name, \u0027tag\u0027)"},{"line_number":70,"context_line":"        # ick, ick, ick"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_585a63f6","line":67,"updated":"2015-01-19 21:23:34.000000000","message":"(No action required) I personally don\u0027t care about this, but some reviewers like to nit on including the expected value first and the actual value second.  Nova\u0027s test infrastructure apparently cares about this - formatting the error message in a way that names the values in the expected order - but Neutron\u0027s does not.","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4bc2808264aff45661a7b46e3e2bec68f7a4c1e9","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        dpid \u003d brdev.link.attributes[\u0027link/ether\u0027].replace(\u0027:\u0027, \u0027\u0027)"},{"line_number":102,"context_line":"        self.br.set_db_attribute(\u0027Bridge\u0027,"},{"line_number":103,"context_line":"                                 self.br.br_name, \u0027datapath_id\u0027, dpid)"},{"line_number":104,"context_line":"        self.assertTrue(dpid in self.br.get_datapath_id())"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def test_add_tunnel_port(self):"},{"line_number":107,"context_line":"        attrs \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_f8f14fdf","line":104,"updated":"2015-01-19 21:23:34.000000000","message":"-\u003e assertIn","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4bc2808264aff45661a7b46e3e2bec68f7a4c1e9","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        vif_ports \u003d [self.create_ovs_vif_port() for i in range(3)]"},{"line_number":145,"context_line":"        ports \u003d self.br.get_vif_ports()"},{"line_number":146,"context_line":"        self.assertEqual(3, len(ports))"},{"line_number":147,"context_line":"        self.assertTrue(all([isinstance(x, ovs_lib.VifPort) for x in ports]))"},{"line_number":148,"context_line":"        self.assertEqual(sorted([x.port_name for x in vif_ports]),"},{"line_number":149,"context_line":"                         sorted([x.port_name for x in ports]))"},{"line_number":150,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_588b4317","line":147,"updated":"2015-01-19 21:23:34.000000000","message":"(No action required) This is the kind of thing that I would expect to be validated by a unit test.","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4bc2808264aff45661a7b46e3e2bec68f7a4c1e9","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        # Create 2 non-vif ports and 2 vif ports"},{"line_number":177,"context_line":"        for i in range(2):"},{"line_number":178,"context_line":"            self.create_ovs_port()"},{"line_number":179,"context_line":"            # TODO(twilson) The formant for interface_attrs will change to"},{"line_number":180,"context_line":"            # allow dicts in the OVSDB Abstract Interface patch"},{"line_number":181,"context_line":"            self.create_ovs_vif_port()"},{"line_number":182,"context_line":"        self.assertEqual(len(self.br.get_port_name_list()), 4)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_18c0db2a","line":179,"updated":"2015-01-19 21:23:34.000000000","message":"(No action required) formant -\u003e format","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4bc2808264aff45661a7b46e3e2bec68f7a4c1e9","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"class OVSLibTestCase(base.BaseOVSLinuxTestCase):"},{"line_number":190,"context_line":"    def test_add_exists_destroy_bridge(self):"},{"line_number":191,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":192,"context_line":"        self.addCleanup(self.ovs.delete_bridge, name)"},{"line_number":193,"context_line":"        br \u003d self.ovs.add_bridge(name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_4db8e778","line":190,"updated":"2015-01-19 21:23:34.000000000","message":"(No action required) -\u003e test_bridge_lifecycle","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4bc2808264aff45661a7b46e3e2bec68f7a4c1e9","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        bridges \u003d {self.create_ovs_bridge().br_name for i in range(5)}"},{"line_number":201,"context_line":"        self.assertTrue(set(self.ovs.get_bridges()).issuperset(bridges))"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def test_ovsbridge_create_destroy(self):"},{"line_number":204,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":205,"context_line":"        br \u003d ovs_lib.OVSBridge(name, self.root_helper)"},{"line_number":206,"context_line":"        self.assertEqual(br.br_name, name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_cd7217e4","line":203,"updated":"2015-01-19 21:23:34.000000000","message":"There is only every going to be one way to create a bridge in the underlying library, regardless of the python niceties on top, and a functional test is really only necessary to ensure that we can correctly interact with the underlying library.  I don\u0027t care which becomes the path tested by a functional test, but I think you should pick only one of them and the other can be subject to a unit test.  Only when we can\u0027t validate a path by a unit test do we want to resort to a more expensive functional test.","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5295f08f9ab0c0747d661a15d5aaf55c156c3fdb","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        bridges \u003d {self.create_ovs_bridge().br_name for i in range(5)}"},{"line_number":201,"context_line":"        self.assertTrue(set(self.ovs.get_bridges()).issuperset(bridges))"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def test_ovsbridge_create_destroy(self):"},{"line_number":204,"context_line":"        name \u003d base.get_rand_name(prefix\u003dbase.BR_PREFIX)"},{"line_number":205,"context_line":"        br \u003d ovs_lib.OVSBridge(name, self.root_helper)"},{"line_number":206,"context_line":"        self.assertEqual(br.br_name, name)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_3365b8af","line":203,"in_reply_to":"3a961159_cd7217e4","updated":"2015-01-19 21:46:09.000000000","message":"On second thought, this isn\u0027t as clear-cut as I thought.  We do need to validate that OVSBridge can interact with an already created bridge.  It might also make sense to interact with the bridge (e.g. list ports).","commit_id":"7058f530a284d315a565ba449f96f44ceac91442"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"9e0c5c95a731c54b966e0e36718ebbb9e9ceb66a","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_get_bridge_external_bridge_id(self):"},{"line_number":90,"context_line":"        self.ovs.set_db_attribute(\u0027Bridge\u0027, self.br.br_name,"},{"line_number":91,"context_line":"                                  \u0027external_ids:bridge-id\u0027, self.br.br_name)"},{"line_number":92,"context_line":"        self.assertEqual("},{"line_number":93,"context_line":"            self.br.br_name,"},{"line_number":94,"context_line":"            self.ovs.get_bridge_external_bridge_id(self.br.br_name))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a930d6b_74881ee8","line":91,"updated":"2015-01-20 21:40:26.000000000","message":"(No action required) Consider using a unique id (bridge name seems too obvious) to ensure that the correct thing is being returned by the method.","commit_id":"7a82f2f3e2685fae23c87d243da484b816630394"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"d6333ed9f5614abfaf0fdf671cd3ffcb7d1e5a3c","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_get_bridge_external_bridge_id(self):"},{"line_number":90,"context_line":"        self.ovs.set_db_attribute(\u0027Bridge\u0027, self.br.br_name,"},{"line_number":91,"context_line":"                                  \u0027external_ids:bridge-id\u0027, self.br.br_name)"},{"line_number":92,"context_line":"        self.assertEqual("},{"line_number":93,"context_line":"            self.br.br_name,"},{"line_number":94,"context_line":"            self.ovs.get_bridge_external_bridge_id(self.br.br_name))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a930d6b_7f5d57e9","line":91,"in_reply_to":"1a930d6b_74881ee8","updated":"2015-01-20 21:57:50.000000000","message":"[vagrant@localhost neutron]$ sudo ovs-vsctl br-get-external-id br-int bridge-id\n\nbr-int\n\n[vagrant@localhost neutron]$ sudo ovs-vsctl br-get-external-id br-ex bridge-id\n\nbr-ex","commit_id":"7a82f2f3e2685fae23c87d243da484b816630394"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"2ea812cac45b07f56f958e773f8c8093903a3504","unresolved":false,"context_lines":[{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def test_set_protocols(self):"},{"line_number":113,"context_line":"        # TODO(twilson) set_protocols is technically broken as it should"},{"line_number":114,"context_line":"        # allow one to set an array of allowed protocols"},{"line_number":115,"context_line":"        self.br.set_protocols(\u0027OpenFlow10\u0027)"},{"line_number":116,"context_line":"        # and again, ick, this has to change"},{"line_number":117,"context_line":"        self.assertEqual("}],"source_content_type":"text/x-python","patch_set":8,"id":"1a930d6b_1e744cfc","line":114,"updated":"2015-01-21 07:54:19.000000000","message":"i think you can do br.set_protocols(\u0027[OpenFlow10,OpenFlow13]\u0027).\ni agree it\u0027s an awkward api though.","commit_id":"42beb9016f9921500adca5896620b9aa4879c8ba"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"051b5e0dd82628c3202dd4655babab0cff719492","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        # TODO(twilson) I would prefer this test against [], but currently"},{"line_number":102,"context_line":"        # get_controller returns \u0027\u0027 when there are no controllers. This will"},{"line_number":103,"context_line":"        # change with the OVSDB Abstract Interface work."},{"line_number":104,"context_line":"        self.assertEqual(0, len(self.br.get_controller()))"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def test_set_fail_mode(self):"},{"line_number":107,"context_line":"        self.br.set_secure_mode()"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_1818cd80","line":104,"updated":"2015-01-21 17:07:09.000000000","message":"Why not?\n\nself.assertFalse(self.br.get_controller())\n\nIt works for either case.","commit_id":"0924d2e804c759ca70348c05d62541bf9d368543"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"51c198691adcc43891dc5470b4e75124d2bd77ca","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        # TODO(twilson) I would prefer this test against [], but currently"},{"line_number":102,"context_line":"        # get_controller returns \u0027\u0027 when there are no controllers. This will"},{"line_number":103,"context_line":"        # change with the OVSDB Abstract Interface work."},{"line_number":104,"context_line":"        self.assertEqual(0, len(self.br.get_controller()))"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    def test_set_fail_mode(self):"},{"line_number":107,"context_line":"        self.br.set_secure_mode()"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_8c1d5ac0","line":104,"in_reply_to":"1a930d6b_1818cd80","updated":"2015-01-21 21:35:57.000000000","message":"I\u0027d like to still enforce that this isn\u0027t something like None and I\u0027ve got this updated in the followup OVSDB patch anyway, so I\u0027ll just leave this here for now.","commit_id":"0924d2e804c759ca70348c05d62541bf9d368543"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"051b5e0dd82628c3202dd4655babab0cff719492","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            self.create_ovs_vif_port()"},{"line_number":204,"context_line":"        self.assertEqual(len(self.br.get_port_name_list()), 4)"},{"line_number":205,"context_line":"        self.br.delete_ports()"},{"line_number":206,"context_line":"        self.assertEqual(len(self.br.get_port_name_list()), 2)"},{"line_number":207,"context_line":"        self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":208,"context_line":"        self.assertEqual(len(self.br.get_port_name_list()), 0)"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_43f98ac7","line":206,"updated":"2015-01-21 17:07:09.000000000","message":"Should we validate that we\u0027re actually deleting are the 2 we expect?","commit_id":"0924d2e804c759ca70348c05d62541bf9d368543"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"51c198691adcc43891dc5470b4e75124d2bd77ca","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            self.create_ovs_vif_port()"},{"line_number":204,"context_line":"        self.assertEqual(len(self.br.get_port_name_list()), 4)"},{"line_number":205,"context_line":"        self.br.delete_ports()"},{"line_number":206,"context_line":"        self.assertEqual(len(self.br.get_port_name_list()), 2)"},{"line_number":207,"context_line":"        self.br.delete_ports(all_ports\u003dTrue)"},{"line_number":208,"context_line":"        self.assertEqual(len(self.br.get_port_name_list()), 0)"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_ec833eca","line":206,"in_reply_to":"1a930d6b_43f98ac7","updated":"2015-01-21 21:35:57.000000000","message":"Good point. Reworking to fix this.","commit_id":"0924d2e804c759ca70348c05d62541bf9d368543"}]}
