)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"40a08c06cad08f13fd546d464938aa79e1431221","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-implements: blueprint neutron-ovs-dvr"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"DocImpact"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: Iab6505f239d2c4c9bcbf4e32a292d7b4b5320c8e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"dab895d6_1369a48b","line":26,"updated":"2014-06-29 11:47:14.000000000","message":"would it be possible to add the new configuration variables here so that the guys documenting could have an easier job","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"15791591b174fe3ebc9df0555600a71ffa032e32","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Partially-implements: blueprint neutron-ovs-dvr"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"DocImpact"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"Change-Id: Iab6505f239d2c4c9bcbf4e32a292d7b4b5320c8e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"dab895d6_8e402758","line":26,"in_reply_to":"dab895d6_1369a48b","updated":"2014-06-29 16:29:08.000000000","message":"Done","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"}],"neutron/common/utils.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5f06d839114ec8101421830f5eca3bf3025483fb","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"def get_random_mac(base_mac):"},{"line_number":275,"context_line":"    mac \u003d [int(base_mac[0], 16), int(base_mac[1], 16),"},{"line_number":276,"context_line":"           int(base_mac[2], 16), random.randint(0x00, 0xff),"},{"line_number":277,"context_line":"           random.randint(0x00, 0xff), random.randint(0x00, 0xff)]"},{"line_number":278,"context_line":"    if base_mac[3] !\u003d \u002700\u0027:"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_2a3e042a","line":275,"updated":"2014-07-10 22:23:17.000000000","message":"mac \u003d [int(mac_octet, 16) if mac_octet !\u003d \u002700\u0027 else random.randint(0x00, 0xff) for mac_octet in base mac]\nreturn \":\".join([\"%02x\" % x for x in mac[)\n\nThis will work in the hypothesis that base_mac has 6 elements and that some check already verifyfies the 5th and 6th octet already already \u002700\u0027\n\nanyway, this is just for saying","commit_id":"6e63fc2923909211f4de6ddd8c07d11da854f14d"}],"neutron/db/dvr_mac_db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            self._plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":57,"context_line":"        return self._plugin"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _get_dvr_mac_address_by_host(self, context, host):"},{"line_number":60,"context_line":"        try:"},{"line_number":61,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":62,"context_line":"            dvrma \u003d query.filter("}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_7cd1902e","line":59,"updated":"2014-06-24 20:00:58.000000000","message":"Optional suggestion:  inline this because it is only called from one place.  Unless it makes it much more difficult to unit test.  It seems like a level of indirection just for the sake of indirection.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"839d5ca843a9ab23950b56659289fe7119fc7af5","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            self._plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":57,"context_line":"        return self._plugin"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _get_dvr_mac_address_by_host(self, context, host):"},{"line_number":60,"context_line":"        try:"},{"line_number":61,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":62,"context_line":"            dvrma \u003d query.filter("}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_116a2581","line":59,"in_reply_to":"1ae5cdf2_4e5fb1e4","updated":"2014-06-25 03:32:38.000000000","message":"ok","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            self._plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":57,"context_line":"        return self._plugin"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _get_dvr_mac_address_by_host(self, context, host):"},{"line_number":60,"context_line":"        try:"},{"line_number":61,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":62,"context_line":"            dvrma \u003d query.filter("}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_4e5fb1e4","line":59,"in_reply_to":"1ae5cdf2_7cd1902e","updated":"2014-06-24 22:57:16.000000000","message":"if you look at where it\u0027s used, I guess it\u0027s easier to read if kept separate because of the nested try/except.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            dvrma \u003d query.filter("},{"line_number":63,"context_line":"                DistributedVirtualRouterMacAddress.host \u003d\u003d host).one()"},{"line_number":64,"context_line":"        except exc.NoResultFound:"},{"line_number":65,"context_line":"            raise ext_dvr.DVRMacAddressNotFound(host\u003dhost)"},{"line_number":66,"context_line":"        return dvrma"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _create_dvr_mac_address(self, context, host):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_bcb23804","line":65,"updated":"2014-06-24 20:00:58.000000000","message":"nit:  What value does this except add?  As far as I can tell, the host parameter goes straight to the bit bucket.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"839d5ca843a9ab23950b56659289fe7119fc7af5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            dvrma \u003d query.filter("},{"line_number":63,"context_line":"                DistributedVirtualRouterMacAddress.host \u003d\u003d host).one()"},{"line_number":64,"context_line":"        except exc.NoResultFound:"},{"line_number":65,"context_line":"            raise ext_dvr.DVRMacAddressNotFound(host\u003dhost)"},{"line_number":66,"context_line":"        return dvrma"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _create_dvr_mac_address(self, context, host):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_aed2f0ce","line":65,"in_reply_to":"1ae5cdf2_6e246d60","updated":"2014-06-25 03:32:38.000000000","message":"Fair enough.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            dvrma \u003d query.filter("},{"line_number":63,"context_line":"                DistributedVirtualRouterMacAddress.host \u003d\u003d host).one()"},{"line_number":64,"context_line":"        except exc.NoResultFound:"},{"line_number":65,"context_line":"            raise ext_dvr.DVRMacAddressNotFound(host\u003dhost)"},{"line_number":66,"context_line":"        return dvrma"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _create_dvr_mac_address(self, context, host):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_6e246d60","line":65,"in_reply_to":"1ae5cdf2_bcb23804","updated":"2014-06-24 22:57:16.000000000","message":"It adds the same value of all the other *-NotFound exceptions in the source tree :) I guess we could live without, but it certainly does not hurt.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_dcff0465","line":88,"updated":"2014-06-24 20:00:58.000000000","message":"You wouldn\u0027t need to check this if you take my suggestion on L93.  I\u0027m just trying to improve the flow of the code a bit.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_ee731d4c","line":88,"in_reply_to":"1ae5cdf2_dcff0465","updated":"2014-06-24 22:57:16.000000000","message":"the code seems pretty concise to me; that said I am not 100% sure I can do what you suggest down below (if I understood you correctly); I\u0027d rather SELECT something that\u0027s been committed, (and avoid flushing the session explicitly)...I mean I could try...but have you seen the old mac generation logic? This a huge improvement in comparison. (I am actually planning to revive bug 1194565 in the same way)","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"839d5ca843a9ab23950b56659289fe7119fc7af5","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_ce749cd2","line":88,"in_reply_to":"1ae5cdf2_ee731d4c","updated":"2014-06-25 03:32:38.000000000","message":"I don\u0027t think there is a problem with selecting something that has not been committed if the lines are moved after the \"with context.session...\" statement and not indented to fall within it.  Basically, replace the break on L82 with L93-L95 at the same indentation level.  Or, am I missing something?\n\nAn alternative, maybe a better one, is to stick L93-L95 under an \"else:\" after L87.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        dvr_macs \u003d self.get_dvr_mac_address_list(context)"},{"line_number":94,"context_line":"        self.notifier.dvr_mac_address_update(context, dvr_macs)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        return self._make_dvr_mac_address_dict(dvr_mac_binding)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_1cc32c3a","line":93,"updated":"2014-06-24 20:00:58.000000000","message":"You could move this up to L81 and break to the return.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        dvr_macs \u003d self.get_dvr_mac_address_list(context)"},{"line_number":94,"context_line":"        self.notifier.dvr_mac_address_update(context, dvr_macs)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        return self._make_dvr_mac_address_dict(dvr_mac_binding)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_4e909142","line":93,"in_reply_to":"1ae5cdf2_1cc32c3a","updated":"2014-06-24 22:57:16.000000000","message":"see above","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            LOG.error(_(\"delete_dvr_mac_address host input is empty\"))"},{"line_number":101,"context_line":"            return"},{"line_number":102,"context_line":"        query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":103,"context_line":"        query.filter(DistributedVirtualRouterMacAddress.host \u003d\u003d host).delete()"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":106,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_fc23e003","line":103,"updated":"2014-06-24 20:00:58.000000000","message":"I\u0027m curious.  Is sqlalchemy smart enough to do this delete without doing two db queries?  That would be cool.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"839d5ca843a9ab23950b56659289fe7119fc7af5","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            LOG.error(_(\"delete_dvr_mac_address host input is empty\"))"},{"line_number":101,"context_line":"            return"},{"line_number":102,"context_line":"        query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":103,"context_line":"        query.filter(DistributedVirtualRouterMacAddress.host \u003d\u003d host).delete()"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":106,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_aee91081","line":103,"in_reply_to":"1ae5cdf2_cec2e134","updated":"2014-06-25 03:32:38.000000000","message":"That is what I was hoping for.  I can\u0027t remember where but I\u0027ve seen this done less effeciently, with two queries, and I didn\u0027t know how to optimize it at the time.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            LOG.error(_(\"delete_dvr_mac_address host input is empty\"))"},{"line_number":101,"context_line":"            return"},{"line_number":102,"context_line":"        query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":103,"context_line":"        query.filter(DistributedVirtualRouterMacAddress.host \u003d\u003d host).delete()"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":106,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_cec2e134","line":103,"in_reply_to":"1ae5cdf2_fc23e003","updated":"2014-06-24 22:57:16.000000000","message":"there\u0027s no two queries being executed. Line 102 is just \"compiling\" of the query; the delete statement is issued on line 103 on the model being compiled","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":106,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":108,"context_line":"            dvrmacs \u003d query.all()"},{"line_number":109,"context_line":"            return dvrmacs"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_bcb4f882","line":107,"updated":"2014-06-24 20:00:58.000000000","message":"suggestion:\n\nreturn context.session.query(DistributedVirtualRouterMacAddress).all()","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"839d5ca843a9ab23950b56659289fe7119fc7af5","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":106,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":108,"context_line":"            dvrmacs \u003d query.all()"},{"line_number":109,"context_line":"            return dvrmacs"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_2e1980d1","line":107,"in_reply_to":"1ae5cdf2_2edb4522","updated":"2014-06-25 03:32:38.000000000","message":"Oh, I thought it would fit without a break.  No problem.  Just a minor thing.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":106,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":108,"context_line":"            dvrmacs \u003d query.all()"},{"line_number":109,"context_line":"            return dvrmacs"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_2edb4522","line":107,"in_reply_to":"1ae5cdf2_bcb4f882","updated":"2014-06-24 22:57:16.000000000","message":"But then I have to break the line...meh","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":112,"context_line":"        if not host:"},{"line_number":113,"context_line":"            LOG.error(_(\"get_dvr_mac_address_by_host, host input is empty\"))"},{"line_number":114,"context_line":"            return"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            return self._get_dvr_mac_address_by_host(context, host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_dc5b8484","line":114,"updated":"2014-06-24 20:00:58.000000000","message":"Should this be an exception condition?  Otherwise, the rest of the code needs to properly handle None as a return value.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"25f9079a37c36f1be6f248d6e617ba49b8c242d6","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":112,"context_line":"        if not host:"},{"line_number":113,"context_line":"            LOG.error(_(\"get_dvr_mac_address_by_host, host input is empty\"))"},{"line_number":114,"context_line":"            return"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            return self._get_dvr_mac_address_by_host(context, host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_04b7453b","line":114,"in_reply_to":"1ae5cdf2_51ce6db8","updated":"2014-06-25 04:01:51.000000000","message":"The host information is supplied by the L2 OVS Agent.  It is not going to be empty mostly (either host value will be retrieved by L2 OVS Agent from its .ini file and shipped (or) it will collect the name by opening a local socket on the compute host and ship that instead).\r\n\r\nDVR Mac address cannot be allocated without mapping to a valid host and so I put this error message in case host is None.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":112,"context_line":"        if not host:"},{"line_number":113,"context_line":"            LOG.error(_(\"get_dvr_mac_address_by_host, host input is empty\"))"},{"line_number":114,"context_line":"            return"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            return self._get_dvr_mac_address_by_host(context, host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_eeef9daf","line":114,"in_reply_to":"1ae5cdf2_dc5b8484","updated":"2014-06-24 22:57:16.000000000","message":"honestly I am not sure host is ever going to be empty or None. I\u0027d need Vivek\u0027s input on this","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"839d5ca843a9ab23950b56659289fe7119fc7af5","unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":112,"context_line":"        if not host:"},{"line_number":113,"context_line":"            LOG.error(_(\"get_dvr_mac_address_by_host, host input is empty\"))"},{"line_number":114,"context_line":"            return"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            return self._get_dvr_mac_address_by_host(context, host)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_51ce6db8","line":114,"in_reply_to":"1ae5cdf2_eeef9daf","updated":"2014-06-25 03:32:38.000000000","message":"I wouldn\u0027t miss it if it disappeared but input from Vivek would be good.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    @log.log"},{"line_number":127,"context_line":"    def get_compute_ports_on_host_by_subnet(self, context, host, subnet):"},{"line_number":128,"context_line":"        #FIXME(vivek): need to optimize this code to do away two-step filtering"},{"line_number":129,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":130,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"},{"line_number":131,"context_line":"        ports \u003d self.plugin.get_ports(context, filters\u003dfilter)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_1c708cd9","line":128,"updated":"2014-06-24 20:00:58.000000000","message":"+1","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":134,"context_line":"        for port in ports:"},{"line_number":135,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"},{"line_number":136,"context_line":"                # try:"},{"line_number":137,"context_line":"                if port[\u0027binding:host_id\u0027] \u003d\u003d host:"},{"line_number":138,"context_line":"                    port_dict \u003d self.plugin._make_port_dict("},{"line_number":139,"context_line":"                        port, process_extensions\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_5c7a14bb","line":136,"updated":"2014-06-24 20:00:58.000000000","message":"?","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":134,"context_line":"        for port in ports:"},{"line_number":135,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"},{"line_number":136,"context_line":"                # try:"},{"line_number":137,"context_line":"                if port[\u0027binding:host_id\u0027] \u003d\u003d host:"},{"line_number":138,"context_line":"                    port_dict \u003d self.plugin._make_port_dict("},{"line_number":139,"context_line":"                        port, process_extensions\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_0eebe9a4","line":136,"in_reply_to":"1ae5cdf2_5c7a14bb","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":144,"context_line":"        return vm_ports_by_host"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    @log.log"},{"line_number":147,"context_line":"    def get_subnet_for_dvr(self, context, subnet):"},{"line_number":148,"context_line":"        try:"},{"line_number":149,"context_line":"            subnet_info \u003d self.plugin.get_subnet(context, subnet)"},{"line_number":150,"context_line":"            # retrieve the gateway port on this subnet"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_1fbdde03","line":147,"updated":"2014-06-24 20:00:58.000000000","message":"There are two queries.  Should they be in a transaction for consistency?  Probably not a big deal.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            internal_gateway_ports \u003d self.plugin.get_ports("},{"line_number":154,"context_line":"                context, filters\u003dfilter)"},{"line_number":155,"context_line":"            if not internal_gateway_ports:"},{"line_number":156,"context_line":"                LOG.error(_(\"get_subnet() Could not retrieve gateway port\""},{"line_number":157,"context_line":"                            \" for subnet %s\"), subnet_info)"},{"line_number":158,"context_line":"                return {}"},{"line_number":159,"context_line":"            internal_port \u003d internal_gateway_ports[0]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_bff14a03","line":156,"updated":"2014-06-24 20:00:58.000000000","message":"You don\u0027t need \"get_subnet()\" in this log message.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            internal_gateway_ports \u003d self.plugin.get_ports("},{"line_number":154,"context_line":"                context, filters\u003dfilter)"},{"line_number":155,"context_line":"            if not internal_gateway_ports:"},{"line_number":156,"context_line":"                LOG.error(_(\"get_subnet() Could not retrieve gateway port\""},{"line_number":157,"context_line":"                            \" for subnet %s\"), subnet_info)"},{"line_number":158,"context_line":"                return {}"},{"line_number":159,"context_line":"            internal_port \u003d internal_gateway_ports[0]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_8e361950","line":156,"in_reply_to":"1ae5cdf2_bff14a03","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            internal_port \u003d internal_gateway_ports[0]"},{"line_number":160,"context_line":"            subnet_info[\u0027gateway_mac\u0027] \u003d internal_port[\u0027mac_address\u0027]"},{"line_number":161,"context_line":"            return subnet_info"},{"line_number":162,"context_line":"        except q_exc.SubnetNotFound:"},{"line_number":163,"context_line":"            return {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_df58d633","line":162,"updated":"2014-06-24 20:00:58.000000000","message":"This try/except wraps too much code.  The only line that could raise this exception is L149, right?  If so, the try/except should only wrap that line.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            internal_port \u003d internal_gateway_ports[0]"},{"line_number":160,"context_line":"            subnet_info[\u0027gateway_mac\u0027] \u003d internal_port[\u0027mac_address\u0027]"},{"line_number":161,"context_line":"            return subnet_info"},{"line_number":162,"context_line":"        except q_exc.SubnetNotFound:"},{"line_number":163,"context_line":"            return {}"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_ae23d504","line":162,"in_reply_to":"1ae5cdf2_df58d633","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"e3cebbde898cc80358f1207ab240aaaa26afce71","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        \"\"\"Create dvr mac address for a given host.\"\"\""},{"line_number":70,"context_line":"        base_mac \u003d cfg.CONF.dvr_base_mac.split(\u0027:\u0027)"},{"line_number":71,"context_line":"        max_retries \u003d cfg.CONF.mac_generation_retries"},{"line_number":72,"context_line":"        for attempt in range(max_retries):"},{"line_number":73,"context_line":"            try:"},{"line_number":74,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":75,"context_line":"                    mac_address \u003d utils.get_random_mac(base_mac)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_b83eaeb7","line":72,"updated":"2014-06-25 06:57:34.000000000","message":"You might want to use reversed(range(max_retries)) to eliminate calculation in line 87.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0178ddfb10603aa0f5240f11f6737dab51daf2d6","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_6e4b8886","line":88,"updated":"2014-06-25 03:39:49.000000000","message":"The only thing that I didn\u0027t like about this code was this \"if attempt \u003d\u003d max_retries - 1:\"  Otherwise, Armando is right.  It is pretty concise.  Take one more look at my comments on PS2 to see if it can be just a little more concise.\n\nAs a reviewer or anyone else reading the code, I\u0027ve got to stop and think about whether this comparison is correct.  (should it be attempt \u003d\u003d max_retries or attempt \u003d\u003d max_retries - 1)  The comparison is correct but the point is that if it were not needed at all then that might be better.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"e3cebbde898cc80358f1207ab240aaaa26afce71","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_5883ea54","line":88,"in_reply_to":"1ae5cdf2_04bca505","updated":"2014-06-25 06:57:34.000000000","message":"I think this comparison is incorrect when the allocation succeeds in the last chance.  I think you have to use the \"else\" statement.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"22b1720152e1dcd79cf401618d58fc5a79eecab4","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_297ec36a","line":88,"in_reply_to":"1ae5cdf2_4a9b0266","updated":"2014-06-25 15:07:04.000000000","message":"yup, I\u0027ll revise.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c795ff2cda271bd21039b6aa10d27fdd7d0a87ee","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_4a9b0266","line":88,"in_reply_to":"1ae5cdf2_5883ea54","updated":"2014-06-25 14:51:43.000000000","message":"Armando, it isn\u0027t complex by any means.  But, those who may not know that off the top of their head may have to stop and check.  The whole point was that it could be avoided with a slight improvement of the flow.\n\nAlso, Iwamoto makes a good point.  I think he\u0027s right about that.  That changes the argument here from a matter of style (which I was about to cave in to) to a matter of code correctness.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"642a5e363bdef25ef6ec04a255219545b8478b1e","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_04bca505","line":88,"in_reply_to":"1ae5cdf2_6e4b8886","updated":"2014-06-25 03:53:40.000000000","message":"I get what you\u0027re saying, but range returns a list [0, max_retries-1], so it\u0027s really a no brainer.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":9093,"name":"Chuck Carlino","email":"chuckjcarlino@gmail.com","username":"ChuckC"},"change_message_id":"c27d585b5b3bef2d9cbf73fd7611dd42d62e17c5","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                break"},{"line_number":83,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":84,"context_line":"                LOG.debug(\"Generated dvr mac %(mac_address)s exists.\""},{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_d1ecebbe","line":85,"updated":"2014-06-26 21:21:20.000000000","message":"using \u0027max_retries\u0027 here misleads the reader.  maybe \u0027remaining\u0027?","commit_id":"4cd7076c6f53dbbe1a8cfb508aacf09e875f98aa"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"68064c67556406e34db5dddd3804e84a549600cb","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                break"},{"line_number":83,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":84,"context_line":"                LOG.debug(\"Generated dvr mac %(mac_address)s exists.\""},{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_5d7d4a1d","line":85,"in_reply_to":"1ae5cdf2_d1ecebbe","updated":"2014-06-26 23:50:21.000000000","message":"Done","commit_id":"4cd7076c6f53dbbe1a8cfb508aacf09e875f98aa"},{"author":{"_account_id":9093,"name":"Chuck Carlino","email":"chuckjcarlino@gmail.com","username":"ChuckC"},"change_message_id":"c27d585b5b3bef2d9cbf73fd7611dd42d62e17c5","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_f1bba7bb","line":88,"updated":"2014-06-26 21:21:20.000000000","message":"looks like we still have Iwamoto\u0027s issue from patch set 3.","commit_id":"4cd7076c6f53dbbe1a8cfb508aacf09e875f98aa"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"68064c67556406e34db5dddd3804e84a549600cb","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                          \" Remaining attempts %(max_retries)s.\","},{"line_number":86,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":87,"context_line":"                           \u0027max_retries\u0027: max_retries - (attempt + 1)})"},{"line_number":88,"context_line":"        if attempt \u003d\u003d max_retries - 1:"},{"line_number":89,"context_line":"            LOG.error(_(\"Unable to generate dvr mac after %s attempts\"),"},{"line_number":90,"context_line":"                      max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_bd772e3a","line":88,"in_reply_to":"1ae5cdf2_f1bba7bb","updated":"2014-06-26 23:50:21.000000000","message":"correct, it\u0027s gonna be fixed in the next patch","commit_id":"4cd7076c6f53dbbe1a8cfb508aacf09e875f98aa"},{"author":{"_account_id":9093,"name":"Chuck Carlino","email":"chuckjcarlino@gmail.com","username":"ChuckC"},"change_message_id":"c27d585b5b3bef2d9cbf73fd7611dd42d62e17c5","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        return self._make_dvr_mac_address_dict(dvr_mac_binding)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def delete_dvr_mac_address(self, context, host):"},{"line_number":99,"context_line":"        if not host:"},{"line_number":100,"context_line":"            LOG.error(_(\"delete_dvr_mac_address host input is empty\"))"},{"line_number":101,"context_line":"            return"},{"line_number":102,"context_line":"        query \u003d context.session.query(DistributedVirtualRouterMacAddress)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_23a22e3f","line":99,"updated":"2014-06-26 21:21:20.000000000","message":"I\u0027m curious as to when this condition would not be a bug (and an exception would be more appropriate).  Same at 112.","commit_id":"4cd7076c6f53dbbe1a8cfb508aacf09e875f98aa"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"68064c67556406e34db5dddd3804e84a549600cb","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        return self._make_dvr_mac_address_dict(dvr_mac_binding)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def delete_dvr_mac_address(self, context, host):"},{"line_number":99,"context_line":"        if not host:"},{"line_number":100,"context_line":"            LOG.error(_(\"delete_dvr_mac_address host input is empty\"))"},{"line_number":101,"context_line":"            return"},{"line_number":102,"context_line":"        query \u003d context.session.query(DistributedVirtualRouterMacAddress)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1ae5cdf2_7d35a643","line":99,"in_reply_to":"1ae5cdf2_23a22e3f","updated":"2014-06-26 23:50:21.000000000","message":"I thought about it and for the purpose of this method even with an empty host no exception is raised.","commit_id":"4cd7076c6f53dbbe1a8cfb508aacf09e875f98aa"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"f1be267d5ca8185fc77a5ea00d8bc8bed90b1264","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        \"\"\"Create dvr mac address for a given host.\"\"\""},{"line_number":70,"context_line":"        base_mac \u003d cfg.CONF.dvr_base_mac.split(\u0027:\u0027)"},{"line_number":71,"context_line":"        max_retries \u003d cfg.CONF.mac_generation_retries"},{"line_number":72,"context_line":"        for attempt in range(max_retries):"},{"line_number":73,"context_line":"            try:"},{"line_number":74,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":75,"context_line":"                    mac_address \u003d utils.get_random_mac(base_mac)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_279f8c51","line":72,"updated":"2014-06-27 02:27:07.000000000","message":"As I said before, you can eliminate calculation in line 89 by using reversed(range(max_retries)) here.","commit_id":"ea652f0873540aeb168fb13688643f5016ae65cd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fbb44a7899913331ded9d458d2362f3dbea02fb0","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        \"\"\"Create dvr mac address for a given host.\"\"\""},{"line_number":70,"context_line":"        base_mac \u003d cfg.CONF.dvr_base_mac.split(\u0027:\u0027)"},{"line_number":71,"context_line":"        max_retries \u003d cfg.CONF.mac_generation_retries"},{"line_number":72,"context_line":"        for attempt in range(max_retries):"},{"line_number":73,"context_line":"            try:"},{"line_number":74,"context_line":"                with context.session.begin(subtransactions\u003dTrue):"},{"line_number":75,"context_line":"                    mac_address \u003d utils.get_random_mac(base_mac)"}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_c73fc8dd","line":72,"in_reply_to":"1ae5cdf2_279f8c51","updated":"2014-06-27 02:47:45.000000000","message":"Done","commit_id":"ea652f0873540aeb168fb13688643f5016ae65cd"},{"author":{"_account_id":9200,"name":"IWAMOTO Toshihiro","email":"iwamoto@valinux.co.jp","username":"toshii"},"change_message_id":"f1be267d5ca8185fc77a5ea00d8bc8bed90b1264","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                          \" Remaining attempts %(attempts_left)s.\","},{"line_number":88,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":89,"context_line":"                           \u0027attempts_left\u0027: max_retries - (attempt + 1)})"},{"line_number":90,"context_line":"            LOG.error(_(\"MAC generation error after %s attempts\"), max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def delete_dvr_mac_address(self, context, host):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_47c3b857","line":90,"updated":"2014-06-27 02:27:07.000000000","message":"This code block should have one less indent level.","commit_id":"ea652f0873540aeb168fb13688643f5016ae65cd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fbb44a7899913331ded9d458d2362f3dbea02fb0","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                          \" Remaining attempts %(attempts_left)s.\","},{"line_number":88,"context_line":"                          {\u0027mac_address\u0027: mac_address,"},{"line_number":89,"context_line":"                           \u0027attempts_left\u0027: max_retries - (attempt + 1)})"},{"line_number":90,"context_line":"            LOG.error(_(\"MAC generation error after %s attempts\"), max_retries)"},{"line_number":91,"context_line":"            raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def delete_dvr_mac_address(self, context, host):"}],"source_content_type":"text/x-python","patch_set":7,"id":"1ae5cdf2_477c98b6","line":90,"in_reply_to":"1ae5cdf2_47c3b857","updated":"2014-06-27 02:47:45.000000000","message":"Done","commit_id":"ea652f0873540aeb168fb13688643f5016ae65cd"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"40a08c06cad08f13fd546d464938aa79e1431221","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":"#"},{"line_number":15,"context_line":"# @author: Vivekanandan Narasimhan, Hewlett-Packard Inc"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import sqlalchemy as sa"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_b34ab825","line":15,"updated":"2014-06-29 11:47:14.000000000","message":"My understanding is that we no longer need the author (there should be hacking check for this)","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"15791591b174fe3ebc9df0555600a71ffa032e32","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":"#"},{"line_number":15,"context_line":"# @author: Vivekanandan Narasimhan, Hewlett-Packard Inc"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import sqlalchemy as sa"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_ce213fb6","line":15,"in_reply_to":"dab895d6_b34ab825","updated":"2014-06-29 16:29:08.000000000","message":"agreed","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"40a08c06cad08f13fd546d464938aa79e1431221","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                LOG.debug(\"Generated dvr mac %(mac)s exists.\""},{"line_number":87,"context_line":"                          \" Remaining attempts %(attempts_left)s.\","},{"line_number":88,"context_line":"                          {\u0027mac\u0027: mac_address, \u0027attempts_left\u0027: attempt})"},{"line_number":89,"context_line":"        LOG.error(_(\"MAC generation error after %s attempts\"), max_retries)"},{"line_number":90,"context_line":"        raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def delete_dvr_mac_address(self, context, host):"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_f35430cc","line":89,"updated":"2014-06-29 11:47:14.000000000","message":"Can you please use the logging hint - _LE","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"15791591b174fe3ebc9df0555600a71ffa032e32","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                LOG.debug(\"Generated dvr mac %(mac)s exists.\""},{"line_number":87,"context_line":"                          \" Remaining attempts %(attempts_left)s.\","},{"line_number":88,"context_line":"                          {\u0027mac\u0027: mac_address, \u0027attempts_left\u0027: attempt})"},{"line_number":89,"context_line":"        LOG.error(_(\"MAC generation error after %s attempts\"), max_retries)"},{"line_number":90,"context_line":"        raise ext_dvr.MacAddressGenerationFailure(host\u003dhost)"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def delete_dvr_mac_address(self, context, host):"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_4e1d2f73","line":89,"in_reply_to":"dab895d6_f35430cc","updated":"2014-06-29 16:29:08.000000000","message":"could you clarify why? This seems to be used nowhere except openstack common","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"40a08c06cad08f13fd546d464938aa79e1431221","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":103,"context_line":"        if not host:"},{"line_number":104,"context_line":"            LOG.warn(_(\"get_dvr_mac_address_by_host, host input is empty\"))"},{"line_number":105,"context_line":"            return"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_135284dd","line":104,"updated":"2014-06-29 11:47:14.000000000","message":"_LW","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"15791591b174fe3ebc9df0555600a71ffa032e32","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":103,"context_line":"        if not host:"},{"line_number":104,"context_line":"            LOG.warn(_(\"get_dvr_mac_address_by_host, host input is empty\"))"},{"line_number":105,"context_line":"            return"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_ce085f30","line":104,"in_reply_to":"dab895d6_135284dd","updated":"2014-06-29 16:29:08.000000000","message":"as above","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"40a08c06cad08f13fd546d464938aa79e1431221","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            return self._create_dvr_mac_address(context, host)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _make_dvr_mac_address_dict(self, dvr_mac_entry, fields\u003dNone):"},{"line_number":113,"context_line":"        res \u003d {\u0027host\u0027: dvr_mac_entry[\u0027host\u0027],"},{"line_number":114,"context_line":"               \u0027mac_address\u0027: dvr_mac_entry[\u0027mac_address\u0027]}"},{"line_number":115,"context_line":"        return res"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_335ea8ea","line":113,"updated":"2014-06-29 11:47:14.000000000","message":"why not return {\u0027host\u0027...}","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"15791591b174fe3ebc9df0555600a71ffa032e32","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            return self._create_dvr_mac_address(context, host)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _make_dvr_mac_address_dict(self, dvr_mac_entry, fields\u003dNone):"},{"line_number":113,"context_line":"        res \u003d {\u0027host\u0027: dvr_mac_entry[\u0027host\u0027],"},{"line_number":114,"context_line":"               \u0027mac_address\u0027: dvr_mac_entry[\u0027mac_address\u0027]}"},{"line_number":115,"context_line":"        return res"},{"line_number":116,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_6e12f363","line":113,"in_reply_to":"dab895d6_335ea8ea","updated":"2014-06-29 16:29:08.000000000","message":"Done","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"bf7eeb4b440a834a9a92dd9999e88719c0d2f992","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @property"},{"line_number":53,"context_line":"    def plugin(self):"},{"line_number":54,"context_line":"        if self._plugin is None:"},{"line_number":55,"context_line":"            self._plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":56,"context_line":"        return self._plugin"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"baada198_b399c870","line":54,"updated":"2014-06-30 23:49:21.000000000","message":"if not getattr(self, \u0027_plugin\u0027, None):","commit_id":"9f33e770485ea79e42f03d0b6e81428909bb3e33"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"b177852b3f2c518307c7d10384150a4c26f1448e","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @property"},{"line_number":53,"context_line":"    def plugin(self):"},{"line_number":54,"context_line":"        if self._plugin is None:"},{"line_number":55,"context_line":"            self._plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":56,"context_line":"        return self._plugin"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"baada198_05601ca4","line":54,"updated":"2014-07-02 17:25:27.000000000","message":"I am getting this exception here (from q-agt):\n\n AttributeError: \u0027Ml2Plugin\u0027 object has no attribute \u0027_plugin\u0027 \n  Traceback (most recent call last): \n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 134, in _dispatch_and_reply \n     incoming.message))\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 177, in _dispatch^M\n      return self._do_dispatch(endpoint, method, ctxt, args)^M\n    File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 123, in _do_dispatch^M\n      result \u003d getattr(endpoint, method)(ctxt, **new_args)^M\n    File \"/opt/stack/neutron/neutron/plugins/ml2/rpc.py\", line 234, in get_subnet_for_dvr^M\n      subnet)^M\n    File \"/opt/stack/neutron/neutron/api/rpc/dvr_rpc.py\", line 83, in get_subnet_for_dvr^M\n      return self.plugin.get_subnet_for_dvr(context, subnet)^M\n    File \"/opt/stack/neutron/neutron/common/log.py\", line 34, in wrapper^M\n      return method(*args, **kwargs)^M\n    File \"/opt/stack/neutron/neutron/db/dvr_mac_db.py\", line 137, in get_subnet_for_dvr^M\n      subnet_info \u003d self.plugin.get_subnet(context, subnet)^M\n    File \"/opt/stack/neutron/neutron/db/dvr_mac_db.py\", line 54, in plugin^M\n      if self._plugin is None:^M\n \n  AttributeError: \u0027Ml2Plugin\u0027 object has no attribute \u0027_plugin\u0027^M\n\nSo use if not getattr(self, \u0027_plugin\u0027, None):","commit_id":"0e70bcd91c914013ebaaa7eb8880fc1a426054d8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b1ec327142e860bdbf0fa7a3a5d99c9acab7fcd5","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @property"},{"line_number":53,"context_line":"    def plugin(self):"},{"line_number":54,"context_line":"        if self._plugin is None:"},{"line_number":55,"context_line":"            self._plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":56,"context_line":"        return self._plugin"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"baada198_8296e24a","line":54,"updated":"2014-07-02 17:11:09.000000000","message":"In testing this code I got an AttributeError raised here.","commit_id":"0e70bcd91c914013ebaaa7eb8880fc1a426054d8"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"7d17b04e85a764fe38eafb28f9339eb280703c81","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @property"},{"line_number":53,"context_line":"    def plugin(self):"},{"line_number":54,"context_line":"        if self._plugin is None:"},{"line_number":55,"context_line":"            self._plugin \u003d manager.NeutronManager.get_plugin()"},{"line_number":56,"context_line":"        return self._plugin"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"baada198_9621c04f","line":54,"in_reply_to":"baada198_05601ca4","updated":"2014-07-02 18:25:34.000000000","message":"That is because constructor calls to base DVRDbMixin class donot land from plugin.py.\r\n\r\nBest is to change the above snip to\r\n @property\r\ndef plugin(self):\r\n    self._plugin \u003d manager.NeutronManager.get_plugin()\r\n    return self._plugin","commit_id":"0e70bcd91c914013ebaaa7eb8880fc1a426054d8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b1ec327142e860bdbf0fa7a3a5d99c9acab7fcd5","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":119,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"},{"line_number":120,"context_line":"        ports \u003d self.plugin.get_ports(context, filters\u003dfilter)"},{"line_number":121,"context_line":"        LOG.debug(\"List of Ports on subnet %{subnet} received as %{ports}\","},{"line_number":122,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":123,"context_line":"        for port in ports:"},{"line_number":124,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"}],"source_content_type":"text/x-python","patch_set":22,"id":"baada198_4284ca0b","line":121,"updated":"2014-07-02 17:11:09.000000000","message":"Should be %(subnet), %(ports), etc.  Don\u0027t use curly brace for this, an exception gets raised here that I\u0027ve seen.","commit_id":"0e70bcd91c914013ebaaa7eb8880fc1a426054d8"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"b1ec327142e860bdbf0fa7a3a5d99c9acab7fcd5","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                    port_dict \u003d self.plugin._make_port_dict("},{"line_number":127,"context_line":"                        port, process_extensions\u003dFalse)"},{"line_number":128,"context_line":"                    vm_ports_by_host.append(port_dict)"},{"line_number":129,"context_line":"        LOG.debug(\"Returning list of VM Ports on host %{host} for subnet \""},{"line_number":130,"context_line":"                  \" %{subnet} ports %{ports}\","},{"line_number":131,"context_line":"                  {\u0027host\u0027: host, \u0027subnet\u0027: subnet, \u0027ports\u0027: vm_ports_by_host})"},{"line_number":132,"context_line":"        return vm_ports_by_host"}],"source_content_type":"text/x-python","patch_set":22,"id":"baada198_429bea66","line":129,"updated":"2014-07-02 17:11:09.000000000","message":"Ditto for %(host), %(subnet), and %(ports) here.","commit_id":"0e70bcd91c914013ebaaa7eb8880fc1a426054d8"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"d4d987822abaf1d5e1a5d947289d928887fa03db","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":123,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"},{"line_number":124,"context_line":"        ports \u003d self.plugin.get_ports(context, filters\u003dfilter)"},{"line_number":125,"context_line":"        LOG.debug(\"List of Ports on subnet %(subnet) received as %(ports)\","},{"line_number":126,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":127,"context_line":"        for port in ports:"},{"line_number":128,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_0c244b0b","line":125,"updated":"2014-07-07 15:43:42.000000000","message":"%(subnet)s, %(ports)s","commit_id":"3b8174a8a0bff13221d02315930c8e34d8b733ef"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce85e680a9f4636b952ce2216badf141363c1338","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":123,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"},{"line_number":124,"context_line":"        ports \u003d self.plugin.get_ports(context, filters\u003dfilter)"},{"line_number":125,"context_line":"        LOG.debug(\"List of Ports on subnet %(subnet) received as %(ports)\","},{"line_number":126,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":127,"context_line":"        for port in ports:"},{"line_number":128,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_0f499d30","line":125,"in_reply_to":"baada198_0c244b0b","updated":"2014-07-07 15:46:42.000000000","message":"Done","commit_id":"3b8174a8a0bff13221d02315930c8e34d8b733ef"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"d4d987822abaf1d5e1a5d947289d928887fa03db","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                        port, process_extensions\u003dFalse)"},{"line_number":132,"context_line":"                    vm_ports_by_host.append(port_dict)"},{"line_number":133,"context_line":"        LOG.debug(\"Returning list of VM Ports on host %(host) for subnet \""},{"line_number":134,"context_line":"                  \" %(subnet) ports %(ports)\","},{"line_number":135,"context_line":"                  {\u0027host\u0027: host, \u0027subnet\u0027: subnet, \u0027ports\u0027: vm_ports_by_host})"},{"line_number":136,"context_line":"        return vm_ports_by_host"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_cc85f3cf","line":134,"updated":"2014-07-07 15:43:42.000000000","message":"%(subnet)s, %(ports)s.","commit_id":"3b8174a8a0bff13221d02315930c8e34d8b733ef"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ce85e680a9f4636b952ce2216badf141363c1338","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                        port, process_extensions\u003dFalse)"},{"line_number":132,"context_line":"                    vm_ports_by_host.append(port_dict)"},{"line_number":133,"context_line":"        LOG.debug(\"Returning list of VM Ports on host %(host) for subnet \""},{"line_number":134,"context_line":"                  \" %(subnet) ports %(ports)\","},{"line_number":135,"context_line":"                  {\u0027host\u0027: host, \u0027subnet\u0027: subnet, \u0027ports\u0027: vm_ports_by_host})"},{"line_number":136,"context_line":"        return vm_ports_by_host"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"baada198_2f54a1c8","line":134,"in_reply_to":"baada198_cc85f3cf","updated":"2014-07-07 15:46:42.000000000","message":"Done","commit_id":"3b8174a8a0bff13221d02315930c8e34d8b733ef"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5f06d839114ec8101421830f5eca3bf3025483fb","unresolved":false,"context_lines":[{"line_number":40,"context_line":"class DistributedVirtualRouterMacAddress(model_base.BASEV2):"},{"line_number":41,"context_line":"    \"\"\"Represents a v2 neutron distributed virtual router mac address.\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    __tablename__ \u003d \u0027dvr_host_macs\u0027"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    host \u003d sa.Column(sa.String(255), primary_key\u003dTrue, nullable\u003dFalse)"},{"line_number":46,"context_line":"    mac_address \u003d sa.Column(sa.String(32), nullable\u003dFalse, unique\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_aa7854f9","line":43,"updated":"2014-07-10 22:23:17.000000000","message":"Well, DVRHostMacs would have been a decent class name for me ;)","commit_id":"6e63fc2923909211f4de6ddd8c07d11da854f14d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5f06d839114ec8101421830f5eca3bf3025483fb","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    @property"},{"line_number":53,"context_line":"    def plugin(self):"},{"line_number":54,"context_line":"        try:"},{"line_number":55,"context_line":"            if self._plugin is not None:"},{"line_number":56,"context_line":"                return self._plugin"},{"line_number":57,"context_line":"        except AttributeError:"},{"line_number":58,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_8a739014","line":55,"updated":"2014-07-10 22:23:17.000000000","message":"why did you need the explicit comparison with None\u003e","commit_id":"6e63fc2923909211f4de6ddd8c07d11da854f14d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5f06d839114ec8101421830f5eca3bf3025483fb","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"},{"line_number":123,"context_line":"        ports \u003d self.plugin.get_ports(context, filters\u003dfilter)"},{"line_number":124,"context_line":"        LOG.debug(\"List of Ports on subnet %(subnet)s received as %(ports)s\","},{"line_number":125,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":126,"context_line":"        for port in ports:"},{"line_number":127,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"},{"line_number":128,"context_line":"                if port[\u0027binding:host_id\u0027] \u003d\u003d host:"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_8ae1d09c","line":125,"updated":"2014-07-10 22:23:17.000000000","message":"this will output a lot of stuff...","commit_id":"6e63fc2923909211f4de6ddd8c07d11da854f14d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def delete_dvr_mac_address(self, context, host):"},{"line_number":96,"context_line":"        query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":97,"context_line":"        query.filter(DistributedVirtualRouterMacAddress.host \u003d\u003d host).delete()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":100,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_3da3659f","line":97,"updated":"2014-07-10 23:46:51.000000000","message":"synchronize_sesison\u003dFalse passed to delete should make the operation faster","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def delete_dvr_mac_address(self, context, host):"},{"line_number":96,"context_line":"        query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":97,"context_line":"        query.filter(DistributedVirtualRouterMacAddress.host \u003d\u003d host).delete()"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def get_dvr_mac_address_list(self, context):"},{"line_number":100,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_232426ae","line":97,"in_reply_to":"baada198_3da3659f","updated":"2014-07-11 00:41:44.000000000","message":"Done","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":101,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":102,"context_line":"            dvrmacs \u003d query.all()"},{"line_number":103,"context_line":"            return dvrmacs"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":106,"context_line":"        if not host:"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_fde72de2","line":103,"updated":"2014-07-10 23:46:51.000000000","message":"depending on how this method is used you might not need all().\nAlso line 102 and 103 can be merged anyway.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":101,"context_line":"            query \u003d context.session.query(DistributedVirtualRouterMacAddress)"},{"line_number":102,"context_line":"            dvrmacs \u003d query.all()"},{"line_number":103,"context_line":"            return dvrmacs"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":106,"context_line":"        if not host:"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_235b462f","line":103,"in_reply_to":"baada198_fde72de2","updated":"2014-07-11 00:41:44.000000000","message":"Done","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        try:"},{"line_number":110,"context_line":"            return self._get_dvr_mac_address_by_host(context, host)"},{"line_number":111,"context_line":"        except ext_dvr.DVRMacAddressNotFound:"},{"line_number":112,"context_line":"            return self._create_dvr_mac_address(context, host)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _make_dvr_mac_address_dict(self, dvr_mac_entry, fields\u003dNone):"},{"line_number":115,"context_line":"        return {\u0027host\u0027: dvr_mac_entry[\u0027host\u0027],"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_7df23d9b","line":112,"updated":"2014-07-10 23:46:51.000000000","message":"a get that creates something is always a bit weird. anyway please just add a comment to explain the logic.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        try:"},{"line_number":110,"context_line":"            return self._get_dvr_mac_address_by_host(context, host)"},{"line_number":111,"context_line":"        except ext_dvr.DVRMacAddressNotFound:"},{"line_number":112,"context_line":"            return self._create_dvr_mac_address(context, host)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def _make_dvr_mac_address_dict(self, dvr_mac_entry, fields\u003dNone):"},{"line_number":115,"context_line":"        return {\u0027host\u0027: dvr_mac_entry[\u0027host\u0027],"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_834b3258","line":112,"in_reply_to":"baada198_7df23d9b","updated":"2014-07-11 00:41:44.000000000","message":"agreed, this is the usual neutron anti-pattern, I\u0027d love to get rid of it, but it\u0027s gonna take time","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    def get_compute_ports_on_host_by_subnet(self, context, host, subnet):"},{"line_number":120,"context_line":"        #FIXME(vivek): need to optimize this code to do away two-step filtering"},{"line_number":121,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":122,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"},{"line_number":123,"context_line":"        ports \u003d self.plugin.get_ports(context, filters\u003dfilter)"},{"line_number":124,"context_line":"        LOG.debug(\"List of Ports on subnet %(subnet)s received as %(ports)s\","},{"line_number":125,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_bd605536","line":122,"updated":"2014-07-10 23:46:51.000000000","message":"this kind of filter is also not really efficient in the underlying base plugin implentation","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    def get_compute_ports_on_host_by_subnet(self, context, host, subnet):"},{"line_number":120,"context_line":"        #FIXME(vivek): need to optimize this code to do away two-step filtering"},{"line_number":121,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":122,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"},{"line_number":123,"context_line":"        ports \u003d self.plugin.get_ports(context, filters\u003dfilter)"},{"line_number":124,"context_line":"        LOG.debug(\"List of Ports on subnet %(subnet)s received as %(ports)s\","},{"line_number":125,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_83909296","line":122,"in_reply_to":"baada198_bd605536","updated":"2014-07-11 00:41:44.000000000","message":"yup, according to the fixme, we\u0027d want to improve that. If I manage to fix it in time I\u0027ll post it here, otherwise I think there\u0027s scope for a follow-up patch","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":126,"context_line":"        for port in ports:"},{"line_number":127,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"},{"line_number":128,"context_line":"                if port[\u0027binding:host_id\u0027] \u003d\u003d host:"},{"line_number":129,"context_line":"                    port_dict \u003d self.plugin._make_port_dict("},{"line_number":130,"context_line":"                        port, process_extensions\u003dFalse)"},{"line_number":131,"context_line":"                    vm_ports_by_host.append(port_dict)"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_fd9f2d01","line":128,"updated":"2014-07-10 23:46:51.000000000","message":"we should be able to filter ports by bindings. Let me know if that does not work, I\u0027ll be happy to fix that for you.\n\nYou can use the host and the port\u0027s network as filters (perhaps you\u0027ll need to elevate the context for this operation, so bear in mind security implications).\n\nOnce that is done you can filter out ports which are not in your required subnet in python - I know you should not be doing this but if you consider that situation where one network has a subnet and ports which are not in that subnet is rather rare, I guess it will be ok.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":126,"context_line":"        for port in ports:"},{"line_number":127,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"},{"line_number":128,"context_line":"                if port[\u0027binding:host_id\u0027] \u003d\u003d host:"},{"line_number":129,"context_line":"                    port_dict \u003d self.plugin._make_port_dict("},{"line_number":130,"context_line":"                        port, process_extensions\u003dFalse)"},{"line_number":131,"context_line":"                    vm_ports_by_host.append(port_dict)"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_e32f8e3c","line":128,"in_reply_to":"baada198_fd9f2d01","updated":"2014-07-11 00:41:44.000000000","message":"This comment is somewhat related to the previous one; as far as I can tell filtering by port_binding does not work (hence the double-hop); I agree this can be more efficient.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                    vm_ports_by_host.append(port_dict)"},{"line_number":132,"context_line":"        LOG.debug(\"Returning list of VM Ports on host %(host)s for subnet \""},{"line_number":133,"context_line":"                  \" %(subnet)s ports %(ports)s\","},{"line_number":134,"context_line":"                  {\u0027host\u0027: host, \u0027subnet\u0027: subnet, \u0027ports\u0027: vm_ports_by_host})"},{"line_number":135,"context_line":"        return vm_ports_by_host"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @log.log"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_fdb64d89","line":134,"updated":"2014-07-10 23:46:51.000000000","message":"this is also logging a lot of stuff. Consider printing just port ids.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"29334736d3c743c595901a27fee95d2facd5b329","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                    vm_ports_by_host.append(port_dict)"},{"line_number":132,"context_line":"        LOG.debug(\"Returning list of VM Ports on host %(host)s for subnet \""},{"line_number":133,"context_line":"                  \" %(subnet)s ports %(ports)s\","},{"line_number":134,"context_line":"                  {\u0027host\u0027: host, \u0027subnet\u0027: subnet, \u0027ports\u0027: vm_ports_by_host})"},{"line_number":135,"context_line":"        return vm_ports_by_host"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @log.log"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_68dfd3d6","line":134,"in_reply_to":"baada198_c3e9aa1b","updated":"2014-07-11 07:37:01.000000000","message":"I\u0027m not sure I need all the attributes for every port.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                    vm_ports_by_host.append(port_dict)"},{"line_number":132,"context_line":"        LOG.debug(\"Returning list of VM Ports on host %(host)s for subnet \""},{"line_number":133,"context_line":"                  \" %(subnet)s ports %(ports)s\","},{"line_number":134,"context_line":"                  {\u0027host\u0027: host, \u0027subnet\u0027: subnet, \u0027ports\u0027: vm_ports_by_host})"},{"line_number":135,"context_line":"        return vm_ports_by_host"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    @log.log"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_c3e9aa1b","line":134,"in_reply_to":"baada198_fdb64d89","updated":"2014-07-11 00:41:44.000000000","message":"agreed, but wouldn\u0027t you wish you had this information when looking at a stacktrace? :)","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet],"},{"line_number":146,"context_line":"                                    \u0027ip_address\u0027: [subnet_info[\u0027gateway_ip\u0027]]}}"},{"line_number":147,"context_line":"            internal_gateway_ports \u003d self.plugin.get_ports("},{"line_number":148,"context_line":"                context, filters\u003dfilter)"},{"line_number":149,"context_line":"            if not internal_gateway_ports:"},{"line_number":150,"context_line":"                LOG.error(_(\"Could not retrieve gateway port \""},{"line_number":151,"context_line":"                            \"for subnet %s\"), subnet_info)"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_7d815d8e","line":148,"updated":"2014-07-10 23:46:51.000000000","message":"wouldn\u0027t it be better to query by device_owner: network_router_interface and then if you get more than one port pick the one with subnet_info[\u0027gateway_ip\u0027] ?","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet],"},{"line_number":146,"context_line":"                                    \u0027ip_address\u0027: [subnet_info[\u0027gateway_ip\u0027]]}}"},{"line_number":147,"context_line":"            internal_gateway_ports \u003d self.plugin.get_ports("},{"line_number":148,"context_line":"                context, filters\u003dfilter)"},{"line_number":149,"context_line":"            if not internal_gateway_ports:"},{"line_number":150,"context_line":"                LOG.error(_(\"Could not retrieve gateway port \""},{"line_number":151,"context_line":"                            \"for subnet %s\"), subnet_info)"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_a31596e6","line":148,"in_reply_to":"baada198_7d815d8e","updated":"2014-07-11 00:41:44.000000000","message":"how so? The resultset should be a list of one element here.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"29334736d3c743c595901a27fee95d2facd5b329","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet],"},{"line_number":146,"context_line":"                                    \u0027ip_address\u0027: [subnet_info[\u0027gateway_ip\u0027]]}}"},{"line_number":147,"context_line":"            internal_gateway_ports \u003d self.plugin.get_ports("},{"line_number":148,"context_line":"                context, filters\u003dfilter)"},{"line_number":149,"context_line":"            if not internal_gateway_ports:"},{"line_number":150,"context_line":"                LOG.error(_(\"Could not retrieve gateway port \""},{"line_number":151,"context_line":"                            \"for subnet %s\"), subnet_info)"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_28007b33","line":148,"in_reply_to":"baada198_a31596e6","updated":"2014-07-11 07:37:01.000000000","message":"it was just because the query by ip address is a bit convoluted in the implementation","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d4bb860853bbdf4cf8c8806d72ebec180699494f","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                              \"is %(mac_address)s\","},{"line_number":84,"context_line":"                              {\u0027host\u0027: host, \u0027mac_address\u0027: mac_address})"},{"line_number":85,"context_line":"                dvr_macs \u003d self.get_dvr_mac_address_list(context)"},{"line_number":86,"context_line":"                self.notifier.dvr_mac_address_update(context, dvr_macs)"},{"line_number":87,"context_line":"                return self._make_dvr_mac_address_dict(dvr_mac_binding)"},{"line_number":88,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":89,"context_line":"                LOG.debug(\"Generated dvr mac %(mac)s exists.\""}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_0bfad1bc","line":86,"updated":"2014-07-11 07:57:45.000000000","message":"This line needs https://review.openstack.org/#/c/102332 which depends on this patch. I think this line should not be here.\n\nAlso since the duplicated entry exception is raised at commit, perhaps should the notification happen outside of the transaction.\n\nMoreover, to add more meat on the grill, notifying from within a transaction will trigger an eventlet greenthread yield, and I\u0027m sure you know what that means.","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ed1498dd6d24d380d90ed5ec65c3715059e2c55e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                              \"is %(mac_address)s\","},{"line_number":84,"context_line":"                              {\u0027host\u0027: host, \u0027mac_address\u0027: mac_address})"},{"line_number":85,"context_line":"                dvr_macs \u003d self.get_dvr_mac_address_list(context)"},{"line_number":86,"context_line":"                self.notifier.dvr_mac_address_update(context, dvr_macs)"},{"line_number":87,"context_line":"                return self._make_dvr_mac_address_dict(dvr_mac_binding)"},{"line_number":88,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":89,"context_line":"                LOG.debug(\"Generated dvr mac %(mac)s exists.\""}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_d4894227","line":86,"in_reply_to":"baada198_0bfad1bc","updated":"2014-07-11 17:10:24.000000000","message":"I\u0027ll move it over, however this does happen outside the transaction.","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d4bb860853bbdf4cf8c8806d72ebec180699494f","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @log.log"},{"line_number":121,"context_line":"    def get_compute_ports_on_host_by_subnet(self, context, host, subnet):"},{"line_number":122,"context_line":"        # FIXME(vivek, salv-orlando): optmize this query by adding the"},{"line_number":123,"context_line":"        # capability of filtering by binding:host_id"},{"line_number":124,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":125,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_8bd42121","line":122,"updated":"2014-07-11 07:57:45.000000000","message":"ahhhhh typo!!!\nI\u0027m so giving you a -1 for this\n\nmuahahahahah","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ed1498dd6d24d380d90ed5ec65c3715059e2c55e","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @log.log"},{"line_number":121,"context_line":"    def get_compute_ports_on_host_by_subnet(self, context, host, subnet):"},{"line_number":122,"context_line":"        # FIXME(vivek, salv-orlando): optmize this query by adding the"},{"line_number":123,"context_line":"        # capability of filtering by binding:host_id"},{"line_number":124,"context_line":"        vm_ports_by_host \u003d []"},{"line_number":125,"context_line":"        filter \u003d {\u0027fixed_ips\u0027: {\u0027subnet_id\u0027: [subnet]}}"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_8955f71f","line":122,"in_reply_to":"baada198_8bd42121","updated":"2014-07-11 17:10:24.000000000","message":"doh!","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2f963e4cc7522741c24fc9c7a09c43ca5f462675","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                    dvr_mac_binding \u003d DistributedVirtualRouterMacAddress("},{"line_number":81,"context_line":"                        host\u003dhost, mac_address\u003dmac_address)"},{"line_number":82,"context_line":"                    context.session.add(dvr_mac_binding)"},{"line_number":83,"context_line":"                    LOG.debug(\"Generated dvr mac for host %(host)s \""},{"line_number":84,"context_line":"                              \"is %(mac_address)s\","},{"line_number":85,"context_line":"                              {\u0027host\u0027: host, \u0027mac_address\u0027: mac_address})"},{"line_number":86,"context_line":"                return self._make_dvr_mac_address_dict(dvr_mac_binding)"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_2108db27","line":83,"updated":"2014-07-16 20:32:24.000000000","message":"nit: s/dvr/DVR","commit_id":"13309e01f8a5c6cbd5765951b6f4c19ab62fb5e1"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2f963e4cc7522741c24fc9c7a09c43ca5f462675","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                              {\u0027host\u0027: host, \u0027mac_address\u0027: mac_address})"},{"line_number":86,"context_line":"                return self._make_dvr_mac_address_dict(dvr_mac_binding)"},{"line_number":87,"context_line":"            except db_exc.DBDuplicateEntry:"},{"line_number":88,"context_line":"                LOG.debug(\"Generated dvr mac %(mac)s exists.\""},{"line_number":89,"context_line":"                          \" Remaining attempts %(attempts_left)s.\","},{"line_number":90,"context_line":"                          {\u0027mac\u0027: mac_address, \u0027attempts_left\u0027: attempt})"},{"line_number":91,"context_line":"        LOG.error(_(\"MAC generation error after %s attempts\"), max_retries)"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_810e0731","line":88,"updated":"2014-07-16 20:32:24.000000000","message":"nit: s/dvr/DVR","commit_id":"13309e01f8a5c6cbd5765951b6f4c19ab62fb5e1"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ba99aa4b929d0ff9c647a3babd5326bf90bc557b","unresolved":false,"context_lines":[{"line_number":105,"context_line":"    def get_dvr_mac_address_by_host(self, context, host):"},{"line_number":106,"context_line":"        \"\"\"Determine the MAC for the DVR port associated to host.\"\"\""},{"line_number":107,"context_line":"        if not host:"},{"line_number":108,"context_line":"            return"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        try:"},{"line_number":111,"context_line":"            return self._get_dvr_mac_address_by_host(context, host)"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_407b06be","line":108,"updated":"2014-07-17 17:02:27.000000000","message":"nit:  I\u0027m not sure what this is for.  Seems like it may mask a problem that the caller is calling without a valid host.","commit_id":"13309e01f8a5c6cbd5765951b6f4c19ab62fb5e1"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ba99aa4b929d0ff9c647a3babd5326bf90bc557b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        LOG.debug(\"List of Ports on subnet %(subnet)s received as %(ports)s\","},{"line_number":127,"context_line":"                  {\u0027subnet\u0027: subnet, \u0027ports\u0027: ports})"},{"line_number":128,"context_line":"        for port in ports:"},{"line_number":129,"context_line":"            if \u0027compute:\u0027 in port[\u0027device_owner\u0027]:"},{"line_number":130,"context_line":"                if port[\u0027binding:host_id\u0027] \u003d\u003d host:"},{"line_number":131,"context_line":"                    port_dict \u003d self.plugin._make_port_dict("},{"line_number":132,"context_line":"                        port, process_extensions\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_c014764f","line":129,"updated":"2014-07-17 17:02:27.000000000","message":"Out of scope:  I guess this can\u0027t be done by passing a filter.  It would be better if it could from a query efficiency stand-point.","commit_id":"13309e01f8a5c6cbd5765951b6f4c19ab62fb5e1"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ba99aa4b929d0ff9c647a3babd5326bf90bc557b","unresolved":false,"context_lines":[{"line_number":137,"context_line":"        return vm_ports_by_host"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    @log.log"},{"line_number":140,"context_line":"    def get_subnet_for_dvr(self, context, subnet):"},{"line_number":141,"context_line":"        try:"},{"line_number":142,"context_line":"            subnet_info \u003d self.plugin.get_subnet(context, subnet)"},{"line_number":143,"context_line":"        except q_exc.SubnetNotFound:"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_a356ac04","line":140,"updated":"2014-07-17 17:02:27.000000000","message":"Out of scope:  I wonder if a later refactor should push this down in to the plugin or something to avoid more queries than necessary.","commit_id":"13309e01f8a5c6cbd5765951b6f4c19ab62fb5e1"}],"neutron/db/migration/alembic_migrations/versions/2026156eab2f_l2_dvr_models.py":[{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"ced3cb91bd56fad757fe85325c012e2d4cb2ec9a","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                  nullable\u003dFalse, server_default\u003d\u0027\u0027),"},{"line_number":61,"context_line":"        sa.Column(\u0027cap_port_filter\u0027, sa.Boolean(), nullable\u003dFalse),"},{"line_number":62,"context_line":"        sa.Column(\u0027driver\u0027, sa.String(length\u003d64), nullable\u003dTrue),"},{"line_number":63,"context_line":"        sa.Column(\u0027segment\u0027, sa.String(length\u003d36), nullable\u003dTrue),"},{"line_number":64,"context_line":"        sa.Column(u\u0027status\u0027, sa.String(16), nullable\u003dFalse),"},{"line_number":65,"context_line":"        sa.ForeignKeyConstraint([\u0027port_id\u0027], [\u0027ports.id\u0027],"},{"line_number":66,"context_line":"                                ondelete\u003d\u0027CASCADE\u0027),"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_2f901f4d","line":63,"updated":"2014-06-27 22:38:33.000000000","message":"If segment is a foreign key, then nullable should be False.  I don\u0027t think there will be a null segment id.","commit_id":"42c8712c0760387719f1955199ea83e659e90e03"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e85763be0d6127dc2f63333a87986964954d65cf","unresolved":false,"context_lines":[{"line_number":60,"context_line":"                  nullable\u003dFalse, server_default\u003d\u0027\u0027),"},{"line_number":61,"context_line":"        sa.Column(\u0027cap_port_filter\u0027, sa.Boolean(), nullable\u003dFalse),"},{"line_number":62,"context_line":"        sa.Column(\u0027driver\u0027, sa.String(length\u003d64), nullable\u003dTrue),"},{"line_number":63,"context_line":"        sa.Column(\u0027segment\u0027, sa.String(length\u003d36), nullable\u003dTrue),"},{"line_number":64,"context_line":"        sa.Column(u\u0027status\u0027, sa.String(16), nullable\u003dFalse),"},{"line_number":65,"context_line":"        sa.ForeignKeyConstraint([\u0027port_id\u0027], [\u0027ports.id\u0027],"},{"line_number":66,"context_line":"                                ondelete\u003d\u0027CASCADE\u0027),"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_de2e8af9","line":63,"in_reply_to":"1ae5cdf2_2f901f4d","updated":"2014-06-28 00:28:01.000000000","message":"see foreign key constraint below.","commit_id":"42c8712c0760387719f1955199ea83e659e90e03"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"049d37986bf42b9106c74f8561c6328346e6d651","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                                ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":67,"context_line":"        sa.ForeignKeyConstraint([\u0027segment\u0027], [\u0027ml2_network_segments.id\u0027],"},{"line_number":68,"context_line":"                                ondelete\u003d\u0027SET NULL\u0027),"},{"line_number":69,"context_line":"        sa.PrimaryKeyConstraint(\u0027port_id\u0027)"},{"line_number":70,"context_line":"    )"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_bca6a251","line":69,"updated":"2014-07-02 21:06:49.000000000","message":"I don\u0027t think this is correct.  I\u0027m getting a DBDuplicateEntry trying to insert an entry for a second host.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5e7af8479e4b032f004da1418e3ecd26b27102ed","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                                ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":67,"context_line":"        sa.ForeignKeyConstraint([\u0027segment\u0027], [\u0027ml2_network_segments.id\u0027],"},{"line_number":68,"context_line":"                                ondelete\u003d\u0027SET NULL\u0027),"},{"line_number":69,"context_line":"        sa.PrimaryKeyConstraint(\u0027port_id\u0027)"},{"line_number":70,"context_line":"    )"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_71c0ac7c","line":69,"in_reply_to":"baada198_68dc44e5","updated":"2014-07-03 00:34:55.000000000","message":"Actually the model was correct, this only needed to look like:\n\nsa.PrimaryKeyConstraint(\u0027port_id\u0027, \u0027host\u0027)\n\nSmall nit, great impact ;)","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"80a667d85861633092033bd7432fbf2b4af6eff4","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                                ondelete\u003d\u0027CASCADE\u0027),"},{"line_number":67,"context_line":"        sa.ForeignKeyConstraint([\u0027segment\u0027], [\u0027ml2_network_segments.id\u0027],"},{"line_number":68,"context_line":"                                ondelete\u003d\u0027SET NULL\u0027),"},{"line_number":69,"context_line":"        sa.PrimaryKeyConstraint(\u0027port_id\u0027)"},{"line_number":70,"context_line":"    )"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_68dc44e5","line":69,"in_reply_to":"baada198_bca6a251","updated":"2014-07-02 23:52:41.000000000","message":"If the model changes, the migration needs to change too.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"4e241288566a3eb7414663e2f1baba7c845be9b5","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"migration_for_plugins \u003d ["},{"line_number":29,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":30,"context_line":"]"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"from alembic import op"},{"line_number":33,"context_line":"import sqlalchemy as sa"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_1d2a732c","line":30,"updated":"2014-07-16 11:14:41.000000000","message":"Migrations should be unconditional.","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bc83aa8930c6bb034428ad3ce2dd47a387d592f0","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":"migration_for_plugins \u003d ["},{"line_number":29,"context_line":"    \u0027neutron.plugins.ml2.plugin.Ml2Plugin\u0027"},{"line_number":30,"context_line":"]"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"from alembic import op"},{"line_number":33,"context_line":"import sqlalchemy as sa"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_2a24440d","line":30,"in_reply_to":"baada198_1d2a732c","updated":"2014-07-16 14:55:42.000000000","message":"Done","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"}],"neutron/db/migration/models/head.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a6d6e4a358cf9a07f4d856d9fb3e7b4561118f49","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.db import agents_db  # noqa"},{"line_number":25,"context_line":"from neutron.db import agentschedulers_db  # noqa"},{"line_number":26,"context_line":"from neutron.db import allowedaddresspairs_db  # noqa"},{"line_number":27,"context_line":"from neutron.db import dvr_mac_db  # noqa"},{"line_number":28,"context_line":"from neutron.db import external_net_db  # noqa"},{"line_number":29,"context_line":"from neutron.db import extradhcpopt_db  # noqa"},{"line_number":30,"context_line":"from neutron.db import extraroute_db  # noqa"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_e325ddae","line":27,"updated":"2014-07-17 17:04:35.000000000","message":"This seems like a maintenance problem here.  Without Ann\u0027s comment on PS39, we wouldn\u0027t have caught this.  How are we supposed to catch this in future patches?","commit_id":"10579d28d71bd8aba88d7eb83c6a0e293cae616d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f03f6c604cc5785a0f54daf5027f8dcf5fe6f5bf","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.db import agents_db  # noqa"},{"line_number":25,"context_line":"from neutron.db import agentschedulers_db  # noqa"},{"line_number":26,"context_line":"from neutron.db import allowedaddresspairs_db  # noqa"},{"line_number":27,"context_line":"from neutron.db import dvr_mac_db  # noqa"},{"line_number":28,"context_line":"from neutron.db import external_net_db  # noqa"},{"line_number":29,"context_line":"from neutron.db import extradhcpopt_db  # noqa"},{"line_number":30,"context_line":"from neutron.db import extraroute_db  # noqa"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_e336bdb3","line":27,"in_reply_to":"baada198_e325ddae","updated":"2014-07-17 17:11:07.000000000","message":"I tried to be careful on the other patches but I missed this one. My understanding is that only new DB model files should be added here. This is a tricky one to automate, but I didn\u0027t think very hard...","commit_id":"10579d28d71bd8aba88d7eb83c6a0e293cae616d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"4957b246448575c5a2690299f1dc105f162514d2","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.db import agents_db  # noqa"},{"line_number":25,"context_line":"from neutron.db import agentschedulers_db  # noqa"},{"line_number":26,"context_line":"from neutron.db import allowedaddresspairs_db  # noqa"},{"line_number":27,"context_line":"from neutron.db import dvr_mac_db  # noqa"},{"line_number":28,"context_line":"from neutron.db import external_net_db  # noqa"},{"line_number":29,"context_line":"from neutron.db import extradhcpopt_db  # noqa"},{"line_number":30,"context_line":"from neutron.db import extraroute_db  # noqa"}],"source_content_type":"text/x-python","patch_set":40,"id":"baada198_52448d1a","line":27,"in_reply_to":"baada198_e336bdb3","updated":"2014-07-17 19:13:15.000000000","message":"I think anna suggested she\u0027s taking care of adding a test for this.","commit_id":"10579d28d71bd8aba88d7eb83c6a0e293cae616d"}],"neutron/extensions/dvr.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"40a08c06cad08f13fd546d464938aa79e1431221","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import abc"},{"line_number":16,"context_line":"import six"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.api.v2 import attributes"},{"line_number":19,"context_line":"from neutron.common import constants"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_735820fb","line":16,"updated":"2014-06-29 11:47:14.000000000","message":"six tis third party. it should be in its own section","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"15791591b174fe3ebc9df0555600a71ffa032e32","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import abc"},{"line_number":16,"context_line":"import six"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.api.v2 import attributes"},{"line_number":19,"context_line":"from neutron.common import constants"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_42ffc301","line":16,"in_reply_to":"dab895d6_735820fb","updated":"2014-06-29 16:29:08.000000000","message":"Done","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"5f06d839114ec8101421830f5eca3bf3025483fb","unresolved":false,"context_lines":[{"line_number":81,"context_line":"            return {}"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"@six.add_metaclass(abc.ABCMeta)"},{"line_number":85,"context_line":"class DVRMacAddressPluginBase(object):"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":29,"id":"baada198_ead08ccb","line":84,"updated":"2014-07-10 22:23:17.000000000","message":"I\u0027m not opposed to this base class... still I don\u0027t see a compelling reason for having it.","commit_id":"6e63fc2923909211f4de6ddd8c07d11da854f14d"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.api.v2 import attributes"},{"line_number":20,"context_line":"from neutron.common import constants"},{"line_number":21,"context_line":"from neutron.common import exceptions as qexception"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"DISTRIBUTED \u003d \u0027distributed\u0027"},{"line_number":24,"context_line":"EXTENDED_ATTRIBUTES_2_0 \u003d {"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_fd448d75","line":21,"updated":"2014-07-10 23:46:51.000000000","message":"it\u0027s been neutron for a while now... let\u0027s not use \u0027q\u0027s anymore!","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.api.v2 import attributes"},{"line_number":20,"context_line":"from neutron.common import constants"},{"line_number":21,"context_line":"from neutron.common import exceptions as qexception"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"DISTRIBUTED \u003d \u0027distributed\u0027"},{"line_number":24,"context_line":"EXTENDED_ATTRIBUTES_2_0 \u003d {"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_c3d36a36","line":21,"in_reply_to":"baada198_fd448d75","updated":"2014-07-11 00:41:44.000000000","message":"Done","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2f963e4cc7522741c24fc9c7a09c43ca5f462675","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"class MacAddressGenerationFailure(exceptions.ServiceUnavailable):"},{"line_number":42,"context_line":"    message \u003d _(\"Unable to generate unique dvr mac for host %(host)s.\")"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"class Dvr(object):"}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_c672d510","line":42,"updated":"2014-07-16 20:32:24.000000000","message":"nit: s/dvr/DVR","commit_id":"13309e01f8a5c6cbd5765951b6f4c19ab62fb5e1"}],"neutron/plugins/ml2/db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"def get_dvr_port_binding_by_host(port_id, host, session\u003dNone):"},{"line_number":183,"context_line":"    if not session:"},{"line_number":184,"context_line":"        session \u003d db_api.get_session()"},{"line_number":185,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            query \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_cbb49884","line":184,"updated":"2014-06-24 20:00:58.000000000","message":"I\u0027m curious why this method is called differently from the previous method in that passing \"session\" is optional.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"def get_dvr_port_binding_by_host(port_id, host, session\u003dNone):"},{"line_number":183,"context_line":"    if not session:"},{"line_number":184,"context_line":"        session \u003d db_api.get_session()"},{"line_number":185,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            query \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_ae091534","line":184,"in_reply_to":"1ae5cdf2_cbb49884","updated":"2014-06-24 22:57:16.000000000","message":"I don\u0027t seem to find a coherent logic within this file either...not sure why.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            query \u003d (session.query(models.DVRPortBinding)."},{"line_number":188,"context_line":"                     filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":189,"context_line":"                            models.DVRPortBinding.host \u003d\u003d host).one())"},{"line_number":190,"context_line":"        except exc.NoResultFound:"},{"line_number":191,"context_line":"            LOG.debug(\"No binding found for DVR port %(port_id) with\""}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_8b48d08b","line":188,"updated":"2014-06-24 20:00:58.000000000","message":"Why startswith?  I don\u0027t think that it makes sense to match part of a port id which is itself a UUID.  With UUIDs, either it matches or not.  There is no globbing or pattern matching, is there?","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            query \u003d (session.query(models.DVRPortBinding)."},{"line_number":188,"context_line":"                     filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":189,"context_line":"                            models.DVRPortBinding.host \u003d\u003d host).one())"},{"line_number":190,"context_line":"        except exc.NoResultFound:"},{"line_number":191,"context_line":"            LOG.debug(\"No binding found for DVR port %(port_id) with\""}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_7921959d","line":188,"in_reply_to":"1ae5cdf2_8b48d08b","updated":"2014-06-24 22:57:16.000000000","message":"I guess you are right but I need to refer to Vivek for this","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                      \"host %(host)\","},{"line_number":193,"context_line":"                      {\u0027port_id\u0027: port_id, \u0027host\u0027: host})"},{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":"    return query"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"def get_dvr_port_bindings(port_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_867287ae","line":195,"updated":"2014-06-24 20:00:58.000000000","message":"See suggestion on L209.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                      \"host %(host)\","},{"line_number":193,"context_line":"                      {\u0027port_id\u0027: port_id, \u0027host\u0027: host})"},{"line_number":194,"context_line":"            return"},{"line_number":195,"context_line":"    return query"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"def get_dvr_port_bindings(port_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_5955b9f8","line":195,"in_reply_to":"1ae5cdf2_867287ae","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":201,"context_line":"        try:"},{"line_number":202,"context_line":"            query \u003d (session.query(models.DVRPortBinding)."},{"line_number":203,"context_line":"                     filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":204,"context_line":"                     all())"},{"line_number":205,"context_line":"        except exc.NoResultFound:"},{"line_number":206,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_ab190c89","line":203,"updated":"2014-06-24 20:00:58.000000000","message":"See L188.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":200,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":201,"context_line":"        try:"},{"line_number":202,"context_line":"            query \u003d (session.query(models.DVRPortBinding)."},{"line_number":203,"context_line":"                     filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":204,"context_line":"                     all())"},{"line_number":205,"context_line":"        except exc.NoResultFound:"},{"line_number":206,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_b9395dd1","line":203,"in_reply_to":"1ae5cdf2_ab190c89","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        except exc.NoResultFound:"},{"line_number":206,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":207,"context_line":"                      {\u0027port_id\u0027: port_id})"},{"line_number":208,"context_line":"            return"},{"line_number":209,"context_line":"    return query"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_063f57b6","line":208,"updated":"2014-06-24 20:00:58.000000000","message":"Remove return statement if L209 is moved to L203 (see below).","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        except exc.NoResultFound:"},{"line_number":206,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":207,"context_line":"                      {\u0027port_id\u0027: port_id})"},{"line_number":208,"context_line":"            return"},{"line_number":209,"context_line":"    return query"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_d948e95e","line":208,"in_reply_to":"1ae5cdf2_063f57b6","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":207,"context_line":"                      {\u0027port_id\u0027: port_id})"},{"line_number":208,"context_line":"            return"},{"line_number":209,"context_line":"    return query"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_c61e4f5f","line":209,"updated":"2014-06-24 20:00:58.000000000","message":"Suggestion:  Just return on L203.  IMO, it improves the flow and reability to return as soon as the return value is known and there is nothing left to do.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":207,"context_line":"                      {\u0027port_id\u0027: port_id})"},{"line_number":208,"context_line":"            return"},{"line_number":209,"context_line":"    return query"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_197251b0","line":209,"in_reply_to":"1ae5cdf2_c61e4f5f","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0178ddfb10603aa0f5240f11f6737dab51daf2d6","unresolved":false,"context_lines":[{"line_number":181,"context_line":""},{"line_number":182,"context_line":"def get_dvr_port_binding_by_host(port_id, host, session\u003dNone):"},{"line_number":183,"context_line":"    if not session:"},{"line_number":184,"context_line":"        session \u003d db_api.get_session()"},{"line_number":185,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            #FIXME(vivek): shouldn\u0027t we check for equality between uuid\u0027s?"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_51b82de8","line":184,"updated":"2014-06-25 03:39:49.000000000","message":"See PS2 comment","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0178ddfb10603aa0f5240f11f6737dab51daf2d6","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            #FIXME(vivek): shouldn\u0027t we check for equality between uuid\u0027s?"},{"line_number":188,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":189,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":190,"context_line":"                           models.DVRPortBinding.host \u003d\u003d host).one())"},{"line_number":191,"context_line":"        except exc.NoResultFound:"},{"line_number":192,"context_line":"            LOG.debug(\"No binding found for DVR port %(port_id) with\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_71d4491f","line":189,"updated":"2014-06-25 03:39:49.000000000","message":"See PS2 comment.  If startswith isn\u0027t necessary then I\u0027d prefer to use a \u003d\u003d comparison.  Using startswith make readers wonder if there is more to it than just \u003d\u003d.  It breaks the principle of least surprise.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c795ff2cda271bd21039b6aa10d27fdd7d0a87ee","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            #FIXME(vivek): shouldn\u0027t we check for equality between uuid\u0027s?"},{"line_number":188,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":189,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":190,"context_line":"                           models.DVRPortBinding.host \u003d\u003d host).one())"},{"line_number":191,"context_line":"        except exc.NoResultFound:"},{"line_number":192,"context_line":"            LOG.debug(\"No binding found for DVR port %(port_id) with\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_4a0ea28d","line":189,"in_reply_to":"1ae5cdf2_046ae580","updated":"2014-06-25 14:51:43.000000000","message":"Vivek, you have a good point.  I\u0027ll post a refactor to change them and see if that can be accepted.  For now, I\u0027m okay with you following the pattern here.  I\u0027d also be okay if you wanted to not follow the pattern.  Some patterns just shouldn\u0027t be followed.\n\nWhat I would *not* suggest is changing the other occurrences in this patch.  Keep this patch focused on its stated purpose.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"6a93b0cf870ca03eee7a170773453c920f292e5b","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            #FIXME(vivek): shouldn\u0027t we check for equality between uuid\u0027s?"},{"line_number":188,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":189,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":190,"context_line":"                           models.DVRPortBinding.host \u003d\u003d host).one())"},{"line_number":191,"context_line":"        except exc.NoResultFound:"},{"line_number":192,"context_line":"            LOG.debug(\"No binding found for DVR port %(port_id) with\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_3500cd34","line":189,"in_reply_to":"1ae5cdf2_4a0ea28d","updated":"2014-06-25 18:57:50.000000000","message":"I looked just a little further in to this for a minute.  There are some methods (get_port_from_device) that may be using a device name to look up a port.  In this case, the device name would only have part of the port\u0027s uuid.  So, I might just leave this one alone.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"fe3dbb9b2a5099302c778ff4a249647dd4e36615","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            #FIXME(vivek): shouldn\u0027t we check for equality between uuid\u0027s?"},{"line_number":188,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":189,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":190,"context_line":"                           models.DVRPortBinding.host \u003d\u003d host).one())"},{"line_number":191,"context_line":"        except exc.NoResultFound:"},{"line_number":192,"context_line":"            LOG.debug(\"No binding found for DVR port %(port_id) with\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_046ae580","line":189,"in_reply_to":"1ae5cdf2_71d4491f","updated":"2014-06-25 04:02:07.000000000","message":"if we look at existing get_port_binding_by_host() method in this file, it uses the startsWith logic.  That made me follow the same principle here.  If this is incorrect, that method needs to be fixed as well.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0178ddfb10603aa0f5240f11f6737dab51daf2d6","unresolved":false,"context_lines":[{"line_number":199,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":200,"context_line":"        try:"},{"line_number":201,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":202,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":203,"context_line":"                    all())"},{"line_number":204,"context_line":"        except exc.NoResultFound:"},{"line_number":205,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_11ef85ea","line":202,"updated":"2014-06-25 03:39:49.000000000","message":"Same","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"9ba28a2505a42d6cfc614f8439887674b61c2620","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return record"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"def ensure_dvr_port_binding(session, port_id, host, router_id\u003dNone):"},{"line_number":75,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            record \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_cc9b5bc7","line":74,"updated":"2014-06-27 13:06:06.000000000","message":"that method looks vulnerable to race conditions. Possible solution would be to use similar approach as in scheduler/dhcp_agent_scheduler.py or use session.merge()","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6eea5a2a224db080af9f18f1626614af5c06ded5","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return record"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"def ensure_dvr_port_binding(session, port_id, host, router_id\u003dNone):"},{"line_number":75,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            record \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_96ccf562","line":74,"in_reply_to":"1ae5cdf2_400f0739","updated":"2014-06-27 18:21:56.000000000","message":"cool, thanks...pushing new patch shortly.","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"512d02504f88ad5c8ee8bfdee01bdc2506239bb5","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return record"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"def ensure_dvr_port_binding(session, port_id, host, router_id\u003dNone):"},{"line_number":75,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            record \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_400f0739","line":74,"in_reply_to":"1ae5cdf2_8535a1dc","updated":"2014-06-27 17:26:39.000000000","message":"I think FIXME here, and then fix later with different bug should be fine.","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a46987a0851ba581c58956267f778cb634858e7","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return record"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"def ensure_dvr_port_binding(session, port_id, host, router_id\u003dNone):"},{"line_number":75,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            record \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_8535a1dc","line":74,"in_reply_to":"1ae5cdf2_cc9b5bc7","updated":"2014-06-27 16:31:46.000000000","message":"It looks like ensure_port_binding above is affected by the same race, shall I add a FIXME here, file a bug, fix it elsewhere and ensure this method aligns with the right way to do it?","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"9ba28a2505a42d6cfc614f8439887674b61c2620","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            session.query(models.DVRPortBinding).filter_by("},{"line_number":97,"context_line":"                port_id\u003dport_id, host\u003dhost).delete()"},{"line_number":98,"context_line":"        except exc.NoResultFound:"},{"line_number":99,"context_line":"            LOG.error(_(\"Unable to find binding for dvr port %s \"), port_id)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_4cf90bc7","line":98,"updated":"2014-06-27 13:06:06.000000000","message":"that operation should not throw NoResultFound","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a46987a0851ba581c58956267f778cb634858e7","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        try:"},{"line_number":96,"context_line":"            session.query(models.DVRPortBinding).filter_by("},{"line_number":97,"context_line":"                port_id\u003dport_id, host\u003dhost).delete()"},{"line_number":98,"context_line":"        except exc.NoResultFound:"},{"line_number":99,"context_line":"            LOG.error(_(\"Unable to find binding for dvr port %s \"), port_id)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_a2029309","line":98,"in_reply_to":"1ae5cdf2_4cf90bc7","updated":"2014-06-27 16:31:46.000000000","message":"Done","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"9ba28a2505a42d6cfc614f8439887674b61c2620","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    if not session:"},{"line_number":184,"context_line":"        session \u003d db_api.get_session()"},{"line_number":185,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            #FIXME(vivek): shouldn\u0027t we check for equality between uuid\u0027s?"},{"line_number":188,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":189,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id),"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_cc4d1b74","line":186,"updated":"2014-06-27 13:06:06.000000000","message":"try-except may be omitted if query.first() is used","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a46987a0851ba581c58956267f778cb634858e7","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    if not session:"},{"line_number":184,"context_line":"        session \u003d db_api.get_session()"},{"line_number":185,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            #FIXME(vivek): shouldn\u0027t we check for equality between uuid\u0027s?"},{"line_number":188,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":189,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id),"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_0267c725","line":186,"in_reply_to":"1ae5cdf2_cc4d1b74","updated":"2014-06-27 16:31:46.000000000","message":"Done","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"9ba28a2505a42d6cfc614f8439887674b61c2620","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":202,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":203,"context_line":"                    all())"},{"line_number":204,"context_line":"        except exc.NoResultFound:"},{"line_number":205,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":206,"context_line":"                      {\u0027port_id\u0027: port_id})"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_cc2c3b4d","line":204,"updated":"2014-06-27 13:06:06.000000000","message":".all() doesn\u0027t throw NoResultFound, it\u0027s safe to just return the result.","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6a46987a0851ba581c58956267f778cb634858e7","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            return (session.query(models.DVRPortBinding)."},{"line_number":202,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":203,"context_line":"                    all())"},{"line_number":204,"context_line":"        except exc.NoResultFound:"},{"line_number":205,"context_line":"            LOG.debug(\"No binding found for port %(port_id)s\","},{"line_number":206,"context_line":"                      {\u0027port_id\u0027: port_id})"}],"source_content_type":"text/x-python","patch_set":8,"id":"1ae5cdf2_c226bfca","line":204,"in_reply_to":"1ae5cdf2_cc2c3b4d","updated":"2014-06-27 16:31:46.000000000","message":"Done","commit_id":"4d48bbd03d500aa2f9ed24f71b8541fa7cc5dc7c"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"ced3cb91bd56fad757fe85325c012e2d4cb2ec9a","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                vnic_type\u003dportbindings.VNIC_NORMAL,"},{"line_number":88,"context_line":"                cap_port_filter\u003dFalse,"},{"line_number":89,"context_line":"                status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":90,"context_line":"            session.add(record)"},{"line_number":91,"context_line":"        return record"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_8f5e93e7","line":90,"updated":"2014-06-27 22:38:33.000000000","message":"What happen if this is called with host\u003dNull?","commit_id":"42c8712c0760387719f1955199ea83e659e90e03"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e85763be0d6127dc2f63333a87986964954d65cf","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                vnic_type\u003dportbindings.VNIC_NORMAL,"},{"line_number":88,"context_line":"                cap_port_filter\u003dFalse,"},{"line_number":89,"context_line":"                status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":90,"context_line":"            session.add(record)"},{"line_number":91,"context_line":"        return record"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_5e3a7a34","line":90,"in_reply_to":"1ae5cdf2_8f5e93e7","updated":"2014-06-28 00:28:01.000000000","message":"it\u0027ll blow up, as host is part of a primary key; that said I think we can avoid being extra defensive here as I think host should is always valid when this method is called. I\u0027ll verify.","commit_id":"42c8712c0760387719f1955199ea83e659e90e03"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"40a08c06cad08f13fd546d464938aa79e1431221","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":198,"context_line":"                    all())"},{"line_number":199,"context_line":"    if not bindings:"},{"line_number":200,"context_line":"        LOG.debug(\"No bindings for port %(port_id)s\", {\u0027port_id\u0027: port_id})"},{"line_number":201,"context_line":"    return bindings"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_b371d879","line":200,"updated":"2014-06-29 11:47:14.000000000","message":"if there is one param we do not need to pass a dict","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"15791591b174fe3ebc9df0555600a71ffa032e32","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":198,"context_line":"                    all())"},{"line_number":199,"context_line":"    if not bindings:"},{"line_number":200,"context_line":"        LOG.debug(\"No bindings for port %(port_id)s\", {\u0027port_id\u0027: port_id})"},{"line_number":201,"context_line":"    return bindings"}],"source_content_type":"text/x-python","patch_set":11,"id":"dab895d6_6204c715","line":200,"in_reply_to":"dab895d6_b371d879","updated":"2014-06-29 16:29:08.000000000","message":"Done","commit_id":"4265a2de4e88dad0baefcccf8b46861fd388d976"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c01e8e8ee52afb0443c4cec62e131d486e54a3a9","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                cap_port_filter\u003dFalse,"},{"line_number":89,"context_line":"                status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":90,"context_line":"            session.add(record)"},{"line_number":91,"context_line":"        return record"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def delete_dvr_port_binding(session, port_id, host):"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_590d983d","line":91,"updated":"2014-07-02 20:42:10.000000000","message":"I get this exception when I tried to create an interface port on my dvr router.\n\n2014-07-02 20:21:59.775 ERROR oslo.messaging.rpc.dispatcher [req-d8c373c0-1da8-42ea-99d4-d25ac9e2dece None None] Exception during message handling: (IntegrityError) (1062, \"Duplicate entry \u00274caac2bc-1615-4473-9477-a06ce6017aa5\u0027 for key \u0027PRIMARY\u0027\") \u0027INSERT INTO ml2_dvr_port_bindings (port_id, host, router_id, vif_type, vif_details, vnic_type, profile, cap_port_filter, driver, segment, status) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)\u0027 (\u00274caac2bc-1615-4473-9477-a06ce6017aa5\u0027, \u0027dvr-controller\u0027, \u00279db9ab44-bbc1-44a9-8a8f-370979935241\u0027, \u0027unbound\u0027, \u0027\u0027, \u0027normal\u0027, \u0027\u0027, 0, None, None, \u0027DOWN\u0027)\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 134, in _dispatch_and_reply\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     incoming.message))\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 177, in _dispatch\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     return self._do_dispatch(endpoint, method, ctxt, args)\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py\", line 123, in _do_dispatch\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     result \u003d getattr(endpoint, method)(ctxt, **new_args)\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/opt/stack/neutron/neutron/db/l3_rpc_base.py\", line 63, in sync_routers\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     self._ensure_host_set_on_ports(context, plugin, host, routers) \n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/opt/stack/neutron/neutron/db/l3_rpc_base.py\", line 77, in _ensure_host_set_on_ports\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     interface, router[\u0027id\u0027])\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/opt/stack/neutron/neutron/db/l3_rpc_base.py\", line 90, in _ensure_host_set_on_port\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     \u0027device_id\u0027: router_id}\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/opt/stack/neutron/neutron/plugins/ml2/plugin.py\", line 781, in update_dvr_port_binding\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     attrs[\u0027device_id\u0027])\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/opt/stack/neutron/neutron/plugins/ml2/db.py\", line 91, in ensure_dvr_port_binding\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     return record\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py\", line 447, in __exit__\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     self.rollback()\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/lib/python2.7/dist-packages/sqlalchemy/util/langhelpers.py\", line 58, in __exit__\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     compat.reraise(exc_type, exc_value, exc_tb)\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py\", line 444, in __exit__\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     self.commit()\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py\", line 354, in commit\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     self._prepare_impl()\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py\", line 334, in _prepare_impl\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     self.session.flush()\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/opt/stack/oslo.db/oslo/db/sqlalchemy/session.py\", line 462, in _wrap\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     _raise_if_duplicate_entry_error(e, self.bind.dialect.name)\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher   File \"/opt/stack/oslo.db/oslo/db/sqlalchemy/session.py\", line 397, in _raise_if_duplicate_entry_error\n2014-07-02 20:21:59.775 TRACE oslo.messaging.rpc.dispatcher     raise exception.DBDuplicateEntry(columns, integrity_error)","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"80a667d85861633092033bd7432fbf2b4af6eff4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                cap_port_filter\u003dFalse,"},{"line_number":89,"context_line":"                status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":90,"context_line":"            session.add(record)"},{"line_number":91,"context_line":"        return record"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def delete_dvr_port_binding(session, port_id, host):"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_6827e412","line":91,"in_reply_to":"baada198_1ca14e47","updated":"2014-07-02 23:52:41.000000000","message":"This looks like similar to bug 1335226, i.e. we need to make sure that only one binding for a specific port gets added at any single time. That said, I\u0027ll review to stacktrace to see if I missed anything.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"74c00374a0a431928bb1f7878e5e5b67c64fb317","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                cap_port_filter\u003dFalse,"},{"line_number":89,"context_line":"                status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":90,"context_line":"            session.add(record)"},{"line_number":91,"context_line":"        return record"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def delete_dvr_port_binding(session, port_id, host):"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_7cc08a7c","line":91,"in_reply_to":"baada198_590d983d","updated":"2014-07-02 20:48:37.000000000","message":"Well, that didn\u0027t turn out well.  Let\u0027s try this:  http://paste.openstack.org/show/85355/","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"049d37986bf42b9106c74f8561c6328346e6d651","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                cap_port_filter\u003dFalse,"},{"line_number":89,"context_line":"                status\u003dn_const.PORT_STATUS_DOWN)"},{"line_number":90,"context_line":"            session.add(record)"},{"line_number":91,"context_line":"        return record"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def delete_dvr_port_binding(session, port_id, host):"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_1ca14e47","line":91,"in_reply_to":"baada198_7cc08a7c","updated":"2014-07-02 21:06:49.000000000","message":"I have two hosts:  dvr-controller and dvr-compute.  This exception is seen trying to insert a binding for dvr-controller with an entry already existing for dvr-compute.  This seems like a problem with the schema to me.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0896332244e5174e4b424331b59fe8ecd6287aa1","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                   filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":186,"context_line":"                          models.DVRPortBinding.host \u003d\u003d host).first())"},{"line_number":187,"context_line":"    if not binding:"},{"line_number":188,"context_line":"        LOG.debug(\"No binding for DVR port %(port_id) with host \""},{"line_number":189,"context_line":"                  \"%(host)s\", {\u0027port_id\u0027: port_id, \u0027host\u0027: host})"},{"line_number":190,"context_line":"    return binding"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_b9c0742b","line":188,"updated":"2014-07-02 20:29:22.000000000","message":"Need an \u0027s\u0027 after %(port_id).  This raises an exception.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"80a667d85861633092033bd7432fbf2b4af6eff4","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                   filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":186,"context_line":"                          models.DVRPortBinding.host \u003d\u003d host).first())"},{"line_number":187,"context_line":"    if not binding:"},{"line_number":188,"context_line":"        LOG.debug(\"No binding for DVR port %(port_id) with host \""},{"line_number":189,"context_line":"                  \"%(host)s\", {\u0027port_id\u0027: port_id, \u0027host\u0027: host})"},{"line_number":190,"context_line":"    return binding"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_a8dc9c13","line":188,"in_reply_to":"baada198_b9c0742b","updated":"2014-07-02 23:52:41.000000000","message":"Done","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":167,"context_line":"    # dvrportbinding bucket"},{"line_number":168,"context_line":"    query \u003d session.query(models.DVRPortBinding)"},{"line_number":169,"context_line":"    bindings \u003d query.filter(models.DVRPortBinding.port_id \u003d\u003d port_id).all()"},{"line_number":170,"context_line":"    for bind in bindings:"},{"line_number":171,"context_line":"        if bind.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"},{"line_number":172,"context_line":"            return n_const.PORT_STATUS_ACTIVE"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_a8b49535","line":169,"updated":"2014-07-10 23:46:51.000000000","message":"all() not needed - the next iteration will iterate again over the resultset","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":166,"context_line":"    # an OR\u0027ed value of status assigned to parent port from the"},{"line_number":167,"context_line":"    # dvrportbinding bucket"},{"line_number":168,"context_line":"    query \u003d session.query(models.DVRPortBinding)"},{"line_number":169,"context_line":"    bindings \u003d query.filter(models.DVRPortBinding.port_id \u003d\u003d port_id).all()"},{"line_number":170,"context_line":"    for bind in bindings:"},{"line_number":171,"context_line":"        if bind.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"},{"line_number":172,"context_line":"            return n_const.PORT_STATUS_ACTIVE"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_e3bdced8","line":169,"in_reply_to":"baada198_a8b49535","updated":"2014-07-11 00:41:44.000000000","message":"Done","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":169,"context_line":"    bindings \u003d query.filter(models.DVRPortBinding.port_id \u003d\u003d port_id).all()"},{"line_number":170,"context_line":"    for bind in bindings:"},{"line_number":171,"context_line":"        if bind.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"},{"line_number":172,"context_line":"            return n_const.PORT_STATUS_ACTIVE"},{"line_number":173,"context_line":"    for bind in bindings:"},{"line_number":174,"context_line":"        if bind.status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":175,"context_line":"            return n_const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_08f4a1f0","line":172,"updated":"2014-07-10 23:46:51.000000000","message":"final_status \u003d n_consts.PORT_STATUS_BUILD\nfor bind in bindings:\n    if bind.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:\n        return bind.status\n    elif bind.status \u003d n_const.PORT_STATUS_DOWN:\n         final_status \u003d bind.status\nreturn final_status\n\nI think the above should work and not need a double iteration","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":169,"context_line":"    bindings \u003d query.filter(models.DVRPortBinding.port_id \u003d\u003d port_id).all()"},{"line_number":170,"context_line":"    for bind in bindings:"},{"line_number":171,"context_line":"        if bind.status \u003d\u003d n_const.PORT_STATUS_ACTIVE:"},{"line_number":172,"context_line":"            return n_const.PORT_STATUS_ACTIVE"},{"line_number":173,"context_line":"    for bind in bindings:"},{"line_number":174,"context_line":"        if bind.status \u003d\u003d n_const.PORT_STATUS_DOWN:"},{"line_number":175,"context_line":"            return n_const.PORT_STATUS_DOWN"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_a39af66b","line":172,"in_reply_to":"baada198_08f4a1f0","updated":"2014-07-11 00:41:44.000000000","message":"good one","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"def get_dvr_port_binding_by_host(port_id, host, session\u003dNone):"},{"line_number":180,"context_line":"    if not session:"},{"line_number":181,"context_line":"        session \u003d db_api.get_session()"},{"line_number":182,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":183,"context_line":"        binding \u003d (session.query(models.DVRPortBinding)."},{"line_number":184,"context_line":"                   filter(models.DVRPortBinding.port_id.startswith(port_id),"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_e83a0d97","line":181,"updated":"2014-07-10 23:46:51.000000000","message":"sqlalchemy tends to behave strangely if several sessions are open within the same transaction (don\u0027t have links handy now). If this function is going to be called from an API routine consider passing always the session in the api context.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":178,"context_line":""},{"line_number":179,"context_line":"def get_dvr_port_binding_by_host(port_id, host, session\u003dNone):"},{"line_number":180,"context_line":"    if not session:"},{"line_number":181,"context_line":"        session \u003d db_api.get_session()"},{"line_number":182,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":183,"context_line":"        binding \u003d (session.query(models.DVRPortBinding)."},{"line_number":184,"context_line":"                   filter(models.DVRPortBinding.port_id.startswith(port_id),"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_e3078e7f","line":181,"in_reply_to":"baada198_e83a0d97","updated":"2014-07-11 00:41:44.000000000","message":"Done","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        session \u003d db_api.get_session()"},{"line_number":182,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":183,"context_line":"        binding \u003d (session.query(models.DVRPortBinding)."},{"line_number":184,"context_line":"                   filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":185,"context_line":"                          models.DVRPortBinding.host \u003d\u003d host).first())"},{"line_number":186,"context_line":"    if not binding:"},{"line_number":187,"context_line":"        LOG.debug(\"No binding for DVR port %(port_id)s with host \""}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_88e7d13f","line":184,"updated":"2014-07-10 23:46:51.000000000","message":"why startswith? Equal seems the right conditions here.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"29334736d3c743c595901a27fee95d2facd5b329","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        session \u003d db_api.get_session()"},{"line_number":182,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":183,"context_line":"        binding \u003d (session.query(models.DVRPortBinding)."},{"line_number":184,"context_line":"                   filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":185,"context_line":"                          models.DVRPortBinding.host \u003d\u003d host).first())"},{"line_number":186,"context_line":"    if not binding:"},{"line_number":187,"context_line":"        LOG.debug(\"No binding for DVR port %(port_id)s with host \""}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_88bd076b","line":184,"in_reply_to":"baada198_83adf28a","updated":"2014-07-11 07:37:01.000000000","message":"I trust you. Honestly there are 31 previous patchsets...","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        session \u003d db_api.get_session()"},{"line_number":182,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":183,"context_line":"        binding \u003d (session.query(models.DVRPortBinding)."},{"line_number":184,"context_line":"                   filter(models.DVRPortBinding.port_id.startswith(port_id),"},{"line_number":185,"context_line":"                          models.DVRPortBinding.host \u003d\u003d host).first())"},{"line_number":186,"context_line":"    if not binding:"},{"line_number":187,"context_line":"        LOG.debug(\"No binding for DVR port %(port_id)s with host \""}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_83adf28a","line":184,"in_reply_to":"baada198_88e7d13f","updated":"2014-07-11 00:41:44.000000000","message":"Please, have a look at comments in previous reviews","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":189,"context_line":"    return binding"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"def get_dvr_port_bindings(port_id):"},{"line_number":193,"context_line":"    session \u003d db_api.get_session()"},{"line_number":194,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":195,"context_line":"        bindings \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_2845e516","line":192,"updated":"2014-07-10 23:46:51.000000000","message":"same comment as for line 181","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":189,"context_line":"    return binding"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"def get_dvr_port_bindings(port_id):"},{"line_number":193,"context_line":"    session \u003d db_api.get_session()"},{"line_number":194,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":195,"context_line":"        bindings \u003d (session.query(models.DVRPortBinding)."}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_6321befb","line":192,"in_reply_to":"baada198_2845e516","updated":"2014-07-11 00:41:44.000000000","message":"Done","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d4bb860853bbdf4cf8c8806d72ebec180699494f","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return record"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"def ensure_dvr_port_binding(session, port_id, host, router_id\u003dNone):"},{"line_number":75,"context_line":"    # FIXME(armando-migliaccio): take care of LP #1335226"},{"line_number":76,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":77,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_6b5c2d1a","line":74,"updated":"2014-07-11 07:57:45.000000000","message":"I have been looking in this patch at some place where this function will be called to do port bindings for DVR router ports, but was not able to find it.\n\nIt took me a while to figure out that it\u0027s used here: https://review.openstack.org/#/c/102398/","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"2d01439b44da6174c9064eb9364d7ed485161dff","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return record"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"def ensure_dvr_port_binding(session, port_id, host, router_id\u003dNone):"},{"line_number":75,"context_line":"    # FIXME(armando-migliaccio): take care of LP #1335226"},{"line_number":76,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":77,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_861af27a","line":74,"in_reply_to":"baada198_54f9b27e","updated":"2014-07-15 05:26:10.000000000","message":"salvatore,\r\n\r\nFor code reference during review,  please refer entire DVR stuff squash commit available here:\r\nhttps://review.openstack.org/#/c/105864/","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ed1498dd6d24d380d90ed5ec65c3715059e2c55e","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        return record"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"def ensure_dvr_port_binding(session, port_id, host, router_id\u003dNone):"},{"line_number":75,"context_line":"    # FIXME(armando-migliaccio): take care of LP #1335226"},{"line_number":76,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":77,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_54f9b27e","line":74,"in_reply_to":"baada198_6b5c2d1a","updated":"2014-07-11 17:10:24.000000000","message":"This is ML2 stuff, so it\u0027ll be find in the patched labelled ML2. I appreciate this may be somewhat confusing, but this is the usual ML2 pattern: DB functions are being used in ml2/plugin.py","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d4bb860853bbdf4cf8c8806d72ebec180699494f","unresolved":false,"context_lines":[{"line_number":93,"context_line":"def delete_dvr_port_binding(session, port_id, host):"},{"line_number":94,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":95,"context_line":"        session.query(models.DVRPortBinding).filter_by("},{"line_number":96,"context_line":"            port_id\u003dport_id, host\u003dhost).delete()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"def get_port(session, port_id):"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_8bea610d","line":96,"updated":"2014-07-11 07:57:45.000000000","message":"the synchronize_session thing again, if you wish.","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ed1498dd6d24d380d90ed5ec65c3715059e2c55e","unresolved":false,"context_lines":[{"line_number":93,"context_line":"def delete_dvr_port_binding(session, port_id, host):"},{"line_number":94,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":95,"context_line":"        session.query(models.DVRPortBinding).filter_by("},{"line_number":96,"context_line":"            port_id\u003dport_id, host\u003dhost).delete()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"def get_port(session, port_id):"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_94efcab0","line":96,"in_reply_to":"baada198_8bea610d","updated":"2014-07-11 17:10:24.000000000","message":"Done","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d4bb860853bbdf4cf8c8806d72ebec180699494f","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"def get_dvr_port_bindings(session, port_id):"},{"line_number":190,"context_line":"    session \u003d db_api.get_session()"},{"line_number":191,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":192,"context_line":"        bindings \u003d (session.query(models.DVRPortBinding)."},{"line_number":193,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_4bb6893f","line":190,"updated":"2014-07-11 07:57:45.000000000","message":"uh? Why are you passing it as a param then?","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ed1498dd6d24d380d90ed5ec65c3715059e2c55e","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"def get_dvr_port_bindings(session, port_id):"},{"line_number":190,"context_line":"    session \u003d db_api.get_session()"},{"line_number":191,"context_line":"    with session.begin(subtransactions\u003dTrue):"},{"line_number":192,"context_line":"        bindings \u003d (session.query(models.DVRPortBinding)."},{"line_number":193,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_94742aff","line":190,"in_reply_to":"baada198_4bb6893f","updated":"2014-07-11 17:10:24.000000000","message":"doh!","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"d4bb860853bbdf4cf8c8806d72ebec180699494f","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":194,"context_line":"                    all())"},{"line_number":195,"context_line":"    if not bindings:"},{"line_number":196,"context_line":"        LOG.debug(\"No bindings for port %s\", port_id)"},{"line_number":197,"context_line":"    return bindings"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_eb7e7d69","line":196,"updated":"2014-07-11 07:57:45.000000000","message":"super-pedantry: make this log statement consistency with the one at line 184 \"No binding for DVR port...\"","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ed1498dd6d24d380d90ed5ec65c3715059e2c55e","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                    filter(models.DVRPortBinding.port_id.startswith(port_id))."},{"line_number":194,"context_line":"                    all())"},{"line_number":195,"context_line":"    if not bindings:"},{"line_number":196,"context_line":"        LOG.debug(\"No bindings for port %s\", port_id)"},{"line_number":197,"context_line":"    return bindings"}],"source_content_type":"text/x-python","patch_set":33,"id":"baada198_14581a89","line":196,"in_reply_to":"baada198_eb7e7d69","updated":"2014-07-11 17:10:24.000000000","message":"super-Done","commit_id":"89e7800fae8617503bac7c008dfd8a37288b8598"}],"neutron/plugins/ml2/drivers/l2pop/db.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                                     l2_const.SUPPORTED_AGENT_TYPES))"},{"line_number":57,"context_line":"            return query.first()"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_network_ports(self, session, network_id, query\u003dNone, filters\u003dNone):"},{"line_number":60,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":61,"context_line":"            if not query:"},{"line_number":62,"context_line":"                query \u003d session.query(ml2_models.PortBinding,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_6613bb01","line":59,"updated":"2014-06-24 20:00:58.000000000","message":"I think this method\u0027s call signature has become a little overcomplicated.  \nI think this method is being ask to do too many different things.  The only common element seems to be the filter on L67.  Could you refactor by breaking the filter in to a utility method maybe and then using the utility below on L78 and L86?\n\nSpecifically, there is little value to passing filters because the caller can simply add the filters after calling this method to the return value.\n\nOptionally passing query also feels a bit funny to me too.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                                     l2_const.SUPPORTED_AGENT_TYPES))"},{"line_number":57,"context_line":"            return query.first()"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def get_network_ports(self, session, network_id, query\u003dNone, filters\u003dNone):"},{"line_number":60,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":61,"context_line":"            if not query:"},{"line_number":62,"context_line":"                query \u003d session.query(ml2_models.PortBinding,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_f95a051d","line":59,"in_reply_to":"1ae5cdf2_6613bb01","updated":"2014-06-24 22:57:16.000000000","message":"that\u0027s a sticky one. I\u0027ll see what I can do, I am trying not to break the new functionality from the old one...but evidently not very successfully :)","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            if not query:"},{"line_number":62,"context_line":"                query \u003d session.query(ml2_models.PortBinding,"},{"line_number":63,"context_line":"                                      agents_db.Agent)"},{"line_number":64,"context_line":"                query \u003d query.join(agents_db.Agent, agents_db.Agent.host \u003d\u003d"},{"line_number":65,"context_line":"                                   ml2_models.PortBinding.host)"},{"line_number":66,"context_line":"                query \u003d query.join(models_v2.Port)"},{"line_number":67,"context_line":"            query \u003d query.filter(models_v2.Port.network_id \u003d\u003d network_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_26d61354","line":64,"updated":"2014-06-24 20:00:58.000000000","message":"This is an odd way to break up this line (in the middle of a comparison).  Can a temporary be used to capture the comparison?","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":61,"context_line":"            if not query:"},{"line_number":62,"context_line":"                query \u003d session.query(ml2_models.PortBinding,"},{"line_number":63,"context_line":"                                      agents_db.Agent)"},{"line_number":64,"context_line":"                query \u003d query.join(agents_db.Agent, agents_db.Agent.host \u003d\u003d"},{"line_number":65,"context_line":"                                   ml2_models.PortBinding.host)"},{"line_number":66,"context_line":"                query \u003d query.join(models_v2.Port)"},{"line_number":67,"context_line":"            query \u003d query.filter(models_v2.Port.network_id \u003d\u003d network_id,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_399c6dbf","line":64,"in_reply_to":"1ae5cdf2_26d61354","updated":"2014-06-24 22:57:16.000000000","message":"see above","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"02f7cb8b9e1b748c3e7a1ff2c1c00e813c0c72c7","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                                      query\u003dquery, filters\u003ddvr_ports)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def get_agent_network_active_port_count(self, session,"},{"line_number":90,"context_line":"                                            agent_host,"},{"line_number":91,"context_line":"                                            network_id):"},{"line_number":92,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":93,"context_line":"            query \u003d session.query(models_v2.Port)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_66981b76","line":90,"updated":"2014-06-24 20:00:58.000000000","message":"This line wrapped unnecessarily.  This line shouldn\u0027t change from the original.","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f083ac017d5921d424cd9fa72a23211333718b69","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                                      query\u003dquery, filters\u003ddvr_ports)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def get_agent_network_active_port_count(self, session,"},{"line_number":90,"context_line":"                                            agent_host,"},{"line_number":91,"context_line":"                                            network_id):"},{"line_number":92,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":93,"context_line":"            query \u003d session.query(models_v2.Port)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_f9df6564","line":90,"in_reply_to":"1ae5cdf2_66981b76","updated":"2014-06-24 22:57:16.000000000","message":"Done","commit_id":"abaf54ae4f5057876d9ba392fecd82fff3e61cb9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0178ddfb10603aa0f5240f11f6737dab51daf2d6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"1ae5cdf2_b1833102","updated":"2014-06-25 03:39:49.000000000","message":"+1  IMO, I like the improvement from PS2 - PS3 in this file.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"27cc9c1d31762c900b2b9a0b67e59c27462654df","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                   ml2_models.DVRPortBinding.status \u003d\u003d"},{"line_number":108,"context_line":"                                   const.PORT_STATUS_ACTIVE,"},{"line_number":109,"context_line":"                                   models_v2.Port.device_owner \u003d\u003d"},{"line_number":110,"context_line":"                                   const.DEVICE_OWNER_ROUTER_INTF_DISTRIBUTED,"},{"line_number":111,"context_line":"                                   ml2_models.DVRPortBinding.host \u003d\u003d"},{"line_number":112,"context_line":"                                   agent_host)"},{"line_number":113,"context_line":"            return (query1.count() + query2.count())"}],"source_content_type":"text/x-python","patch_set":12,"id":"dab895d6_11bef7ff","line":110,"updated":"2014-06-30 03:38:56.000000000","message":"can DVRPortBinding have ports with other device_owner?","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"70fccabeb03bb16f6bd9ecaf3f255fff1182afdb","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                   ml2_models.DVRPortBinding.status \u003d\u003d"},{"line_number":108,"context_line":"                                   const.PORT_STATUS_ACTIVE,"},{"line_number":109,"context_line":"                                   models_v2.Port.device_owner \u003d\u003d"},{"line_number":110,"context_line":"                                   const.DEVICE_OWNER_ROUTER_INTF_DISTRIBUTED,"},{"line_number":111,"context_line":"                                   ml2_models.DVRPortBinding.host \u003d\u003d"},{"line_number":112,"context_line":"                                   agent_host)"},{"line_number":113,"context_line":"            return (query1.count() + query2.count())"}],"source_content_type":"text/x-python","patch_set":12,"id":"dab895d6_612bd8eb","line":110,"in_reply_to":"dab895d6_11bef7ff","updated":"2014-06-30 10:07:07.000000000","message":"DVRPortBinding will hold only DVR interface ports and so it will always contain only ports with device_owner set to DEVICE_OWNER_ROUTER_INTF_DISTRIBUTED.","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"e95f41c50596b762361c775bdca82a9d21129d8a","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                   ml2_models.DVRPortBinding.status \u003d\u003d"},{"line_number":108,"context_line":"                                   const.PORT_STATUS_ACTIVE,"},{"line_number":109,"context_line":"                                   models_v2.Port.device_owner \u003d\u003d"},{"line_number":110,"context_line":"                                   const.DEVICE_OWNER_ROUTER_INTF_DISTRIBUTED,"},{"line_number":111,"context_line":"                                   ml2_models.DVRPortBinding.host \u003d\u003d"},{"line_number":112,"context_line":"                                   agent_host)"},{"line_number":113,"context_line":"            return (query1.count() + query2.count())"}],"source_content_type":"text/x-python","patch_set":12,"id":"dab895d6_7f744c9c","line":110,"in_reply_to":"dab895d6_612bd8eb","updated":"2014-06-30 13:35:58.000000000","message":"then this filter is redundant?","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"931d235f6d6776f57a72051d7189070470e432e2","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                   ml2_models.DVRPortBinding.status \u003d\u003d"},{"line_number":108,"context_line":"                                   const.PORT_STATUS_ACTIVE,"},{"line_number":109,"context_line":"                                   models_v2.Port.device_owner \u003d\u003d"},{"line_number":110,"context_line":"                                   const.DEVICE_OWNER_ROUTER_INTF_DISTRIBUTED,"},{"line_number":111,"context_line":"                                   ml2_models.DVRPortBinding.host \u003d\u003d"},{"line_number":112,"context_line":"                                   agent_host)"},{"line_number":113,"context_line":"            return (query1.count() + query2.count())"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_6c26836a","line":110,"in_reply_to":"dab895d6_7f744c9c","updated":"2014-06-30 16:02:41.000000000","message":"It is redundant and so i am removing it.","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            query \u003d query.join(agents_db.Agent,"},{"line_number":83,"context_line":"                               agents_db.Agent.host \u003d\u003d"},{"line_number":84,"context_line":"                               ml2_models.DVRPortBinding.host)"},{"line_number":85,"context_line":"            query \u003d query.join(models_v2.Port)"},{"line_number":86,"context_line":"            query \u003d query.filter(models_v2.Port.network_id \u003d\u003d network_id,"},{"line_number":87,"context_line":"                                 models_v2.Port.admin_state_up \u003d\u003d sql.true(),"},{"line_number":88,"context_line":"                                 models_v2.Port.device_owner \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_885511c8","line":85,"updated":"2014-07-10 23:46:51.000000000","message":"shouldn\u0027t there be a condition in this join in order to avoid a cross join?","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"29334736d3c743c595901a27fee95d2facd5b329","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            query \u003d query.join(agents_db.Agent,"},{"line_number":83,"context_line":"                               agents_db.Agent.host \u003d\u003d"},{"line_number":84,"context_line":"                               ml2_models.DVRPortBinding.host)"},{"line_number":85,"context_line":"            query \u003d query.join(models_v2.Port)"},{"line_number":86,"context_line":"            query \u003d query.filter(models_v2.Port.network_id \u003d\u003d network_id,"},{"line_number":87,"context_line":"                                 models_v2.Port.admin_state_up \u003d\u003d sql.true(),"},{"line_number":88,"context_line":"                                 models_v2.Port.device_owner \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_a869ebfa","line":85,"in_reply_to":"baada198_436d9a31","updated":"2014-07-11 07:37:01.000000000","message":"ah maybe sqlalchemy adds is able do detect the right ON condition automatically using relationships in models?","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            query \u003d query.join(agents_db.Agent,"},{"line_number":83,"context_line":"                               agents_db.Agent.host \u003d\u003d"},{"line_number":84,"context_line":"                               ml2_models.DVRPortBinding.host)"},{"line_number":85,"context_line":"            query \u003d query.join(models_v2.Port)"},{"line_number":86,"context_line":"            query \u003d query.filter(models_v2.Port.network_id \u003d\u003d network_id,"},{"line_number":87,"context_line":"                                 models_v2.Port.admin_state_up \u003d\u003d sql.true(),"},{"line_number":88,"context_line":"                                 models_v2.Port.device_owner \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_436d9a31","line":85,"in_reply_to":"baada198_885511c8","updated":"2014-07-11 00:41:44.000000000","message":"what do you mean?","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"}],"neutron/plugins/ml2/models.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"06d6ab3fc8c19b732978a8d1d9c2fb3bc9565171","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    A port binding stores the port attributes required for the"},{"line_number":83,"context_line":"    portbindings extension, as well as internal ml2 state such as"},{"line_number":84,"context_line":"    which MechanismDriver and which segment are used by the port"},{"line_number":85,"context_line":"    binding."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_dfc1a930","line":85,"updated":"2014-06-25 00:39:44.000000000","message":"this comment seems like a dead copy from PortBinding","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"fe3dbb9b2a5099302c778ff4a249647dd4e36615","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    A port binding stores the port attributes required for the"},{"line_number":83,"context_line":"    portbindings extension, as well as internal ml2 state such as"},{"line_number":84,"context_line":"    which MechanismDriver and which segment are used by the port"},{"line_number":85,"context_line":"    binding."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_64d4891f","line":85,"in_reply_to":"1ae5cdf2_0e04c416","updated":"2014-06-25 04:02:07.000000000","message":"Thanks Armando for responding.  \r\nYamamato, I am putting together a notepad on why this table is necessary and why existing port-binding cannot be used.\r\n\r\nrouter-id is an important addition to the table as armando mentioned, but this table\u0027s main intent is to hold replicated port bindings.  In the original port-binding table, you can hold only one binding per port, but for DVR Interfaces we need multiple bindings per DVR Router Interface Port.  I\u0027ll be putting explanations in a notepad document and enclose it in the blueprint page , which you can review in detail.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"224983dd3965a7e8ccfc3874dcfe63ecfa59eefa","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    A port binding stores the port attributes required for the"},{"line_number":83,"context_line":"    portbindings extension, as well as internal ml2 state such as"},{"line_number":84,"context_line":"    which MechanismDriver and which segment are used by the port"},{"line_number":85,"context_line":"    binding."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_0e04c416","line":85,"in_reply_to":"1ae5cdf2_1a5cffef","updated":"2014-06-25 03:01:16.000000000","message":"Yamamoto, why didn\u0027t you put your concern in this form in the first place? By all means, this is a valid concern and we want to address it. However, when one puts it like \u0027this docstring is a dead copy\u0027, how is the committer supposed to interpret the reviewer\u0027s intent? I was inviting you to be more thorough, rather than an inviting you to abandon the patch!\n\nThat said, your concern is two-fold:\n\n1) these changes don\u0027t seem to be covered by the approved spec: as much as one can strive to make sure to provide the greatest level of detail in the blueprint specification, one or two things will always slips. We could reopen the blueprint by submitting the addition to the model, but I don\u0027t really see what that would buy us; after all the Data Model section is most of the times limits itself to listing the Tables the same way the models are reported in the code. There\u0027s nothing we can really do in the context of this patch.\n\n2) why is this a variant of port binding: if you look at the model down below, you\u0027ll see that (granted there\u0027s duplication of fields), the binding references a router id too. Hence the new model.\n\nIf you look at the entire set of patches:\n\nhttps://review.openstack.org/#/q/status:open+project:openstack/neutron+branch:master+topic:bp/neutron-ovs-dvr,n,z\n\nI tried to break DVR up into manageable and more logically separated pieces; this was done with the specific intent of welcoming reviewers, so please continue, if you care to see this functionality in tree as much as we do.\n\nThanks,\nArmando","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"55397521de4336b161ca8e64d3bb42f029020105","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    A port binding stores the port attributes required for the"},{"line_number":83,"context_line":"    portbindings extension, as well as internal ml2 state such as"},{"line_number":84,"context_line":"    which MechanismDriver and which segment are used by the port"},{"line_number":85,"context_line":"    binding."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_1a5cffef","line":85,"in_reply_to":"1ae5cdf2_3a27fbb6","updated":"2014-06-25 01:25:05.000000000","message":"sorry for annoying.\n\nbecause i\u0027m still trying to understand why this variant of portbinding is necessary, the comment here is somehow essential, rather than \"a minor thing\", at least for me.  these changes don\u0027t seem to be covered by the approved spec and comments in code is bogus.  how reviewers are expected to understand the intention of the change?\ni guess i\u0027m not a person who is expected to review or understand these changes.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"74858bcdeba4b686b8581ed47adaf59572b6e98f","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    A port binding stores the port attributes required for the"},{"line_number":83,"context_line":"    portbindings extension, as well as internal ml2 state such as"},{"line_number":84,"context_line":"    which MechanismDriver and which segment are used by the port"},{"line_number":85,"context_line":"    binding."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_3a27fbb6","line":85,"in_reply_to":"1ae5cdf2_dfc1a930","updated":"2014-06-25 01:02:21.000000000","message":"Could you please do a comprehensive review, rather than just nit-picking? A -1 for a minor thing can be very frustrating, and it may keep other reviewers from looking at the patch. Much appreciated.","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"de3ae829aa146baf6d1c33a422a32df80bc673f7","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    A port binding stores the port attributes required for the"},{"line_number":83,"context_line":"    portbindings extension, as well as internal ml2 state such as"},{"line_number":84,"context_line":"    which MechanismDriver and which segment are used by the port"},{"line_number":85,"context_line":"    binding."},{"line_number":86,"context_line":"    \"\"\""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_9a372fe4","line":85,"in_reply_to":"1ae5cdf2_dfc1a930","updated":"2014-06-25 01:02:42.000000000","message":"Done","commit_id":"0fd6c9f0ff137a4e85bdec4c659c15b7636cc15c"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"ced3cb91bd56fad757fe85325c012e2d4cb2ec9a","unresolved":false,"context_lines":[{"line_number":96,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"},{"line_number":97,"context_line":"                        default\u003d\u0027\u0027)"},{"line_number":98,"context_line":"    cap_port_filter \u003d sa.Column(sa.Boolean, nullable\u003dFalse)"},{"line_number":99,"context_line":"    driver \u003d sa.Column(sa.String(64))"},{"line_number":100,"context_line":"    segment \u003d sa.Column(sa.String(36),"},{"line_number":101,"context_line":"                        sa.ForeignKey(\u0027ml2_network_segments.id\u0027,"},{"line_number":102,"context_line":"                                      ondelete\u003d\"SET NULL\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_cfb09bff","line":99,"updated":"2014-06-27 22:38:33.000000000","message":"nullable\u003dTrue","commit_id":"42c8712c0760387719f1955199ea83e659e90e03"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"e85763be0d6127dc2f63333a87986964954d65cf","unresolved":false,"context_lines":[{"line_number":96,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"},{"line_number":97,"context_line":"                        default\u003d\u0027\u0027)"},{"line_number":98,"context_line":"    cap_port_filter \u003d sa.Column(sa.Boolean, nullable\u003dFalse)"},{"line_number":99,"context_line":"    driver \u003d sa.Column(sa.String(64))"},{"line_number":100,"context_line":"    segment \u003d sa.Column(sa.String(36),"},{"line_number":101,"context_line":"                        sa.ForeignKey(\u0027ml2_network_segments.id\u0027,"},{"line_number":102,"context_line":"                                      ondelete\u003d\"SET NULL\"))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_3e3f6e26","line":99,"in_reply_to":"1ae5cdf2_cfb09bff","updated":"2014-06-28 00:28:01.000000000","message":"Done","commit_id":"42c8712c0760387719f1955199ea83e659e90e03"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"27cc9c1d31762c900b2b9a0b67e59c27462654df","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    Port binding for all the ports associated to a DVR identified by router_id."},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":12,"id":"dab895d6_31ee9bed","line":84,"updated":"2014-06-30 03:38:56.000000000","message":"it\u0027s better to add necessary columns to port_binding table rather than introducing a new table.","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"70fccabeb03bb16f6bd9ecaf3f255fff1182afdb","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    Port binding for all the ports associated to a DVR identified by router_id."},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":12,"id":"dab895d6_e125280b","line":84,"in_reply_to":"dab895d6_31ee9bed","updated":"2014-06-30 10:07:07.000000000","message":"The ramifications of touching PortBinding table is far higher than this approach.  \r\n\r\nDVRPortBinding table needs combination of (port_id + host) to be primary key which is not the case with the original PortBinding table. Hence, it makes sense to keep this separate.","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"931d235f6d6776f57a72051d7189070470e432e2","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    Port binding for all the ports associated to a DVR identified by router_id."},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_acf7bb8b","line":84,"in_reply_to":"dab895d6_5fb6a83e","updated":"2014-06-30 16:02:41.000000000","message":"port-id is the primary key in PortBinding.  What we need is table that could hold same port-ids in multiple rows but each such row distinguished by host coupled with port-id.\r\n\r\nCode correctness is essential for dvr binding replication and then comes logic to cut any duplication.","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"e95f41c50596b762361c775bdca82a9d21129d8a","unresolved":false,"context_lines":[{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    Port binding for all the ports associated to a DVR identified by router_id."},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    __tablename__ \u003d \u0027ml2_dvr_port_bindings\u0027"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":12,"id":"dab895d6_5fb6a83e","line":84,"in_reply_to":"dab895d6_e125280b","updated":"2014-06-30 13:35:58.000000000","message":"i disagree.\nnon-primary key indexes should be fine.\nthere seems to be many duplicated logic for dvr and non-dvr cases.","commit_id":"dd72a5440e9b587b1a558ad9af1b40948776e944"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"25b6fbfeb947c023e8e0678fa0d3201b577547a9","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":88,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":89,"context_line":"                        primary_key\u003dTrue)"},{"line_number":90,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":91,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":92,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_d79b2f70","line":89,"updated":"2014-07-02 21:25:22.000000000","message":"I think this primary key may not be correct.  See my comment on the migration script.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"80a667d85861633092033bd7432fbf2b4af6eff4","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":88,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":89,"context_line":"                        primary_key\u003dTrue)"},{"line_number":90,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":91,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":92,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_a8e65cb2","line":89,"in_reply_to":"baada198_37eaab75","updated":"2014-07-02 23:52:41.000000000","message":"Interesting...see Vivek\u0027s comment on PS3:\n\nhttps://review.openstack.org/#/c/102101/3/neutron/plugins/ml2/models.py\n\nYou may be right.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5e7af8479e4b032f004da1418e3ecd26b27102ed","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":88,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":89,"context_line":"                        primary_key\u003dTrue)"},{"line_number":90,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":91,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":92,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_31cf14b2","line":89,"in_reply_to":"baada198_a8e65cb2","updated":"2014-07-03 00:34:55.000000000","message":"however, the model is correct, as both port_id and host composes the primary_key. The migration script was wrong.","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e53960dca919eca672c0fbc305ed50d8a1e3ba62","unresolved":false,"context_lines":[{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":88,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":89,"context_line":"                        primary_key\u003dTrue)"},{"line_number":90,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":91,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":92,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":23,"id":"baada198_37eaab75","line":89,"in_reply_to":"baada198_d79b2f70","updated":"2014-07-02 21:32:58.000000000","message":"I\u0027m trying the following in my setup for the short term:\n\nmysql\u003e ALTER TABLE ml2_dvr_port_bindings\n    -\u003e  DROP PRIMARY KEY,\n    -\u003e  ADD PRIMARY KEY(port_id, host);","commit_id":"8c2a684118c8acd63d682086783d8c8584ba459a"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"032062fff9ec94c5f662ce47a923f31d34936595","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":88,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":89,"context_line":"                        primary_key\u003dTrue)"},{"line_number":90,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":91,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":92,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":93,"context_line":"    vif_details \u003d sa.Column(sa.String(4095), nullable\u003dFalse, default\u003d\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":24,"id":"baada198_d4ea460e","line":90,"updated":"2014-07-03 01:34:45.000000000","message":"Actually the host column here is a foreign key to the  \u0027dvr_host_macs.host\u0027 column (Dvr_host_macs table is in the 2026156eab2f_l2_dvr_models.py file but not here).","commit_id":"9d108a65f2dbf53c779b91e3e27a655969853e60"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"6a5f2d881f7e4b2aac182293f4bd53462db5f3ac","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":88,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":89,"context_line":"                        primary_key\u003dTrue)"},{"line_number":90,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":91,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":92,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":93,"context_line":"    vif_details \u003d sa.Column(sa.String(4095), nullable\u003dFalse, default\u003d\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":24,"id":"baada198_7ec845a8","line":90,"in_reply_to":"baada198_7736dce8","updated":"2014-07-04 06:14:36.000000000","message":"This coupling is not required.   If we see the original PortBinding table, that also has a host but did we ever couple it with host in agentTable.\r\n\r\nThe deletion of binding is covered in two cases:\r\na. When dvr router interface is deleted , weher orm relationship delete on cascade kicks into delete all bindings int this table that share the same port-id.\r\n\r\nb. When a DVR is removed from a specific compute node (but will  continue to reside on other compute nodes, the binding deletion is taken care explicitly in check_and_delete_dvr_binding() method available in ml2/plugin.py as part of th another patch #102398.","commit_id":"9d108a65f2dbf53c779b91e3e27a655969853e60"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2183ccd985f8959c7db1820dc29972ad5417b478","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    port_id \u003d sa.Column(sa.String(36),"},{"line_number":88,"context_line":"                        sa.ForeignKey(\u0027ports.id\u0027, ondelete\u003d\"CASCADE\"),"},{"line_number":89,"context_line":"                        primary_key\u003dTrue)"},{"line_number":90,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":91,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":92,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":93,"context_line":"    vif_details \u003d sa.Column(sa.String(4095), nullable\u003dFalse, default\u003d\u0027\u0027)"}],"source_content_type":"text/x-python","patch_set":24,"id":"baada198_7736dce8","line":90,"in_reply_to":"baada198_d4ea460e","updated":"2014-07-03 02:17:41.000000000","message":"It sounds the same goes to the base PortBinding and there might be a reason for that.\n\nI guess the extra constraint could hurt here because what would the cascading policy be? It can\u0027t be SET NULL (as host is key); it could be CASCADE, but I think we would want to handle binding deletion explicitly.","commit_id":"9d108a65f2dbf53c779b91e3e27a655969853e60"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"4e241288566a3eb7414663e2f1baba7c845be9b5","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":94,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":95,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":96,"context_line":"    vif_details \u003d sa.Column(sa.String(4095), nullable\u003dFalse, default\u003d\u0027\u0027)"},{"line_number":97,"context_line":"    vnic_type \u003d sa.Column(sa.String(64), nullable\u003dFalse,"},{"line_number":98,"context_line":"                          default\u003dportbindings.VNIC_NORMAL)"},{"line_number":99,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_9df76359","line":96,"updated":"2014-07-16 11:14:41.000000000","message":"Please add also server_default\u003d\"","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bc83aa8930c6bb034428ad3ce2dd47a387d592f0","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    host \u003d sa.Column(sa.String(255), nullable\u003dFalse, primary_key\u003dTrue)"},{"line_number":94,"context_line":"    router_id \u003d sa.Column(sa.String(36), nullable\u003dTrue)"},{"line_number":95,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":96,"context_line":"    vif_details \u003d sa.Column(sa.String(4095), nullable\u003dFalse, default\u003d\u0027\u0027)"},{"line_number":97,"context_line":"    vnic_type \u003d sa.Column(sa.String(64), nullable\u003dFalse,"},{"line_number":98,"context_line":"                          default\u003dportbindings.VNIC_NORMAL)"},{"line_number":99,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_eab40c84","line":96,"in_reply_to":"baada198_9df76359","updated":"2014-07-16 14:55:42.000000000","message":"Done","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"4e241288566a3eb7414663e2f1baba7c845be9b5","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":96,"context_line":"    vif_details \u003d sa.Column(sa.String(4095), nullable\u003dFalse, default\u003d\u0027\u0027)"},{"line_number":97,"context_line":"    vnic_type \u003d sa.Column(sa.String(64), nullable\u003dFalse,"},{"line_number":98,"context_line":"                          default\u003dportbindings.VNIC_NORMAL)"},{"line_number":99,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"},{"line_number":100,"context_line":"                        default\u003d\u0027\u0027)"},{"line_number":101,"context_line":"    cap_port_filter \u003d sa.Column(sa.Boolean, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_3d8737b8","line":98,"updated":"2014-07-16 11:14:41.000000000","message":"Please add also server_default\u003dportbindings.VNIC_NORMAL","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bc83aa8930c6bb034428ad3ce2dd47a387d592f0","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    vif_type \u003d sa.Column(sa.String(64), nullable\u003dFalse)"},{"line_number":96,"context_line":"    vif_details \u003d sa.Column(sa.String(4095), nullable\u003dFalse, default\u003d\u0027\u0027)"},{"line_number":97,"context_line":"    vnic_type \u003d sa.Column(sa.String(64), nullable\u003dFalse,"},{"line_number":98,"context_line":"                          default\u003dportbindings.VNIC_NORMAL)"},{"line_number":99,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"},{"line_number":100,"context_line":"                        default\u003d\u0027\u0027)"},{"line_number":101,"context_line":"    cap_port_filter \u003d sa.Column(sa.Boolean, nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_2aae0430","line":98,"in_reply_to":"baada198_3d8737b8","updated":"2014-07-16 14:55:42.000000000","message":"Done","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"4e241288566a3eb7414663e2f1baba7c845be9b5","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    vnic_type \u003d sa.Column(sa.String(64), nullable\u003dFalse,"},{"line_number":98,"context_line":"                          default\u003dportbindings.VNIC_NORMAL)"},{"line_number":99,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"},{"line_number":100,"context_line":"                        default\u003d\u0027\u0027)"},{"line_number":101,"context_line":"    cap_port_filter \u003d sa.Column(sa.Boolean, nullable\u003dFalse)"},{"line_number":102,"context_line":"    driver \u003d sa.Column(sa.String(64))"},{"line_number":103,"context_line":"    segment \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_bd9347ff","line":100,"updated":"2014-07-16 11:14:41.000000000","message":"Please add also server_default\u003d\"","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"bc83aa8930c6bb034428ad3ce2dd47a387d592f0","unresolved":false,"context_lines":[{"line_number":97,"context_line":"    vnic_type \u003d sa.Column(sa.String(64), nullable\u003dFalse,"},{"line_number":98,"context_line":"                          default\u003dportbindings.VNIC_NORMAL)"},{"line_number":99,"context_line":"    profile \u003d sa.Column(sa.String(BINDING_PROFILE_LEN), nullable\u003dFalse,"},{"line_number":100,"context_line":"                        default\u003d\u0027\u0027)"},{"line_number":101,"context_line":"    cap_port_filter \u003d sa.Column(sa.Boolean, nullable\u003dFalse)"},{"line_number":102,"context_line":"    driver \u003d sa.Column(sa.String(64))"},{"line_number":103,"context_line":"    segment \u003d sa.Column(sa.String(36),"}],"source_content_type":"text/x-python","patch_set":38,"id":"baada198_4aab381e","line":100,"in_reply_to":"baada198_bd9347ff","updated":"2014-07-16 14:55:42.000000000","message":"Done","commit_id":"adbca427d76993321f0d33bb1d1467eebe966ea6"}],"neutron/plugins/openvswitch/common/config.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"3c8797ed85cae49f699aaa19054c508e0c81f820","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                help\u003d_(\"Set or un-set the don\u0027t fragment (DF) bit on \""},{"line_number":88,"context_line":"                       \"outgoing IP packet carrying GRE/VXLAN tunnel\")),"},{"line_number":89,"context_line":"    cfg.BoolOpt(\u0027enable_distributed_routing\u0027, default\u003dFalse,"},{"line_number":90,"context_line":"                help\u003d_(\"Make the l2 agent run in dvr mode \")),"},{"line_number":91,"context_line":"]"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_680efd33","line":90,"updated":"2014-07-10 23:46:51.000000000","message":"either I\u0027ve not paid enough attention to the code or this seems unrelated to this patch.","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"29334736d3c743c595901a27fee95d2facd5b329","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                help\u003d_(\"Set or un-set the don\u0027t fragment (DF) bit on \""},{"line_number":88,"context_line":"                       \"outgoing IP packet carrying GRE/VXLAN tunnel\")),"},{"line_number":89,"context_line":"    cfg.BoolOpt(\u0027enable_distributed_routing\u0027, default\u003dFalse,"},{"line_number":90,"context_line":"                help\u003d_(\"Make the l2 agent run in dvr mode \")),"},{"line_number":91,"context_line":"]"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_687b53be","line":90,"in_reply_to":"baada198_6368de21","updated":"2014-07-11 07:37:01.000000000","message":"I\u0027ve seen that but I still don\u0027t understand why they\u0027re in this patch","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d562337d7513d5856524c0d778332c343bb46348","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                help\u003d_(\"Set or un-set the don\u0027t fragment (DF) bit on \""},{"line_number":88,"context_line":"                       \"outgoing IP packet carrying GRE/VXLAN tunnel\")),"},{"line_number":89,"context_line":"    cfg.BoolOpt(\u0027enable_distributed_routing\u0027, default\u003dFalse,"},{"line_number":90,"context_line":"                help\u003d_(\"Make the l2 agent run in dvr mode \")),"},{"line_number":91,"context_line":"]"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"baada198_6368de21","line":90,"in_reply_to":"baada198_680efd33","updated":"2014-07-11 00:41:44.000000000","message":"see commit message!","commit_id":"077f085ea81fe418b8ade7586e4d442178de983a"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2f963e4cc7522741c24fc9c7a09c43ca5f462675","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                help\u003d_(\"Set or un-set the don\u0027t fragment (DF) bit on \""},{"line_number":88,"context_line":"                       \"outgoing IP packet carrying GRE/VXLAN tunnel\")),"},{"line_number":89,"context_line":"    cfg.BoolOpt(\u0027enable_distributed_routing\u0027, default\u003dFalse,"},{"line_number":90,"context_line":"                help\u003d_(\"Make the l2 agent run in dvr mode \")),"},{"line_number":91,"context_line":"]"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"baada198_263ab1e7","line":90,"updated":"2014-07-16 20:32:24.000000000","message":"nit: s/dvr/DVR","commit_id":"13309e01f8a5c6cbd5765951b6f4c19ab62fb5e1"}]}
