)]}'
{"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"c33d24c847e4634cd89cb8afd17eae6854ba13da","unresolved":false,"context_lines":[{"line_number":1027,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, p)"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1030,"context_line":"            self._recycle_expired_ip_allocations(context, p[\u0027network_id\u0027])"},{"line_number":1031,"context_line":"            network \u003d self._get_network(context, p[\"network_id\"])"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"            # Ensure that a MAC address is defined and it is unique on the"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Fj8Y%3D","line":1030,"updated":"2012-08-31 00:08:30.000000000","message":"seems a little inefficient if you think about someone creating a large number of ports at one time.  \n\nprobably the idea model would be to have a periodic task that runs, or to only run this query if it hasn\u0027t been run in the last X seconds, but I don\u0027t think its a big deal.","commit_id":"2c20984dc1262d7530bab3bcccf85d125de6b211"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"88921905b2dcbe8cdd7e2ec20663cdcecbf0ec89","unresolved":false,"context_lines":[{"line_number":1027,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, p)"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1030,"context_line":"            self._recycle_expired_ip_allocations(context, p[\u0027network_id\u0027])"},{"line_number":1031,"context_line":"            network \u003d self._get_network(context, p[\"network_id\"])"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"            # Ensure that a MAC address is defined and it is unique on the"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FjTY%3D","line":1030,"in_reply_to":"AAAALH%2F%2Fj8Y%3D","updated":"2012-08-31 20:26:54.000000000","message":"If we make it periodic then someone could request a specific IP that is technically available, but not garbage collected.  What if I added an attribute to create_bulk_port that would run it once and the check would be skipped when create_port was called?","commit_id":"2c20984dc1262d7530bab3bcccf85d125de6b211"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1027,"context_line":"        tenant_id \u003d self._get_tenant_id_for_create(context, p)"},{"line_number":1028,"context_line":""},{"line_number":1029,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1030,"context_line":"            self._recycle_expired_ip_allocations(context, p[\u0027network_id\u0027])"},{"line_number":1031,"context_line":"            network \u003d self._get_network(context, p[\"network_id\"])"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"            # Ensure that a MAC address is defined and it is unique on the"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FjsM%3D","line":1030,"in_reply_to":"AAAALH%2F%2Fj8Y%3D","updated":"2012-08-31 09:36:02.000000000","message":"perhaps we can run this check only if there are IPs on hold (looks like _recycle_expired_ip only works with ips for which active\u003dFalse). _hold_ip could set a flag; when this flag is true, we check for expired allocations\n\nThe check should also be run the first time a port is created as some entries on hold might be in the db at startup.","commit_id":"2c20984dc1262d7530bab3bcccf85d125de6b211"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"117b742fc2f0ea10a0be0802d578877b2b722cfa","unresolved":false,"context_lines":[{"line_number":1079,"context_line":""},{"line_number":1080,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1081,"context_line":"            port \u003d self._get_port(context, id)"},{"line_number":1082,"context_line":"            self._recycle_expired_ip_allocations(context, port[\u0027network_id\u0027])"},{"line_number":1083,"context_line":"            # Check if the IPs need to be updated"},{"line_number":1084,"context_line":"            if \u0027fixed_ips\u0027 in p:"},{"line_number":1085,"context_line":"                original \u003d self._make_port_dict(port)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FjoM%3D","line":1082,"updated":"2012-08-31 12:08:43.000000000","message":"Should this not be dealt with if the ip\u0027s are being updated. That is, in the if below?","commit_id":"2c20984dc1262d7530bab3bcccf85d125de6b211"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":1126,"context_line":""},{"line_number":1127,"context_line":"        allocated_qry \u003d context.session.query(models_v2.IPAllocation)"},{"line_number":1128,"context_line":"        # recycle all of the IP\u0027s"},{"line_number":1129,"context_line":"        # NOTE(garyk) this may be have to be addressed differently when"},{"line_number":1130,"context_line":"        # working with a DHCP server."},{"line_number":1131,"context_line":"        allocated \u003d allocated_qry.filter_by(port_id\u003did).all()"},{"line_number":1132,"context_line":"        if allocated:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAALH%2F%2Fir8%3D","line":1129,"updated":"2012-09-01 13:41:01.000000000","message":"I think that we can remove this comment now","commit_id":"dde6922b98c993ce4de355b9856d54b47197cd5d"}],"quantum/tests/unit/test_db_plugin.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"unresolved":false,"context_lines":[{"line_number":1194,"context_line":"    def test_recycling(self):"},{"line_number":1195,"context_line":"        fmt \u003d \u0027json\u0027"},{"line_number":1196,"context_line":""},{"line_number":1197,"context_line":"        # set expirations to past so that recycling is checked"},{"line_number":1198,"context_line":"        reference \u003d datetime.datetime(2012, 8, 13, 23, 11, 0)"},{"line_number":1199,"context_line":"        timeutils.utcnow.override_time \u003d reference"},{"line_number":1200,"context_line":"        cfg.CONF.set_override(\u0027dhcp_lease_duration\u0027, 0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fi1A%3D","line":1197,"updated":"2012-09-01 01:27:47.000000000","message":"Code or configuration changes that expect to be reset at the end of a test are dangerous - an assertion failure could prevent execution of the cleanup, and other tests could be affected. \n\nLuckily, unittest2 supports adding cleanup callbacks:\n \ncfg.CONF.set_override(\u0027dhcp_lease_duration\u0027, 0)\nself.addCleanup(cfg.CONF.reset)\n\nSee: http://docs.python.org/library/unittest.html#unittest.TestCase.addCleanup\n\n(Suggestion only) Consider patching timeutils.utcnow with mock instead of using its override capability - stopping the patch will be as easy as addCleanup(utcnow_patch.stop).","commit_id":"d53994b86065b8b6b25bd71ccaff305ca7c5bc74"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"88921905b2dcbe8cdd7e2ec20663cdcecbf0ec89","unresolved":false,"context_lines":[{"line_number":1194,"context_line":"    def test_recycling(self):"},{"line_number":1195,"context_line":"        fmt \u003d \u0027json\u0027"},{"line_number":1196,"context_line":""},{"line_number":1197,"context_line":"        # set expirations to past so that recycling is checked"},{"line_number":1198,"context_line":"        reference \u003d datetime.datetime(2012, 8, 13, 23, 11, 0)"},{"line_number":1199,"context_line":"        timeutils.utcnow.override_time \u003d reference"},{"line_number":1200,"context_line":"        cfg.CONF.set_override(\u0027dhcp_lease_duration\u0027, 0)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FizI%3D","line":1197,"in_reply_to":"AAAALH%2F%2Fi1A%3D","updated":"2012-09-01 07:05:33.000000000","message":"Changed to use mock.patch instead of timeutils test hack.  I\u0027ve removed the set_override because the base tearDown was already handling it (I overlooked that fact originally).","commit_id":"d53994b86065b8b6b25bd71ccaff305ca7c5bc74"}]}
