)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"f95da5876750632d51e2e84dc3dfec8caec2658d","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Functional test IPAM DB operation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a functional test to check that the IPAM logic is correct and"},{"line_number":10,"context_line":"that the data stored in the DB are sane."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I7776a50824184663abd37e210d08a63eb5519cea"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"3a961159_1cc2ec84","line":10,"updated":"2014-12-22 08:53:55.000000000","message":"Shouldn\u0027t we have a bug about missing such test?","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"82b7b4d324f88c6113acada0b7b78b77b1582159","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Functional test IPAM DB operation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add a functional test to check that the IPAM logic is correct and"},{"line_number":10,"context_line":"that the data stored in the DB are sane."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I7776a50824184663abd37e210d08a63eb5519cea"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"3a961159_3a588130","line":10,"in_reply_to":"3a961159_1cc2ec84","updated":"2015-01-07 15:06:39.000000000","message":"This test was actually required by reviewers of a bug fix. I can add the bug number of that bug instead of creating a new one.","commit_id":"bccd576932ec0599e235498bc243e27657c91582"}],"neutron/tests/functional/db/base.py":[{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"1bd95a64cf658a5bc4ae22dd28e8638be5a5277d","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(BaseDBTest, self).setUp()"},{"line_number":38,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":39,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":40,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_ea4eb295","line":37,"updated":"2014-10-12 14:43:46.000000000","message":"str(uuid.uuid4()) can be replaced by neutron.openstack.common.uuidutils.generate_uuid()","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b2ab8084b34e653823d92bad8611756fdce478a5","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    \"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(BaseDBTest, self).setUp()"},{"line_number":38,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":39,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":40,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_00d56b42","line":37,"in_reply_to":"baa201ad_ea4eb295","updated":"2014-10-22 16:06:13.000000000","message":"Done","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"c32d1340fbc13e4716fa78336007cba894fae2ce","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(BaseDBTest, self).setUp()"},{"line_number":38,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":39,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":40,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":41,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_ac2d51aa","line":38,"updated":"2014-10-05 13:02:15.000000000","message":"Please use string formatting here:\n\n self.test_db \u003d \u0027`neutron_test_%s`\u0027 % str(uuid.uuid4())","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b2ab8084b34e653823d92bad8611756fdce478a5","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(BaseDBTest, self).setUp()"},{"line_number":38,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":39,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":40,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":41,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_604c7743","line":38,"in_reply_to":"baa201ad_ac2d51aa","updated":"2014-10-22 16:06:13.000000000","message":"Done","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"c32d1340fbc13e4716fa78336007cba894fae2ce","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":42,"context_line":"                              test_conn_string,"},{"line_number":43,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":44,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":45,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":46,"context_line":"        self.create_db(self.test_db)"},{"line_number":47,"context_line":"        model_base.BASEV2.metadata.create_all(self.engine)"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_2c11615d","line":44,"updated":"2014-10-05 13:02:15.000000000","message":"IMO db_api.get_engine() doesn\u0027t change between each test - why not initialize it in setUpClass and have it be a class attribute (as opposed to instance attribute)? The same can be for the original_conn_string.\n\nThis will have the added benefit of self.create_db and self.drop_db also be able to turn into class method (since they won\u0027t use anything from self), thus they will make more sense (and allow anyone to create and delete databases in an easier way).","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b2ab8084b34e653823d92bad8611756fdce478a5","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":42,"context_line":"                              test_conn_string,"},{"line_number":43,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":44,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":45,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":46,"context_line":"        self.create_db(self.test_db)"},{"line_number":47,"context_line":"        model_base.BASEV2.metadata.create_all(self.engine)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_60fab7be","line":44,"in_reply_to":"baa201ad_2c11615d","updated":"2014-10-22 16:06:13.000000000","message":"I want to use a different connection string for each test, this is the line that initialize the engine using the config file overridden at line 41. I think it should stay an instance method","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"c32d1340fbc13e4716fa78336007cba894fae2ce","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                              test_conn_string,"},{"line_number":43,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":44,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":45,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":46,"context_line":"        self.create_db(self.test_db)"},{"line_number":47,"context_line":"        model_base.BASEV2.metadata.create_all(self.engine)"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_ec1af97b","line":45,"updated":"2014-10-05 13:02:15.000000000","message":"If you didn\u0027t like what I wrote before, then self.create_db and self.drop_db should receive no parameters since they can directly call self.test_db.","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b2ab8084b34e653823d92bad8611756fdce478a5","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                              test_conn_string,"},{"line_number":43,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":44,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":45,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":46,"context_line":"        self.create_db(self.test_db)"},{"line_number":47,"context_line":"        model_base.BASEV2.metadata.create_all(self.engine)"},{"line_number":48,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_20dfcf3c","line":45,"in_reply_to":"baa201ad_ec1af97b","updated":"2014-10-22 16:06:13.000000000","message":"I wanted to keep those methods more generic so that can be used to create any db if needed","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"c32d1340fbc13e4716fa78336007cba894fae2ce","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    def config_parse(conf\u003dNone, args\u003dNone):"},{"line_number":51,"context_line":"        \"\"\"Create the default configurations.\"\"\""},{"line_number":52,"context_line":"        # FIXME(rossella_s): is it ok to take the connection string from"},{"line_number":53,"context_line":"        # neutron.conf ? Are there better ways?"},{"line_number":54,"context_line":"        if args is None:"},{"line_number":55,"context_line":"            args \u003d [\u0027--config-file\u0027, \u0027/etc/neutron/neutron.conf\u0027]"},{"line_number":56,"context_line":"        if conf is None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baa201ad_a732caef","line":53,"updated":"2014-10-05 13:02:15.000000000","message":"I think this would break when running not under devstack (ie. packstack puts the file in a different location I think).\n\nPossible solutions:\n1. Make a dummy neutron.conf and put it in a dummy place (like neutron/tests/functional/etc/ - a similar thing is done in tempest) and read from os.path.join(__main__.__file__, \"etc\", \"neutron.conf\").\n2. Look in common paths (like /etc/neutron, /etc/openstack/neutron, ...) to find a file called \u0027neutron.conf\u0027\n\nObviously I think #1 is better :)","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"b2ab8084b34e653823d92bad8611756fdce478a5","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    def config_parse(conf\u003dNone, args\u003dNone):"},{"line_number":51,"context_line":"        \"\"\"Create the default configurations.\"\"\""},{"line_number":52,"context_line":"        # FIXME(rossella_s): is it ok to take the connection string from"},{"line_number":53,"context_line":"        # neutron.conf ? Are there better ways?"},{"line_number":54,"context_line":"        if args is None:"},{"line_number":55,"context_line":"            args \u003d [\u0027--config-file\u0027, \u0027/etc/neutron/neutron.conf\u0027]"},{"line_number":56,"context_line":"        if conf is None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_80ca3b6c","line":53,"in_reply_to":"baa201ad_a732caef","updated":"2014-10-22 16:06:13.000000000","message":"As we discussed per IRC probably the best solution is to create a db user in the gate_hook script just for the functional tests and use that. I will wait for more feedback regarding this point.","commit_id":"792e21852714bb842dc364bf46514a49c801e550"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 SUSE Linux Products GmbH"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_1ea63fae","line":1,"updated":"2014-10-27 18:52:11.000000000","message":"Db fixture management should be left to the helpers in oslo.db.  Please see [1] for an example, but basically, it\u0027s possible to extend an oslo.db test helper and have it create a fresh db in the test environment using standard credentials and cleanup at the end.  For now, it will only work in the unit test job due to dependencies in the underlying environment (so you\u0027ll have to add the tests to the unit subtree for now), but Henry is working on a fix [2] to allow it to run as part of the functional job.\n\n1: https://github.com/openstack/neutron/blob/master/neutron/tests/unit/db/test_migration.py\n2: https://review.openstack.org/#/c/126175","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 SUSE Linux Products GmbH"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_7341e638","line":1,"in_reply_to":"9aa7fdbe_1ea63fae","updated":"2014-11-11 23:03:12.000000000","message":"Thanks for the suggestion. I have moved the test to unit tests and used the oslo.db test helper. When possible I will move it back in the functional folder","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"33ce411a4ded457434771b51eb91582aa96aed24","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        \"\"\"Create the default configurations.\"\"\""},{"line_number":52,"context_line":"        # FIXME(rossella_s): is it ok to take the connection string from"},{"line_number":53,"context_line":"        # neutron.conf ? Should a db user be created in the gate_hook.sh and be"},{"line_number":54,"context_line":"        # used only for the tests?"},{"line_number":55,"context_line":"        if args is None:"},{"line_number":56,"context_line":"            args \u003d [\u0027--config-file\u0027, \u0027/etc/neutron/neutron.conf\u0027]"},{"line_number":57,"context_line":"        if conf is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_8d330f13","line":54,"updated":"2014-10-24 19:03:27.000000000","message":"How will I set the connection string if I\u0027m on my workstation just working in a local sandbox?  I wouldn\u0027t expect to have /etc/neutron/neutron.conf.  I guess I could just edit the code.\n\nI don\u0027t feel strongly about this at the moment.  Maybe because it is Friday.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        \"\"\"Create the default configurations.\"\"\""},{"line_number":52,"context_line":"        # FIXME(rossella_s): is it ok to take the connection string from"},{"line_number":53,"context_line":"        # neutron.conf ? Should a db user be created in the gate_hook.sh and be"},{"line_number":54,"context_line":"        # used only for the tests?"},{"line_number":55,"context_line":"        if args is None:"},{"line_number":56,"context_line":"            args \u003d [\u0027--config-file\u0027, \u0027/etc/neutron/neutron.conf\u0027]"},{"line_number":57,"context_line":"        if conf is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_d348da5d","line":54,"in_reply_to":"9aa7fdbe_8d330f13","updated":"2014-11-11 23:03:12.000000000","message":"Right, I completely changed that following Maru\u0027s suggestion","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"}],"neutron/tests/functional/db/test_ipam.py":[{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"2543001475fbabac0c6eec2f74c027cdf6a34e73","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import eventlet"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from neutron.api.v2 import attributes"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_a71235b2","line":17,"updated":"2014-09-30 14:09:02.000000000","message":"nit: remove empty line (eventlet is 3rd party and we also treat oslo as 3rd party)","commit_id":"3d42c5e7243886b92cb9a1691f9694c870272f66"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"83a178200c9756664266ad64758747761b6b6246","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import eventlet"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from neutron.api.v2 import attributes"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_7ba0da90","line":17,"in_reply_to":"baa201ad_a71235b2","updated":"2014-09-30 22:12:27.000000000","message":"Done","commit_id":"3d42c5e7243886b92cb9a1691f9694c870272f66"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"2543001475fbabac0c6eec2f74c027cdf6a34e73","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    @staticmethod"},{"line_number":53,"context_line":"    def config_parse(conf\u003dNone, args\u003dNone):"},{"line_number":54,"context_line":"        \"\"\"Create the default configurations.\"\"\""},{"line_number":55,"context_line":"        # FIXME(rossella_s): neutron.conf path shouldn\u0027t be hard-coded"},{"line_number":56,"context_line":"        if args is None:"},{"line_number":57,"context_line":"            args \u003d [\u0027--config-file\u0027, \u0027/etc/neutron/neutron.conf\u0027]"},{"line_number":58,"context_line":"        if conf is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_a7187585","line":55,"updated":"2014-09-30 14:09:02.000000000","message":"I\u0027m not sure this does what you are looking for but in test_db_plugin args passed to config_parse are defined as\n args \u003d [\u0027--config-file\u0027, base.etcdir(\u0027neutron.conf.test\u0027)]","commit_id":"3d42c5e7243886b92cb9a1691f9694c870272f66"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"83a178200c9756664266ad64758747761b6b6246","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    @staticmethod"},{"line_number":53,"context_line":"    def config_parse(conf\u003dNone, args\u003dNone):"},{"line_number":54,"context_line":"        \"\"\"Create the default configurations.\"\"\""},{"line_number":55,"context_line":"        # FIXME(rossella_s): neutron.conf path shouldn\u0027t be hard-coded"},{"line_number":56,"context_line":"        if args is None:"},{"line_number":57,"context_line":"            args \u003d [\u0027--config-file\u0027, \u0027/etc/neutron/neutron.conf\u0027]"},{"line_number":58,"context_line":"        if conf is None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_bbd8821e","line":55,"in_reply_to":"baa201ad_a7187585","updated":"2014-09-30 22:12:27.000000000","message":"Thanks for the suggestion anyway I have to use the neutron.conf in /etc/neutron, not the one in the test directory.","commit_id":"3d42c5e7243886b92cb9a1691f9694c870272f66"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"cfaaca8913d90609d9ad3dc888bc1a58afa93e73","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import eventlet"},{"line_number":17,"context_line":"from oslo.config import cfg"},{"line_number":18,"context_line":"from random import randint"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from neutron.api.v2 import attributes"},{"line_number":21,"context_line":"from neutron.common import config"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_883c4fe4","line":18,"updated":"2014-10-01 08:18:25.000000000","message":"Import module instead of method (and move this up http://docs.openstack.org/developer/hacking/#import-order-template)","commit_id":"bcf178a399953834eb70f5b937a027220bbac5b5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d46547451a73e3b5b23bf854327146068b51ba08","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import eventlet"},{"line_number":17,"context_line":"from oslo.config import cfg"},{"line_number":18,"context_line":"from random import randint"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from neutron.api.v2 import attributes"},{"line_number":21,"context_line":"from neutron.common import config"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_d73a6ecc","line":18,"in_reply_to":"baa201ad_883c4fe4","updated":"2014-10-01 13:38:29.000000000","message":"Module imported. The position is just right though :)","commit_id":"bcf178a399953834eb70f5b937a027220bbac5b5"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"cfaaca8913d90609d9ad3dc888bc1a58afa93e73","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(DBTestFramework, self).setUp()"},{"line_number":40,"context_line":"        self.test_db \u003d \u0027neutron_test\u0027 + str(randint(1, 99))"},{"line_number":41,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":42,"context_line":"        # FIXME(rossella_s) this is a dirty hack to get the connection string"},{"line_number":43,"context_line":"        # a better way should be found"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_48642722","line":40,"updated":"2014-10-01 08:18:25.000000000","message":"Since tests are run with random PYTHONHASHSEED this still has a slight chance to fail (but I think bigger than acceptable) maybe something like uuid (while it still can generate duplications its so rare that can be ignored) ?","commit_id":"bcf178a399953834eb70f5b937a027220bbac5b5"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"d46547451a73e3b5b23bf854327146068b51ba08","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(DBTestFramework, self).setUp()"},{"line_number":40,"context_line":"        self.test_db \u003d \u0027neutron_test\u0027 + str(randint(1, 99))"},{"line_number":41,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":42,"context_line":"        # FIXME(rossella_s) this is a dirty hack to get the connection string"},{"line_number":43,"context_line":"        # a better way should be found"}],"source_content_type":"text/x-python","patch_set":5,"id":"baa201ad_37301ae8","line":40,"in_reply_to":"baa201ad_48642722","updated":"2014-10-01 13:38:29.000000000","message":"uuid seemed an overkill to me. Anyway I modified the code. Still waiting for more comments, not sure this is the best approach","commit_id":"bcf178a399953834eb70f5b937a027220bbac5b5"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"dd602192cb3e3eeb21ee84e093d0a7b4ab6d9162","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import eventlet"},{"line_number":17,"context_line":"from oslo.config import cfg"},{"line_number":18,"context_line":"import random"},{"line_number":19,"context_line":"import uuid"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron.api.v2 import attributes"},{"line_number":22,"context_line":"from neutron.common import config"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_63682188","line":19,"updated":"2014-10-01 15:30:11.000000000","message":"Missed this in the previous runthrough, but the imports here should be reordered - first python std classes, then eventlet and oslo, then neutron stuff.","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6d6006db4286a293c0b67c88a0e2ad0cb0f80fb","unresolved":false,"context_lines":[{"line_number":16,"context_line":"import eventlet"},{"line_number":17,"context_line":"from oslo.config import cfg"},{"line_number":18,"context_line":"import random"},{"line_number":19,"context_line":"import uuid"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from neutron.api.v2 import attributes"},{"line_number":22,"context_line":"from neutron.common import config"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_eb868e64","line":19,"in_reply_to":"baa201ad_63682188","updated":"2014-10-02 15:34:28.000000000","message":"oh yes, you are right.","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"9d00a22f7943f787d8555ace3f9695761a0ab903","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from neutron.tests import base"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":"DB_PLUGIN_KLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class DBTestFramework(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_08fe9438","line":34,"updated":"2014-10-01 15:18:33.000000000","message":"I\u0027m sorry about this nit, but CLASS is the proper spelling :\u003c :\u003c :\u003c","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"201e1379b4b5c4aa63e74092ae7c03bba40ae4e8","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from neutron.tests import base"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":"DB_PLUGIN_KLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class DBTestFramework(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_9b0c373d","line":34,"in_reply_to":"9aa7fdbe_256c1808","updated":"2014-10-24 09:30:46.000000000","message":"Yep, that\u0027s probably the historical reason :)","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6d6006db4286a293c0b67c88a0e2ad0cb0f80fb","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from neutron.tests import base"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":"DB_PLUGIN_KLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class DBTestFramework(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_6b929ea0","line":34,"in_reply_to":"baa201ad_08fe9438","updated":"2014-10-02 15:34:28.000000000","message":"I copied it from somewhere else. Anyway no problem I can fix the spelling","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"238fb77301e4d5f15b3440d32d33804df5f95bd4","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from neutron.tests import base"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":"DB_PLUGIN_KLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class DBTestFramework(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_256c1808","line":34,"in_reply_to":"baa201ad_6b929ea0","updated":"2014-10-23 20:45:57.000000000","message":"I say you can spell it with a K if you want.  :)\n\nThis probably started with code that used \"klass\" as a variable name because \"class\" is a keyword.","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"9d00a22f7943f787d8555ace3f9695761a0ab903","unresolved":false,"context_lines":[{"line_number":34,"context_line":"DB_PLUGIN_KLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class DBTestFramework(base.BaseTestCase):"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def setUp(self):"},{"line_number":40,"context_line":"        super(DBTestFramework, self).setUp()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_c8ec8c92","line":37,"updated":"2014-10-01 15:18:33.000000000","message":"We are working on a framework for Integration tests for Kilo and we\u0027ll probably want to use this class (or something very similar to it). Can you move it to neutron.tests.base?\n\nIf so, a renaming might be in order (since DBTestFramework is not very indicative for something in neutron/tests/base.py)","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6d6006db4286a293c0b67c88a0e2ad0cb0f80fb","unresolved":false,"context_lines":[{"line_number":34,"context_line":"DB_PLUGIN_KLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class DBTestFramework(base.BaseTestCase):"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def setUp(self):"},{"line_number":40,"context_line":"        super(DBTestFramework, self).setUp()"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_ebedae26","line":37,"in_reply_to":"baa201ad_c8ec8c92","updated":"2014-10-02 15:34:28.000000000","message":"Not sure neutron.tests.base is the right place. I will move it to neutron.tests.functional.db.base","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"9d00a22f7943f787d8555ace3f9695761a0ab903","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":42,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":43,"context_line":"        # FIXME(rossella_s) this is a dirty hack to get the connection string"},{"line_number":44,"context_line":"        # a better way should be found"},{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_c8bacc6d","line":44,"updated":"2014-10-01 15:18:33.000000000","message":"Maybe use a regex to parse what you need from here? It will also make this code clearer (and fix the FIXME) :)","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6b18785c6443c2f51e8927b2fc5c04d10c9b2efe","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":42,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":43,"context_line":"        # FIXME(rossella_s) this is a dirty hack to get the connection string"},{"line_number":44,"context_line":"        # a better way should be found"},{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_ec4cb9a0","line":44,"in_reply_to":"baa201ad_0b111205","updated":"2014-10-05 12:35:26.000000000","message":"I think that a regex is always more understandable since it can easily be:\n \"(?P\u003cmysql_server\u003emysql://.*?)/neutron\"\n(not sure about the exact format).\n\nIf it bothers you that it has more lines, you can always extract it to a function (which I think you should do anyway).\n\nEither way (even if you don\u0027t want to do it with regex, which I\u0027m fine with since it\u0027s your code :)), I think that a comment should be added as to the format of the string you\u0027re expecting and to what it\u0027s changed.","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6d6006db4286a293c0b67c88a0e2ad0cb0f80fb","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":42,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":43,"context_line":"        # FIXME(rossella_s) this is a dirty hack to get the connection string"},{"line_number":44,"context_line":"        # a better way should be found"},{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_0b111205","line":44,"in_reply_to":"baa201ad_c8bacc6d","updated":"2014-10-02 15:34:28.000000000","message":"I put the FIXME there because I wanted to find a better way to get the connection string, instead of getting it from the config file. Probably it\u0027s not so bad and I can\u0027t think of a better way anyway. I thought about the regex, not sure it would make the code clearer, more lines are gonna be needed and regex are usually more complex to read then a \u0027split\u0027.","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"238fb77301e4d5f15b3440d32d33804df5f95bd4","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        self.test_db \u003d \u0027`neutron_test\u0027 + str(uuid.uuid4()) + \u0027`\u0027"},{"line_number":42,"context_line":"        original_conn_string \u003d cfg.CONF.database.connection"},{"line_number":43,"context_line":"        # FIXME(rossella_s) this is a dirty hack to get the connection string"},{"line_number":44,"context_line":"        # a better way should be found"},{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_206de6cc","line":44,"in_reply_to":"baa201ad_ec4cb9a0","updated":"2014-10-23 20:45:57.000000000","message":"+1 for a better way.  The regex IMO doesn\u0027t improve this code.","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"9d00a22f7943f787d8555ace3f9695761a0ab903","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"},{"line_number":48,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":49,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":50,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":51,"context_line":"        self.create_db(self.test_db)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_c839ec42","line":48,"updated":"2014-10-01 15:18:33.000000000","message":"Looking at the existing SqlTestCase code, I find these 2 classes very similar, so I think they should have the same structure (for readability). I put my thoughts into a pastebin so tell me what you think:\n\nhttp://pastebin.com/qWBtFaGF","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"238fb77301e4d5f15b3440d32d33804df5f95bd4","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"},{"line_number":48,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":49,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":50,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":51,"context_line":"        self.create_db(self.test_db)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9aa7fdbe_60b1ae46","line":48,"in_reply_to":"baa201ad_2c43216d","updated":"2014-10-23 20:45:57.000000000","message":"paste.openstack.org","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"6b18785c6443c2f51e8927b2fc5c04d10c9b2efe","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"},{"line_number":48,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":49,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":50,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":51,"context_line":"        self.create_db(self.test_db)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_2c43216d","line":48,"in_reply_to":"baa201ad_4b215a4c","updated":"2014-10-05 12:35:26.000000000","message":"When I looked at the code last week I did think there was an added value of it being more like SqlTestCase, but I guess the code is fine as it is so I\u0027m dropping this issue :)","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a6d6006db4286a293c0b67c88a0e2ad0cb0f80fb","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        test_conn_string \u003d original_conn_string.split(\u0027neutron\u0027)[0]"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027,"},{"line_number":47,"context_line":"                              test_conn_string,"},{"line_number":48,"context_line":"                              group\u003d\u0027database\u0027)"},{"line_number":49,"context_line":"        self.engine \u003d db_api.get_engine()"},{"line_number":50,"context_line":"        self.addCleanup(self.drop_db, self.test_db)"},{"line_number":51,"context_line":"        self.create_db(self.test_db)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa201ad_4b215a4c","line":48,"in_reply_to":"baa201ad_c839ec42","updated":"2014-10-02 15:34:28.000000000","message":"Sorry John I don\u0027t get your point. This test already has the same structure of SqlTestCase, a setup method where the resource are created and cleaups are added. What would be the benefit of your suggestion? What would move some lines into an init method bring? Thanks!","commit_id":"1b5e274a40a998b86df4b96a4e9fd623ead732ab"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from neutron.tests.functional.db import base"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":"DB_PLUGIN_CLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_5ec36737","line":31,"updated":"2014-10-27 18:52:11.000000000","message":"This doesn\u0027t appear to be used.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from neutron.tests.functional.db import base"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":"DB_PLUGIN_CLASS \u003d \u0027neutron.db.db_base_plugin_v2.NeutronDbPluginV2\u0027"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_5374ea98","line":31,"in_reply_to":"9aa7fdbe_5ec36737","updated":"2014-11-11 23:03:12.000000000","message":"removed","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":35,"context_line":"class IpamTestFramework(base.BaseDBTest):"},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(IpamTestFramework, self).setUp()"},{"line_number":38,"context_line":"        self.plugin \u003d importutils.import_object(DB_PLUGIN_CLASS)"},{"line_number":39,"context_line":"        self.cxt \u003d context.get_admin_context()"},{"line_number":40,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_7ebe6baf","line":38,"updated":"2014-10-27 18:52:11.000000000","message":"Why does this need to be imported dynamically?","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":35,"context_line":"class IpamTestFramework(base.BaseDBTest):"},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(IpamTestFramework, self).setUp()"},{"line_number":38,"context_line":"        self.plugin \u003d importutils.import_object(DB_PLUGIN_CLASS)"},{"line_number":39,"context_line":"        self.cxt \u003d context.get_admin_context()"},{"line_number":40,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_f2a067f6","line":38,"in_reply_to":"9aa7fdbe_7ebe6baf","updated":"2014-11-11 23:03:12.000000000","message":"Done","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        self.cxt \u003d context.get_admin_context()"},{"line_number":40,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def make_ip_alloc_dict(self, ip_allocs):"},{"line_number":43,"context_line":"        res \u003d []"},{"line_number":44,"context_line":"        for ip_alloc in ip_allocs:"},{"line_number":45,"context_line":"            a \u003d {\u0027port_id\u0027: ip_alloc[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_9e66af28","line":42,"updated":"2014-10-27 18:52:11.000000000","message":"The repetition in these methods suggests the following method:\n\n def resultset_to_dicts(self, resultset, keys):\n  dicts \u003d []\n  for item in resultset:\n    item_dict \u003d dict((x, item[x]) for x in keys) \n    dicts.append(item_dict)\n  return dicts\n\nAnd the corresponding assertion methods that use it:\n\n def assert_ip_alloc_matches(self, expected, resultset):\n  keys \u003d [\u0027port_id\u0027,..]\n  actual \u003d self.resultset_to_dicts(resultset, keys)\n  self.assertEqual(expected, actual)\n\nThis should make the assertions easier to read.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        self.cxt \u003d context.get_admin_context()"},{"line_number":40,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    def make_ip_alloc_dict(self, ip_allocs):"},{"line_number":43,"context_line":"        res \u003d []"},{"line_number":44,"context_line":"        for ip_alloc in ip_allocs:"},{"line_number":45,"context_line":"            a \u003d {\u0027port_id\u0027: ip_alloc[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_93f652d6","line":42,"in_reply_to":"9aa7fdbe_9e66af28","updated":"2014-11-11 23:03:12.000000000","message":"Done, thanks!","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":75,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"},{"line_number":76,"context_line":"        self.port_id \u003d \u0027test_p_id\u0027"},{"line_number":77,"context_line":"        self.addCleanup(self.delete_network, self.network_id)"},{"line_number":78,"context_line":"        self._create_network()"},{"line_number":79,"context_line":"        self._create_subnet()"},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_de11175e","line":77,"updated":"2014-10-27 18:52:11.000000000","message":"Manual deletion of db resources should be avoided.  Instead, rely on clearing all tables with SqlTestCase:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/tests/unit/testlib_api.py#L56\n\nIt may be desirable to move SqlTestCase to the neutron/tests path so that it is clear that it is reusable across unit and functional tests.\n\nTable wiping is a stop-gap btw - oslo.db is planning on supporting test isolation via transactions.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":75,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"},{"line_number":76,"context_line":"        self.port_id \u003d \u0027test_p_id\u0027"},{"line_number":77,"context_line":"        self.addCleanup(self.delete_network, self.network_id)"},{"line_number":78,"context_line":"        self._create_network()"},{"line_number":79,"context_line":"        self._create_subnet()"},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_b3034eb7","line":77,"in_reply_to":"9aa7fdbe_de11175e","updated":"2014-11-11 23:03:12.000000000","message":"There\u0027s no need of cleaning the tables, the DB is created and dropped for every test in oslo.db.sqlalchemy.OpportunisticFixture from which the test inherits","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                \u0027device_id\u0027: \u0027test_dev_id\u0027,"},{"line_number":117,"context_line":"                \u0027device_owner\u0027: \u0027compute\u0027,"},{"line_number":118,"context_line":"                \u0027fixed_ips\u0027: port_fixed_ips}"},{"line_number":119,"context_line":"        self.addCleanup(self.plugin.delete_port, self.cxt, port_id)"},{"line_number":120,"context_line":"        self.plugin.create_port(self.cxt, {\u0027port\u0027: port})"},{"line_number":121,"context_line":"        port_db \u003d self.plugin.get_port(self.cxt, port_id)"},{"line_number":122,"context_line":"        if fixed_ips is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_5e052712","line":119,"updated":"2014-10-27 18:52:11.000000000","message":"ditto","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":116,"context_line":"                \u0027device_id\u0027: \u0027test_dev_id\u0027,"},{"line_number":117,"context_line":"                \u0027device_owner\u0027: \u0027compute\u0027,"},{"line_number":118,"context_line":"                \u0027fixed_ips\u0027: port_fixed_ips}"},{"line_number":119,"context_line":"        self.addCleanup(self.plugin.delete_port, self.cxt, port_id)"},{"line_number":120,"context_line":"        self.plugin.create_port(self.cxt, {\u0027port\u0027: port})"},{"line_number":121,"context_line":"        port_db \u003d self.plugin.get_port(self.cxt, port_id)"},{"line_number":122,"context_line":"        if fixed_ips is None:"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_b3f18ecf","line":119,"in_reply_to":"9aa7fdbe_5e052712","updated":"2014-11-11 23:03:12.000000000","message":"as above","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            port[\u0027fixed_ips\u0027] \u003d port_db[\u0027fixed_ips\u0027]"},{"line_number":124,"context_line":"        self.assertEqual(port, port_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def delete_network(self, net_id):"},{"line_number":127,"context_line":"        self.plugin.delete_network(self.cxt, net_id)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def test_allocate_fixed_ip(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_1209d32b","line":126,"updated":"2014-10-27 18:52:11.000000000","message":"This method won\u0027t be necessary once cleanup via table wipe is performed.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            port[\u0027fixed_ips\u0027] \u003d port_db[\u0027fixed_ips\u0027]"},{"line_number":124,"context_line":"        self.assertEqual(port, port_db)"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def delete_network(self, net_id):"},{"line_number":127,"context_line":"        self.plugin.delete_network(self.cxt, net_id)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def test_allocate_fixed_ip(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_f3ba36e0","line":126,"in_reply_to":"9aa7fdbe_1209d32b","updated":"2014-11-11 23:03:12.000000000","message":"Done","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027first_ip\u0027: \u002710.10.10.2\u0027,"},{"line_number":142,"context_line":"                                   \u0027last_ip\u0027: \u002710.10.10.6\u0027,"},{"line_number":143,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":144,"context_line":"        ip_alloc_pool \u003d self.cxt.session.query("},{"line_number":145,"context_line":"            models_v2.IPAllocationPool).all()"},{"line_number":146,"context_line":"        ip_alloc \u003d self.cxt.session.query(models_v2.IPAllocation).all()"},{"line_number":147,"context_line":"        ip_avail_range \u003d self.cxt.session.query("}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_52443b49","line":144,"updated":"2014-10-27 18:52:11.000000000","message":"DRY (don\u0027t repeat yourself): It appears that the tests query for ip alloc, pool and range, and then compare against the expected.  Consider creating some helper methods that query and assert in a single call, taking the expected result (or count) as a parameter.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027first_ip\u0027: \u002710.10.10.2\u0027,"},{"line_number":142,"context_line":"                                   \u0027last_ip\u0027: \u002710.10.10.6\u0027,"},{"line_number":143,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":144,"context_line":"        ip_alloc_pool \u003d self.cxt.session.query("},{"line_number":145,"context_line":"            models_v2.IPAllocationPool).all()"},{"line_number":146,"context_line":"        ip_alloc \u003d self.cxt.session.query(models_v2.IPAllocation).all()"},{"line_number":147,"context_line":"        ip_avail_range \u003d self.cxt.session.query("}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_13c0a24f","line":144,"in_reply_to":"9aa7fdbe_52443b49","updated":"2014-11-11 23:03:12.000000000","message":"Thanks for the suggestion, done!","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        ip_avail_range \u003d self.cxt.session.query("},{"line_number":233,"context_line":"            models_v2.IPAvailabilityRange).all()"},{"line_number":234,"context_line":"        self.assertEqual(5,"},{"line_number":235,"context_line":"                         len(self.make_ip_alloc_dict(ip_alloc)))"},{"line_number":236,"context_line":"        self.assertEqual(ip_avail_ranges_expected,"},{"line_number":237,"context_line":"                         self.make_ip_avail_range_dict(ip_avail_range))"},{"line_number":238,"context_line":"        self.assertEqual(ip_alloc_pool_expected,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_b28ac761","line":235,"updated":"2014-10-27 18:52:11.000000000","message":"Is it necessary to convert the resultset into a dict to count it?","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        ip_avail_range \u003d self.cxt.session.query("},{"line_number":233,"context_line":"            models_v2.IPAvailabilityRange).all()"},{"line_number":234,"context_line":"        self.assertEqual(5,"},{"line_number":235,"context_line":"                         len(self.make_ip_alloc_dict(ip_alloc)))"},{"line_number":236,"context_line":"        self.assertEqual(ip_avail_ranges_expected,"},{"line_number":237,"context_line":"                         self.make_ip_avail_range_dict(ip_avail_range))"},{"line_number":238,"context_line":"        self.assertEqual(ip_alloc_pool_expected,"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_37bca169","line":235,"in_reply_to":"9aa7fdbe_b28ac761","updated":"2014-11-11 23:03:12.000000000","message":"Done","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f438f01d3d8c5fba4ed52f8174e73d773904d1aa","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            for i in range(1, 3):"},{"line_number":306,"context_line":"                self.plugin.delete_port(self.cxt, self.port_id + str(i))"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        eventlet.spawn(delete_two_ports).wait()"},{"line_number":309,"context_line":"        # Create another port concurrently, this will trigger the"},{"line_number":310,"context_line":"        # rebuilding of the availability ranges"},{"line_number":311,"context_line":"        eventlet.spawn(self._create_port, self.port_id).wait()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_325b37f7","line":308,"updated":"2014-10-27 18:52:11.000000000","message":"I\u0027m not sure that this test as written provides any guarantee of simulating the kind of concurrency we\u0027re likely to see in production.  It would be helpful to me if you would explain your reasoning behind this approach to help me understand.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"05f42c53232c1994412d646bba59cb8d5e102dae","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            for i in range(1, 3):"},{"line_number":306,"context_line":"                self.plugin.delete_port(self.cxt, self.port_id + str(i))"},{"line_number":307,"context_line":""},{"line_number":308,"context_line":"        eventlet.spawn(delete_two_ports).wait()"},{"line_number":309,"context_line":"        # Create another port concurrently, this will trigger the"},{"line_number":310,"context_line":"        # rebuilding of the availability ranges"},{"line_number":311,"context_line":"        eventlet.spawn(self._create_port, self.port_id).wait()"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a890539_92e72340","line":308,"in_reply_to":"9aa7fdbe_325b37f7","updated":"2014-11-11 23:03:12.000000000","message":"Looking at is now, it doesn\u0027t make much sense to me. I modified this part of the test, now the port deletions are executed by the test main thread and the port create of line 311 in a thread spawn by eventlet. If you have any other suggestion to provide more guarantee for concurrency please let me know.","commit_id":"a170f1cfd1c9792efa945a9067788de31e695666"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"b589c0317b5e4a1a9c41f33c3062123e034596b5","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        p2_fixed_ip \u003d [{\u0027ip_address\u0027: \"10.10.10.5\","},{"line_number":187,"context_line":"                        \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":188,"context_line":"        self.port2_id \u003d \u0027test_p_id_2\u0027"},{"line_number":189,"context_line":"        self._create_port(self.port_id, p1_fixed_ip)"},{"line_number":190,"context_line":"        eventlet.spawn("},{"line_number":191,"context_line":"            self._create_port, self.port2_id, p2_fixed_ip).wait()"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"3a961159_3007071f","line":189,"updated":"2014-12-18 19:08:15.000000000","message":"where is the concurrency? I guess the idea is to create 2 ports about the same time? But L189 will block, so won\u0027t port1 be created before L190 begins?","commit_id":"32d7288f2accdf0ac39127d7f28b75e873d55fbb"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"696f8b43d62e1de9a1cbf761100f36521d22ccbe","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        p2_fixed_ip \u003d [{\u0027ip_address\u0027: \"10.10.10.5\","},{"line_number":187,"context_line":"                        \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":188,"context_line":"        self.port2_id \u003d \u0027test_p_id_2\u0027"},{"line_number":189,"context_line":"        self._create_port(self.port_id, p1_fixed_ip)"},{"line_number":190,"context_line":"        eventlet.spawn("},{"line_number":191,"context_line":"            self._create_port, self.port2_id, p2_fixed_ip).wait()"},{"line_number":192,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"3a961159_44f11900","line":189,"in_reply_to":"3a961159_3007071f","updated":"2014-12-19 16:38:48.000000000","message":"Good point, I am removing the concurrent tests, looking at them now, I don\u0027t think they have much value","commit_id":"32d7288f2accdf0ac39127d7f28b75e873d55fbb"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"287ee92eabed3f1df271a51e4bcaca84d58b8b17","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from neutron.api.v2 import attributes"},{"line_number":23,"context_line":"from neutron.common import constants"},{"line_number":24,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":25,"context_line":"from neutron import context"},{"line_number":26,"context_line":"from neutron.db import db_base_plugin_v2 as base_plugin"},{"line_number":27,"context_line":"from neutron.db import model_base"},{"line_number":28,"context_line":"from neutron.db import models_v2"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_f731b2a2","line":25,"updated":"2014-12-22 14:59:01.000000000","message":"is this in the right order?","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"de1a436112e49cce094dd4225f64fc1a05258806","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from neutron.api.v2 import attributes"},{"line_number":23,"context_line":"from neutron.common import constants"},{"line_number":24,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":25,"context_line":"from neutron import context"},{"line_number":26,"context_line":"from neutron.db import db_base_plugin_v2 as base_plugin"},{"line_number":27,"context_line":"from neutron.db import model_base"},{"line_number":28,"context_line":"from neutron.db import models_v2"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_661c1d14","line":25,"in_reply_to":"3a961159_da9cddc2","updated":"2015-01-08 08:42:45.000000000","message":"sorry - this is ok - I just read the hacking doc. It just looked a bit funny at first glance.","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"82b7b4d324f88c6113acada0b7b78b77b1582159","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from neutron.api.v2 import attributes"},{"line_number":23,"context_line":"from neutron.common import constants"},{"line_number":24,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":25,"context_line":"from neutron import context"},{"line_number":26,"context_line":"from neutron.db import db_base_plugin_v2 as base_plugin"},{"line_number":27,"context_line":"from neutron.db import model_base"},{"line_number":28,"context_line":"from neutron.db import models_v2"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_da9cddc2","line":25,"in_reply_to":"3a961159_f731b2a2","updated":"2015-01-07 15:06:39.000000000","message":"I think so, what\u0027s wrong?","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"287ee92eabed3f1df271a51e4bcaca84d58b8b17","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                          load_admin_roles\u003dload_admin_roles,"},{"line_number":42,"context_line":"                          overwrite\u003dFalse)"},{"line_number":43,"context_line":"    facade \u003d session.EngineFacade(db_url, mysql_sql_mode\u003d\u0027STRICT_ALL_TABLES\u0027)"},{"line_number":44,"context_line":"    ctx._session \u003d facade.get_session("},{"line_number":45,"context_line":"        autocommit\u003dFalse, expire_on_commit\u003dTrue)"},{"line_number":46,"context_line":"    return ctx"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_f7bff2cd","line":44,"updated":"2014-12-22 14:59:01.000000000","message":"I think this will fit on one line","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"82b7b4d324f88c6113acada0b7b78b77b1582159","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                          load_admin_roles\u003dload_admin_roles,"},{"line_number":42,"context_line":"                          overwrite\u003dFalse)"},{"line_number":43,"context_line":"    facade \u003d session.EngineFacade(db_url, mysql_sql_mode\u003d\u0027STRICT_ALL_TABLES\u0027)"},{"line_number":44,"context_line":"    ctx._session \u003d facade.get_session("},{"line_number":45,"context_line":"        autocommit\u003dFalse, expire_on_commit\u003dTrue)"},{"line_number":46,"context_line":"    return ctx"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_ba43913d","line":44,"in_reply_to":"3a961159_f7bff2cd","updated":"2015-01-07 15:06:39.000000000","message":"yep","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"287ee92eabed3f1df271a51e4bcaca84d58b8b17","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                \u0027name\u0027: \u0027test_port\u0027,"},{"line_number":131,"context_line":"                \u0027id\u0027: port_id,"},{"line_number":132,"context_line":"                \u0027network_id\u0027: self.network_id,"},{"line_number":133,"context_line":"                \u0027mac_address\u0027: \u0027%d.02.01.00.%d\u0027 % (random.randint(10, 99),"},{"line_number":134,"context_line":"                                                   random.randint(10, 99)),"},{"line_number":135,"context_line":"                \u0027admin_state_up\u0027: True,"},{"line_number":136,"context_line":"                \u0027status\u0027: constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_d7a3d6af","line":133,"updated":"2014-12-22 14:59:01.000000000","message":"why not use attributes.ATTR_NOT_SPECIFIED here and let the plugin generate unique random macs as usual?","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"82b7b4d324f88c6113acada0b7b78b77b1582159","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                \u0027name\u0027: \u0027test_port\u0027,"},{"line_number":131,"context_line":"                \u0027id\u0027: port_id,"},{"line_number":132,"context_line":"                \u0027network_id\u0027: self.network_id,"},{"line_number":133,"context_line":"                \u0027mac_address\u0027: \u0027%d.02.01.00.%d\u0027 % (random.randint(10, 99),"},{"line_number":134,"context_line":"                                                   random.randint(10, 99)),"},{"line_number":135,"context_line":"                \u0027admin_state_up\u0027: True,"},{"line_number":136,"context_line":"                \u0027status\u0027: constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_5a4c6d42","line":133,"in_reply_to":"3a961159_d7a3d6af","updated":"2015-01-07 15:06:39.000000000","message":"good catch, thanks!","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"287ee92eabed3f1df271a51e4bcaca84d58b8b17","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        port_db \u003d self.plugin.get_port(self.cxt, port_id)"},{"line_number":142,"context_line":"        if fixed_ips is None:"},{"line_number":143,"context_line":"            port[\u0027fixed_ips\u0027] \u003d port_db[\u0027fixed_ips\u0027]"},{"line_number":144,"context_line":"        self.assertEqual(port, port_db)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def test_allocate_fixed_ip(self):"},{"line_number":147,"context_line":"        fixed_ip \u003d [{\u0027ip_address\u0027: \"10.10.10.3\", \u0027subnet_id\u0027: self.subnet_id}]"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_17af1e7e","line":144,"updated":"2014-12-22 14:59:01.000000000","message":"what is the purpose L141-144? Looks like a test, so I think it should be separated out from this helper so it is only called once and not every time a port is created.","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"82b7b4d324f88c6113acada0b7b78b77b1582159","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        port_db \u003d self.plugin.get_port(self.cxt, port_id)"},{"line_number":142,"context_line":"        if fixed_ips is None:"},{"line_number":143,"context_line":"            port[\u0027fixed_ips\u0027] \u003d port_db[\u0027fixed_ips\u0027]"},{"line_number":144,"context_line":"        self.assertEqual(port, port_db)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def test_allocate_fixed_ip(self):"},{"line_number":147,"context_line":"        fixed_ip \u003d [{\u0027ip_address\u0027: \"10.10.10.3\", \u0027subnet_id\u0027: self.subnet_id}]"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_fa6279ab","line":144,"in_reply_to":"3a961159_17af1e7e","updated":"2015-01-07 15:06:39.000000000","message":"This should be tested every time a port is created to make sure that the port data are stored correctly in the DB","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"530b67806875deb2b87bd5181d3b62cf18707990","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        port_db \u003d self.plugin.get_port(self.cxt, port_id)"},{"line_number":142,"context_line":"        if fixed_ips is None:"},{"line_number":143,"context_line":"            port[\u0027fixed_ips\u0027] \u003d port_db[\u0027fixed_ips\u0027]"},{"line_number":144,"context_line":"        self.assertEqual(port, port_db)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def test_allocate_fixed_ip(self):"},{"line_number":147,"context_line":"        fixed_ip \u003d [{\u0027ip_address\u0027: \"10.10.10.3\", \u0027subnet_id\u0027: self.subnet_id}]"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a961159_9b3885a1","line":144,"in_reply_to":"3a961159_fa6279ab","updated":"2015-01-08 04:39:08.000000000","message":"I don\u0027t think this is the place to validate port creation, though.  The intent is to validate ipam, and we can leave port creation validation to the tests that specifically target it and with more rigor than is exercised here.","commit_id":"bccd576932ec0599e235498bc243e27657c91582"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"67595597570dbe813356dd03a793b54f59c3c0ca","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from neutron.tests import base"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def get_admin_test_context(db_url, read_deleted\u003d\"no\", load_admin_roles\u003dTrue):"},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    get_admin_test_context is used to provide a test context. A new session is"},{"line_number":33,"context_line":"    created using the db url specified"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_bd462ba5","line":30,"updated":"2015-01-07 15:55:32.000000000","message":"consider adding a _ as this is a private method","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5d3367f475cee65480cdc5e240ea65bfad7626b6","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from neutron.tests import base"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def get_admin_test_context(db_url, read_deleted\u003d\"no\", load_admin_roles\u003dTrue):"},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    get_admin_test_context is used to provide a test context. A new session is"},{"line_number":33,"context_line":"    created using the db url specified"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_10487289","line":30,"in_reply_to":"3a961159_4e590ffc","updated":"2015-01-13 16:22:36.000000000","message":"Thanks, done!","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"fd48d61564220f9d9cfe53016ba4075181700564","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from neutron.tests import base"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"def get_admin_test_context(db_url, read_deleted\u003d\"no\", load_admin_roles\u003dTrue):"},{"line_number":31,"context_line":"    \"\"\""},{"line_number":32,"context_line":"    get_admin_test_context is used to provide a test context. A new session is"},{"line_number":33,"context_line":"    created using the db url specified"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_4e590ffc","line":30,"in_reply_to":"3a961159_bd462ba5","updated":"2015-01-08 04:36:32.000000000","message":"I\u0027m not sure I see the point of worrying about scope in a test module.\n\nSeparately, on the principle of YAGNI, given that the single call of this method doesn\u0027t modify the optional parameters (read_deleted and load_admin_roles), consider removing them from the parameter list and hard-coding the defaults below.","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"67595597570dbe813356dd03a793b54f59c3c0ca","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        self._create_network()"},{"line_number":61,"context_line":"        self._create_subnet()"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def resultset_to_dicts(self, resultset, keys):"},{"line_number":64,"context_line":"        dicts \u003d []"},{"line_number":65,"context_line":"        for item in resultset:"},{"line_number":66,"context_line":"            item_dict \u003d dict((x, item[x]) for x in keys)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_ddef7785","line":63,"updated":"2015-01-07 15:55:32.000000000","message":"consider using underscores here too","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d20b7ba76dcc42539c7823b46d425ee0f743ac43","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        self._create_network()"},{"line_number":61,"context_line":"        self._create_subnet()"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def resultset_to_dicts(self, resultset, keys):"},{"line_number":64,"context_line":"        dicts \u003d []"},{"line_number":65,"context_line":"        for item in resultset:"},{"line_number":66,"context_line":"            item_dict \u003d dict((x, item[x]) for x in keys)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_0656f9cd","line":63,"updated":"2015-01-08 08:37:40.000000000","message":"re_u_lse_t_ :)","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"fd48d61564220f9d9cfe53016ba4075181700564","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        self._create_network()"},{"line_number":61,"context_line":"        self._create_subnet()"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    def resultset_to_dicts(self, resultset, keys):"},{"line_number":64,"context_line":"        dicts \u003d []"},{"line_number":65,"context_line":"        for item in resultset:"},{"line_number":66,"context_line":"            item_dict \u003d dict((x, item[x]) for x in keys)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_6ef96b7f","line":63,"in_reply_to":"3a961159_ddef7785","updated":"2015-01-08 04:36:32.000000000","message":"I\u0027m assuming you mean resultset -\u003e result_set?","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"fd48d61564220f9d9cfe53016ba4075181700564","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            dicts.append(item_dict)"},{"line_number":68,"context_line":"        return dicts"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def assert_ip_alloc_matches(self, expected, resultset):"},{"line_number":71,"context_line":"        keys \u003d [\u0027port_id\u0027, \u0027ip_address\u0027, \u0027subnet_id\u0027, \u0027network_id\u0027]"},{"line_number":72,"context_line":"        actual \u003d self.resultset_to_dicts(resultset, keys)"},{"line_number":73,"context_line":"        self.assertEqual(expected, actual)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_496f49c4","line":70,"updated":"2015-01-08 04:36:32.000000000","message":"(No action required) If you define the expected result as an OrderedDict, you can can reuse the keys rather than having to redefine them:\n\nkeys \u003d expected[0].keys()\n\nOrderedDict compares fine to a normal dict, so the assertions would continue to work.","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"d20b7ba76dcc42539c7823b46d425ee0f743ac43","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            dicts.append(item_dict)"},{"line_number":68,"context_line":"        return dicts"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def assert_ip_alloc_matches(self, expected, resultset):"},{"line_number":71,"context_line":"        keys \u003d [\u0027port_id\u0027, \u0027ip_address\u0027, \u0027subnet_id\u0027, \u0027network_id\u0027]"},{"line_number":72,"context_line":"        actual \u003d self.resultset_to_dicts(resultset, keys)"},{"line_number":73,"context_line":"        self.assertEqual(expected, actual)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_265935fd","line":70,"updated":"2015-01-08 08:37:40.000000000","message":"If you did that, it wouldn\u0027t catch missing fields though, right?","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5fda403828f432ba8644455923097870d35688da","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            dicts.append(item_dict)"},{"line_number":68,"context_line":"        return dicts"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def assert_ip_alloc_matches(self, expected, resultset):"},{"line_number":71,"context_line":"        keys \u003d [\u0027port_id\u0027, \u0027ip_address\u0027, \u0027subnet_id\u0027, \u0027network_id\u0027]"},{"line_number":72,"context_line":"        actual \u003d self.resultset_to_dicts(resultset, keys)"},{"line_number":73,"context_line":"        self.assertEqual(expected, actual)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_e182b0fd","line":70,"in_reply_to":"3a961159_265935fd","updated":"2015-01-08 14:33:13.000000000","message":"I\u0027m not sure I follow, can you provide more detail as to the problem you\u0027re imagining?","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5d3367f475cee65480cdc5e240ea65bfad7626b6","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            dicts.append(item_dict)"},{"line_number":68,"context_line":"        return dicts"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def assert_ip_alloc_matches(self, expected, resultset):"},{"line_number":71,"context_line":"        keys \u003d [\u0027port_id\u0027, \u0027ip_address\u0027, \u0027subnet_id\u0027, \u0027network_id\u0027]"},{"line_number":72,"context_line":"        actual \u003d self.resultset_to_dicts(resultset, keys)"},{"line_number":73,"context_line":"        self.assertEqual(expected, actual)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_cb5f1f0e","line":70,"in_reply_to":"3a961159_e182b0fd","updated":"2015-01-13 16:22:36.000000000","message":"waiting for Kevin\u0027s reply to address this comment","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"fd48d61564220f9d9cfe53016ba4075181700564","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        actual \u003d self.resultset_to_dicts(resultset, keys)"},{"line_number":83,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def query_db_and_assert_ip_alloc_matches(self, expected):"},{"line_number":86,"context_line":"        ip_alloc \u003d self.cxt.session.query(models_v2.IPAllocation).all()"},{"line_number":87,"context_line":"        self.assert_ip_alloc_matches(expected, ip_alloc)"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_29f11d01","line":85,"updated":"2015-01-08 04:36:32.000000000","message":"(No action required) Consider performing the assertion inline and renaming the methods to be simply assert_* rather than query_db_and_assert_*.  It would be less code and simpler to read.","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5d3367f475cee65480cdc5e240ea65bfad7626b6","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        actual \u003d self.resultset_to_dicts(resultset, keys)"},{"line_number":83,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def query_db_and_assert_ip_alloc_matches(self, expected):"},{"line_number":86,"context_line":"        ip_alloc \u003d self.cxt.session.query(models_v2.IPAllocation).all()"},{"line_number":87,"context_line":"        self.assert_ip_alloc_matches(expected, ip_alloc)"},{"line_number":88,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_8b7437d1","line":85,"in_reply_to":"3a961159_29f11d01","updated":"2015-01-13 16:22:36.000000000","message":"Thank, done!","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"fd48d61564220f9d9cfe53016ba4075181700564","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            models_v2.IPAllocationPool).all()"},{"line_number":97,"context_line":"        self.assert_ip_alloc_pool_matches(expected, ip_alloc_pool)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _create_network(self):"},{"line_number":100,"context_line":"        network \u003d {\u0027tenant_id\u0027: self.tenant_id,"},{"line_number":101,"context_line":"                   \u0027id\u0027: self.network_id,"},{"line_number":102,"context_line":"                   \u0027name\u0027: \u0027test-net\u0027,"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_3bab11d7","line":99,"updated":"2015-01-08 04:36:32.000000000","message":"(No action required) DRY: We already have helper methods on the unit test side of things - is there a reason not to factor them out for reuse by both test suites?","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5d3367f475cee65480cdc5e240ea65bfad7626b6","unresolved":false,"context_lines":[{"line_number":96,"context_line":"            models_v2.IPAllocationPool).all()"},{"line_number":97,"context_line":"        self.assert_ip_alloc_pool_matches(expected, ip_alloc_pool)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _create_network(self):"},{"line_number":100,"context_line":"        network \u003d {\u0027tenant_id\u0027: self.tenant_id,"},{"line_number":101,"context_line":"                   \u0027id\u0027: self.network_id,"},{"line_number":102,"context_line":"                   \u0027name\u0027: \u0027test-net\u0027,"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_2b198387","line":99,"in_reply_to":"3a961159_3bab11d7","updated":"2015-01-13 16:22:36.000000000","message":"I imagine you are referring to the unit test in test_db_plugin , all the helpers method there perform the operations using the api, I wanted to be able to test the code that writes in the DB directly.","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5d3367f475cee65480cdc5e240ea65bfad7626b6","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        self.plugin.create_port(self.cxt, {\u0027port\u0027: port})"},{"line_number":137,"context_line":"        port_db \u003d self.plugin.get_port(self.cxt, port_id)"},{"line_number":138,"context_line":"        if fixed_ips is None:"},{"line_number":139,"context_line":"            port[\u0027fixed_ips\u0027] \u003d port_db[\u0027fixed_ips\u0027]"},{"line_number":140,"context_line":"        self.assertEqual(port, port_db)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"    def test_allocate_fixed_ip(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_ac23c604","line":139,"updated":"2015-01-13 16:22:36.000000000","message":"the test were failing because of this line, port_db is a persistent object, assigning it to port[\u0027fixed_ips\u0027] makes port[\u0027fixed_ips\u0027]  pending, see http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html#merge-tips","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"fd48d61564220f9d9cfe53016ba4075181700564","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        self.query_db_and_assert_ip_avail_range_matches("},{"line_number":189,"context_line":"            ip_avail_ranges_expected)"},{"line_number":190,"context_line":"        # Create another port"},{"line_number":191,"context_line":"        self.assertRaises(n_exc.IpAddressGenerationFailure,"},{"line_number":192,"context_line":"                          self._create_port, self.port_id)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def test_rebuild_availability_range(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_5b8d3d7b","line":191,"updated":"2015-01-08 04:36:32.000000000","message":"(No action required) Consider preferring the following form of this assertion:\n\nwith testtools.ExpectedException(n_exc.IpAddressGenerationFailure):\n self._create_port(self.port_id)","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5d3367f475cee65480cdc5e240ea65bfad7626b6","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        self.query_db_and_assert_ip_avail_range_matches("},{"line_number":189,"context_line":"            ip_avail_ranges_expected)"},{"line_number":190,"context_line":"        # Create another port"},{"line_number":191,"context_line":"        self.assertRaises(n_exc.IpAddressGenerationFailure,"},{"line_number":192,"context_line":"                          self._create_port, self.port_id)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def test_rebuild_availability_range(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_dd39a2d0","line":191,"in_reply_to":"3a961159_5b8d3d7b","updated":"2015-01-13 16:22:36.000000000","message":"Thanks!","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"fd48d61564220f9d9cfe53016ba4075181700564","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            ip_avail_ranges_expected)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"class TestIpamMySql(test_base.MySQLOpportunisticTestCase, base.BaseTestCase,"},{"line_number":222,"context_line":"                    IpamTestCase):"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_6ee88be2","line":221,"updated":"2015-01-08 04:36:32.000000000","message":"(No action required) We really don\u0027t want to be using the *OpportunisticTestCases for much longer, since they would skip rather than fail if there was a problem with the functional job\u0027s db configuration.\n\nAlso, mixins are problematic - see the mess we have around plugins for an example of why we don\u0027t want to do this.  I\u0027d much rather see an approach that uses testscenarios to parametize the testing.  That said, so long as we don\u0027t have an alternative to the current oslo_db infrastructure, I\u0027m willing to accept the approach you\u0027ve chosen.","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"ec44f80626d2765ce0e221362caf17e26c94edc0","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            ip_avail_ranges_expected)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"class TestIpamMySql(test_base.MySQLOpportunisticTestCase, base.BaseTestCase,"},{"line_number":222,"context_line":"                    IpamTestCase):"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_14c71c99","line":221,"in_reply_to":"3a961159_2344e3b6","updated":"2015-01-15 21:27:24.000000000","message":"https://bugs.launchpad.net/oslo.db/+bug/1404093","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"5d3367f475cee65480cdc5e240ea65bfad7626b6","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            ip_avail_ranges_expected)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"class TestIpamMySql(test_base.MySQLOpportunisticTestCase, base.BaseTestCase,"},{"line_number":222,"context_line":"                    IpamTestCase):"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_7d97ce3a","line":221,"in_reply_to":"3a961159_6ee88be2","updated":"2015-01-13 16:22:36.000000000","message":"We could submit a patch to oslo_db to make the *OpportunisticTestCases fail instead of skipping when the db is no proper configured. \nI hate mixins too, testscenarios is probably a good idea, I should look into it but I\u0027d like to get these tests in, then we can always improve them :)","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"44526e1ed2137393ae29a2344ecf7d988ba395f7","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            ip_avail_ranges_expected)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"class TestIpamMySql(test_base.MySQLOpportunisticTestCase, base.BaseTestCase,"},{"line_number":222,"context_line":"                    IpamTestCase):"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def setUp(self):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a961159_2344e3b6","line":221,"in_reply_to":"3a961159_7d97ce3a","updated":"2015-01-15 20:52:39.000000000","message":"+1 to this","commit_id":"c2f1bb27a7054f3ebe4e9ce5cf25ce4a4ab09a25"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"64b5dec0256d2d66e2e95c65c7881d1b9e53d6df","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 SUSE Linux Products GmbH"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":22,"id":"3a961159_a172d3ad","line":1,"updated":"2015-01-14 09:21:53.000000000","message":"2015 :)","commit_id":"7c78fc430d3440b0657797d3cd04d09e1a04592b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"9a91291a48ae4e40aaaae98874a71dbbcdd43616","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 SUSE Linux Products GmbH"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":22,"id":"3a961159_818cf7d8","line":1,"in_reply_to":"3a961159_a172d3ad","updated":"2015-01-14 09:52:59.000000000","message":"oh yes...new year, I have already submitted another patch set, I missed your comments unfortunately. I will address this if I have to submit another patch set, thanks!","commit_id":"7c78fc430d3440b0657797d3cd04d09e1a04592b"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"64b5dec0256d2d66e2e95c65c7881d1b9e53d6df","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        self.assert_ip_avail_range_matches("},{"line_number":175,"context_line":"            ip_avail_ranges_expected)"},{"line_number":176,"context_line":"        # Create another port"},{"line_number":177,"context_line":"        with testtools.ExpectedException(n_exc.IpAddressGenerationFailure):"},{"line_number":178,"context_line":"            self._create_port(self.port_id)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def test_rebuild_availability_range(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"3a961159_413a0fc5","line":177,"updated":"2015-01-14 09:21:53.000000000","message":"Seems that resolving comment for previous patch set you forgot to import testtools.","commit_id":"7c78fc430d3440b0657797d3cd04d09e1a04592b"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"9a91291a48ae4e40aaaae98874a71dbbcdd43616","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        self.assert_ip_avail_range_matches("},{"line_number":175,"context_line":"            ip_avail_ranges_expected)"},{"line_number":176,"context_line":"        # Create another port"},{"line_number":177,"context_line":"        with testtools.ExpectedException(n_exc.IpAddressGenerationFailure):"},{"line_number":178,"context_line":"            self._create_port(self.port_id)"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def test_rebuild_availability_range(self):"}],"source_content_type":"text/x-python","patch_set":22,"id":"3a961159_01eac773","line":177,"in_reply_to":"3a961159_413a0fc5","updated":"2015-01-14 09:52:59.000000000","message":"indeed! I forget too many things :)","commit_id":"7c78fc430d3440b0657797d3cd04d09e1a04592b"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"8df867adfd613d9e2c285d52a2681ea411f4a3c3","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        model_base.BASEV2.metadata.create_all(self.engine)"},{"line_number":54,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":55,"context_line":"        self.plugin \u003d base_plugin.NeutronDbPluginV2()"},{"line_number":56,"context_line":"        self.cxt \u003d get_admin_test_context(self.engine.url)"},{"line_number":57,"context_line":"        self.tenant_id \u003d \u0027test_tenant\u0027"},{"line_number":58,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":59,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_f4bff05d","line":56,"updated":"2015-01-15 22:05:50.000000000","message":"Here you can add:\n\n        self.addCleanup(self.cxt._session.close)\n\nthen you don\u0027t need tearDown methods in the test classes below.","commit_id":"0e880364e19608acf55b4db2adef69b7145ba78c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"6455baf3b4fc86d2a9e41e68dd99656206806767","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        model_base.BASEV2.metadata.create_all(self.engine)"},{"line_number":54,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":55,"context_line":"        self.plugin \u003d base_plugin.NeutronDbPluginV2()"},{"line_number":56,"context_line":"        self.cxt \u003d get_admin_test_context(self.engine.url)"},{"line_number":57,"context_line":"        self.tenant_id \u003d \u0027test_tenant\u0027"},{"line_number":58,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":59,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_24d75bef","line":56,"in_reply_to":"3a961159_f4bff05d","updated":"2015-01-17 11:09:56.000000000","message":"Thanks, done!","commit_id":"0e880364e19608acf55b4db2adef69b7145ba78c"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"bca5b2909df227e61c23b76cd31e7692b91373ed","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def assert_ip_alloc_matches(self, expected):"},{"line_number":72,"context_line":"        result_set \u003d self.cxt.session.query(models_v2.IPAllocation).all()"},{"line_number":73,"context_line":"        keys \u003d [\u0027port_id\u0027, \u0027ip_address\u0027, \u0027subnet_id\u0027, \u0027network_id\u0027]"},{"line_number":74,"context_line":"        actual \u003d self.result_set_to_dicts(result_set, keys)"},{"line_number":75,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_a368d3f4","line":73,"updated":"2015-01-15 20:56:19.000000000","message":"(No action required) As per my previous comment, consider making the \u0027expected\u0027 parameter an instance of collections.OrderedDict to allow reusing keys instead of having to define them here, e.g.\n\nkeys \u003d expected[0].keys()\n\nThe expected dict and the actual dict have to have the same keys, so I can\u0027t foresee any problem with this approach despite Kevin\u0027s previous comment.","commit_id":"0e880364e19608acf55b4db2adef69b7145ba78c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"6455baf3b4fc86d2a9e41e68dd99656206806767","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def assert_ip_alloc_matches(self, expected):"},{"line_number":72,"context_line":"        result_set \u003d self.cxt.session.query(models_v2.IPAllocation).all()"},{"line_number":73,"context_line":"        keys \u003d [\u0027port_id\u0027, \u0027ip_address\u0027, \u0027subnet_id\u0027, \u0027network_id\u0027]"},{"line_number":74,"context_line":"        actual \u003d self.result_set_to_dicts(result_set, keys)"},{"line_number":75,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":76,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_44d2a7fd","line":73,"in_reply_to":"3a961159_a368d3f4","updated":"2015-01-17 11:09:56.000000000","message":"Thanks, done!","commit_id":"0e880364e19608acf55b4db2adef69b7145ba78c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"54e4be86ca88aef7b56864e844383bdf5c632204","unresolved":false,"context_lines":[{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def setUp(self):"},{"line_number":212,"context_line":"        super(TestIpamMySql, self).setUp()"},{"line_number":213,"context_line":"        super(TestIpamMySql, self).configure_test()"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def tearDown(self):"},{"line_number":216,"context_line":"        self.cxt._session.close()"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_3457ad5b","line":213,"updated":"2015-01-16 05:35:59.000000000","message":"nit:  Don\u0027t need super.","commit_id":"0e880364e19608acf55b4db2adef69b7145ba78c"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"6455baf3b4fc86d2a9e41e68dd99656206806767","unresolved":false,"context_lines":[{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def setUp(self):"},{"line_number":212,"context_line":"        super(TestIpamMySql, self).setUp()"},{"line_number":213,"context_line":"        super(TestIpamMySql, self).configure_test()"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"    def tearDown(self):"},{"line_number":216,"context_line":"        self.cxt._session.close()"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a961159_6404037e","line":213,"in_reply_to":"3a961159_3457ad5b","updated":"2015-01-17 11:09:56.000000000","message":"Thanks, done!","commit_id":"0e880364e19608acf55b4db2adef69b7145ba78c"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"3b60463f4b60e9bbe1b4ed4e6a7af2410faf94df","unresolved":false,"context_lines":[{"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":""},{"line_number":16,"context_line":"from collections import OrderedDict"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":"from oslo.db.sqlalchemy import session"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_28bd4604","line":16,"updated":"2015-01-19 23:16:21.000000000","message":"This import violates the rule that we\u0027re only supposed to import modules (except in specified special cases).\n\nReference: http://docs.openstack.org/developer/hacking/","commit_id":"c681ce859f4a8ab4156b2f957b89b8bcd544d755"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"3b60463f4b60e9bbe1b4ed4e6a7af2410faf94df","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    def assert_ip_avail_range_matches(self, expected):"},{"line_number":81,"context_line":"        result_set \u003d self.cxt.session.query("},{"line_number":82,"context_line":"            models_v2.IPAvailabilityRange).all()"},{"line_number":83,"context_line":"        keys \u003d expected[0].keys() if expected else None"},{"line_number":84,"context_line":"        actual \u003d self.result_set_to_dicts(result_set, keys)"},{"line_number":85,"context_line":"        self.assertEqual(expected, actual)"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"3a961159_88847a0f","line":83,"updated":"2015-01-19 23:16:21.000000000","message":"If expected is [] but result_set has rows, a value of None will result in a TypeError on line 70.  A value of [] is suggested instead to ensure that the assertion on line 85 can be violated instead.","commit_id":"c681ce859f4a8ab4156b2f957b89b8bcd544d755"}],"neutron/tests/unit/db/test_ipam.py":[{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"db36871b8ecb5583bdfc1b4ec44f62a437fcb9b5","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import models_v2"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class IpamTestCase(test_base.MySQLOpportunisticTestCase):"},{"line_number":33,"context_line":"    def setUp(self):"},{"line_number":34,"context_line":"        super(IpamTestCase, self).setUp()"},{"line_number":35,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027, self.engine.url, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a890539_a2d83680","line":32,"updated":"2014-11-12 16:04:34.000000000","message":"I need to include Postgresql too","commit_id":"f69422e1f5863a90eb23a50607bfcc36bac9d2d6"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"10d32489134d4ac40f6b1f306be657ca4b59c9d9","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import models_v2"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class IpamTestCase(object):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def configure_test(self):"},{"line_number":35,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027, self.engine.url, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_0489a874","line":32,"updated":"2014-11-17 07:24:58.000000000","message":"Any reason why this class doesn\u0027t inherit from base.BaseTestCase?","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"bf0a46c26affd2eddcc689bd89ebb398981d669f","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import models_v2"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class IpamTestCase(object):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def configure_test(self):"},{"line_number":35,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027, self.engine.url, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_c2aeb997","line":32,"updated":"2014-11-16 16:41:09.000000000","message":"Docstring would be helpful","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"593b76737b99d88f5c63ab5db5b0c11566c6e88d","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import models_v2"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class IpamTestCase(object):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def configure_test(self):"},{"line_number":35,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027, self.engine.url, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_75b445f2","line":32,"in_reply_to":"5a890539_0489a874","updated":"2014-11-20 18:34:49.000000000","message":"Yes. the tests should be run only by the classes that inherits from IpamTestCase (TestIpamMySql and TestIpamPsql) . If IpamTestCase inherits from BaseTestCase tests are run also for IpamTestCase, which doesn\u0027t make sense","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"593b76737b99d88f5c63ab5db5b0c11566c6e88d","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from neutron.db import models_v2"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"class IpamTestCase(object):"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def configure_test(self):"},{"line_number":35,"context_line":"        cfg.CONF.set_override(\u0027connection\u0027, self.engine.url, group\u003d\u0027database\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_35a1dda9","line":32,"in_reply_to":"5a890539_c2aeb997","updated":"2014-11-20 18:34:49.000000000","message":"OK!","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"36b0874dec20f7c1dedfabd5282e8171ff026b2f","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.cxt \u003d context.get_admin_context()"},{"line_number":39,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":40,"context_line":"        self.tenant_id \u003d \u0027test_tenant\u0027"},{"line_number":41,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":42,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"},{"line_number":43,"context_line":"        self.port_id \u003d \u0027test_p_id\u0027"},{"line_number":44,"context_line":"        self._create_network()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_a797ff38","line":41,"updated":"2014-11-16 15:09:41.000000000","message":"why is this not the network_id from _create_network?","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"593b76737b99d88f5c63ab5db5b0c11566c6e88d","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.cxt \u003d context.get_admin_context()"},{"line_number":39,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":40,"context_line":"        self.tenant_id \u003d \u0027test_tenant\u0027"},{"line_number":41,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":42,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"},{"line_number":43,"context_line":"        self.port_id \u003d \u0027test_p_id\u0027"},{"line_number":44,"context_line":"        self._create_network()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_15b4e133","line":41,"in_reply_to":"5a890539_a797ff38","updated":"2014-11-20 18:34:49.000000000","message":"in _create_network I use self.network_id, I don\u0027t understand what you mean here","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"36b0874dec20f7c1dedfabd5282e8171ff026b2f","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":40,"context_line":"        self.tenant_id \u003d \u0027test_tenant\u0027"},{"line_number":41,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":42,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"},{"line_number":43,"context_line":"        self.port_id \u003d \u0027test_p_id\u0027"},{"line_number":44,"context_line":"        self._create_network()"},{"line_number":45,"context_line":"        self._create_subnet()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_c79c0b60","line":42,"updated":"2014-11-16 15:09:41.000000000","message":"same question regarding subnet?","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"593b76737b99d88f5c63ab5db5b0c11566c6e88d","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        cfg.CONF.set_override(\u0027notify_nova_on_port_status_changes\u0027, False)"},{"line_number":40,"context_line":"        self.tenant_id \u003d \u0027test_tenant\u0027"},{"line_number":41,"context_line":"        self.network_id \u003d \u0027test_net_id\u0027"},{"line_number":42,"context_line":"        self.subnet_id \u003d \u0027test_sub_id\u0027"},{"line_number":43,"context_line":"        self.port_id \u003d \u0027test_p_id\u0027"},{"line_number":44,"context_line":"        self._create_network()"},{"line_number":45,"context_line":"        self._create_subnet()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_957ff165","line":42,"in_reply_to":"5a890539_c79c0b60","updated":"2014-11-20 18:34:49.000000000","message":"same answer. Could you please clarify?","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"bf0a46c26affd2eddcc689bd89ebb398981d669f","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                  \u0027id\u0027: self.subnet_id,"},{"line_number":95,"context_line":"                  \u0027name\u0027: \u0027test_sub\u0027,"},{"line_number":96,"context_line":"                  \u0027network_id\u0027: self.network_id,"},{"line_number":97,"context_line":"                  \u0027ip_version\u0027: 4,"},{"line_number":98,"context_line":"                  \u0027cidr\u0027: \u002710.10.10.0/29\u0027,"},{"line_number":99,"context_line":"                  \u0027enable_dhcp\u0027: False,"},{"line_number":100,"context_line":"                  \u0027gateway_ip\u0027: \u002710.10.10.1\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_a2a9ad91","line":97,"updated":"2014-11-16 16:41:09.000000000","message":"No support for IPv6?","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"593b76737b99d88f5c63ab5db5b0c11566c6e88d","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                  \u0027id\u0027: self.subnet_id,"},{"line_number":95,"context_line":"                  \u0027name\u0027: \u0027test_sub\u0027,"},{"line_number":96,"context_line":"                  \u0027network_id\u0027: self.network_id,"},{"line_number":97,"context_line":"                  \u0027ip_version\u0027: 4,"},{"line_number":98,"context_line":"                  \u0027cidr\u0027: \u002710.10.10.0/29\u0027,"},{"line_number":99,"context_line":"                  \u0027enable_dhcp\u0027: False,"},{"line_number":100,"context_line":"                  \u0027gateway_ip\u0027: \u002710.10.10.1\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_75ab6589","line":97,"in_reply_to":"5a890539_a2a9ad91","updated":"2014-11-20 18:34:49.000000000","message":"Not yet, not in this patch","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":10969,"name":"Shnaidman Sagi (Sergey)","display_name":"Shnaidman Sagi","email":"sshnaidm@redhat.com","username":"sergsh"},"change_message_id":"bf0a46c26affd2eddcc689bd89ebb398981d669f","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            ip_avail_ranges_expected)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def test_allocate_ip_exausted_pool(self):"},{"line_number":198,"context_line":"        # available from .2 up tp .6 -\u003e 5"},{"line_number":199,"context_line":"        for i in range(1, 6):"},{"line_number":200,"context_line":"            self._create_port(self.port_id + str(i))"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_62a345b2","line":198,"updated":"2014-11-16 16:41:09.000000000","message":"typo \"tp\" \u003e \"to\"","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"593b76737b99d88f5c63ab5db5b0c11566c6e88d","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            ip_avail_ranges_expected)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def test_allocate_ip_exausted_pool(self):"},{"line_number":198,"context_line":"        # available from .2 up tp .6 -\u003e 5"},{"line_number":199,"context_line":"        for i in range(1, 6):"},{"line_number":200,"context_line":"            self._create_port(self.port_id + str(i))"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_f59e7562","line":198,"in_reply_to":"5a890539_62a345b2","updated":"2014-11-20 18:34:49.000000000","message":"Thanks!","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"18a8781897fc0448dcb8ee41da3d49a8d12e218d","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        ip_avail_ranges_expected \u003d []"},{"line_number":218,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027first_ip\u0027: \u002710.10.10.2\u0027,"},{"line_number":219,"context_line":"                                   \u0027last_ip\u0027: \u002710.10.10.6\u0027,"},{"line_number":220,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":221,"context_line":"        self.query_db_and_assert_alloc_pool_matches(ip_alloc_pool_expected)"},{"line_number":222,"context_line":"        self.query_db_and_assert_ip_avail_range_matches("},{"line_number":223,"context_line":"            ip_avail_ranges_expected)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_27a86f1f","line":220,"updated":"2014-11-16 15:39:45.000000000","message":"I could see \"ip_alloc_pool_expected\" is used in most of the test cases with same value. I feel its repetition. Try to avoid that.","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"4344922303bad56348bdfbf3c19bc08f064b9efd","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        ip_avail_ranges_expected \u003d []"},{"line_number":218,"context_line":"        ip_alloc_pool_expected \u003d [{\u0027first_ip\u0027: \u002710.10.10.2\u0027,"},{"line_number":219,"context_line":"                                   \u0027last_ip\u0027: \u002710.10.10.6\u0027,"},{"line_number":220,"context_line":"                                   \u0027subnet_id\u0027: self.subnet_id}]"},{"line_number":221,"context_line":"        self.query_db_and_assert_alloc_pool_matches(ip_alloc_pool_expected)"},{"line_number":222,"context_line":"        self.query_db_and_assert_ip_avail_range_matches("},{"line_number":223,"context_line":"            ip_avail_ranges_expected)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a890539_a52e57f8","line":220,"in_reply_to":"5a890539_27a86f1f","updated":"2014-11-21 15:51:44.000000000","message":"It\u0027s a value that is expected in the test, I found it more readable if it\u0027s defined in the test itself. The only thing I could so is move it to self.ip_alloc_pool_expected but since ip_alloc_pool_expected is not used in every test, it doesn\u0027t seem correct to me.","commit_id":"561d989326af4de4d1ba232728c8fbbf6b8397e3"}]}
