)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Notify nova when ports are ready"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The following patch adds a callback from neutron to nova that notifies nova"},{"line_number":10,"context_line":"when a port for an instance is *ready to be used*. After nova receives this"},{"line_number":11,"context_line":"event it will then start the instance in a hope that when it comes up"},{"line_number":12,"context_line":"its networking should be in working order."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAVn%2F%2FoJc%3D","line":9,"updated":"2014-03-05 00:30:19.000000000","message":"can I be pedant and say that it\u0027s probably not a callback?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Notify nova when ports are ready"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The following patch adds a callback from neutron to nova that notifies nova"},{"line_number":10,"context_line":"when a port for an instance is *ready to be used*. After nova receives this"},{"line_number":11,"context_line":"event it will then start the instance in a hope that when it comes up"},{"line_number":12,"context_line":"its networking should be in working order."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAVn%2F%2Fn%2F4%3D","line":9,"in_reply_to":"AAAAVn%2F%2FoJc%3D","updated":"2014-03-05 00:56:00.000000000","message":"a callback in the sense that neutron calls back to nova.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The following patch adds a callback from neutron to nova that notifies nova"},{"line_number":10,"context_line":"when a port for an instance is *ready to be used*. After nova receives this"},{"line_number":11,"context_line":"event it will then start the instance in a hope that when it comes up"},{"line_number":12,"context_line":"its networking should be in working order."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"NOTE: *ready to be used* currently means that a plugin changes the status"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAVn%2F%2FoIg%3D","line":11,"updated":"2014-03-05 00:30:19.000000000","message":"I find amusing that we\u0027re officially using the verb \u0027hope\u0027.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The following patch adds a callback from neutron to nova that notifies nova"},{"line_number":10,"context_line":"when a port for an instance is *ready to be used*. After nova receives this"},{"line_number":11,"context_line":"event it will then start the instance in a hope that when it comes up"},{"line_number":12,"context_line":"its networking should be in working order."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"NOTE: *ready to be used* currently means that a plugin changes the status"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAVn%2F%2Fn%2Fc%3D","line":11,"in_reply_to":"AAAAVn%2F%2FoIg%3D","updated":"2014-03-05 00:56:00.000000000","message":"It was intended :) Setting expectations","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"}],"etc/neutron.conf":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":288,"context_line":""},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d neutron nova interactions \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":291,"context_line":"# Sent notification to nova when port status is active."},{"line_number":292,"context_line":"# notify_nova_port_active \u003d True"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"# URL for connection to nova (Only supports one nova region currently)."}],"source_content_type":"text/plain","patch_set":5,"id":"AAAAVn%2F%2F0pY%3D","line":291,"updated":"2014-03-04 17:40:16.000000000","message":"send?","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":288,"context_line":""},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d neutron nova interactions \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":291,"context_line":"# Sent notification to nova when port status is active."},{"line_number":292,"context_line":"# notify_nova_port_active \u003d True"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"# URL for connection to nova (Only supports one nova region currently)."}],"source_content_type":"text/plain","patch_set":5,"id":"AAAAVn%2F%2Fq0E%3D","line":291,"in_reply_to":"AAAAVn%2F%2F0pY%3D","updated":"2014-03-04 19:02:38.000000000","message":"Done","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":289,"context_line":""},{"line_number":290,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d neutron nova interactions \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":291,"context_line":"# Sent notification to nova when port status is active."},{"line_number":292,"context_line":"# notify_nova_port_active \u003d True"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"# URL for connection to nova (Only supports one nova region currently)."},{"line_number":295,"context_line":"# nova_url \u003d http://127.0.0.1:8774"}],"source_content_type":"text/plain","patch_set":5,"id":"AAAAVn%2F%2Fr8c%3D","line":292,"updated":"2014-03-04 17:40:16.000000000","message":"I think enabling this behavior by default this late in the Icehouse cycle is potentially dangerous. I\u0027d rather see this stuff experimental for now, especially based on the considerations you made about multi-region.","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":289,"context_line":""},{"line_number":290,"context_line":"# \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d neutron nova interactions \u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":291,"context_line":"# Sent notification to nova when port status is active."},{"line_number":292,"context_line":"# notify_nova_port_active \u003d True"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"# URL for connection to nova (Only supports one nova region currently)."},{"line_number":295,"context_line":"# nova_url \u003d http://127.0.0.1:8774"}],"source_content_type":"text/plain","patch_set":5,"id":"AAAAVn%2F%2Fqz0%3D","line":292,"in_reply_to":"AAAAVn%2F%2Fr8c%3D","updated":"2014-03-04 19:02:38.000000000","message":"Will circle back here","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":292,"context_line":"# notify_nova_port_active \u003d True"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"# URL for connection to nova (Only supports one nova region currently)."},{"line_number":295,"context_line":"# nova_url \u003d http://127.0.0.1:8774"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"# Username for connection to nova in admin context"},{"line_number":298,"context_line":"# nova_admin_user_name \u003d"}],"source_content_type":"text/plain","patch_set":5,"id":"AAAAVn%2F%2F0pI%3D","line":295,"updated":"2014-03-04 17:40:16.000000000","message":"why does this have a default if the other don\u0027t? I think it\u0027s confusing","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":292,"context_line":"# notify_nova_port_active \u003d True"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"# URL for connection to nova (Only supports one nova region currently)."},{"line_number":295,"context_line":"# nova_url \u003d http://127.0.0.1:8774"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"# Username for connection to nova in admin context"},{"line_number":298,"context_line":"# nova_admin_user_name \u003d"}],"source_content_type":"text/plain","patch_set":5,"id":"AAAAVn%2F%2FqzQ%3D","line":295,"in_reply_to":"AAAAVn%2F%2F0pI%3D","updated":"2014-03-04 19:02:38.000000000","message":"I did this because there is a default here: https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L61","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"}],"neutron/callbacks/__init__.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2014 OpenStack Foundation."},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F74M%3D","line":1,"updated":"2014-02-24 00:43:30.000000000","message":"Empty files are no longer required to have license boilerplate.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2014 OpenStack Foundation."},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2Fyc8%3D","line":1,"in_reply_to":"AAAAU3%2F%2F74M%3D","updated":"2014-02-24 21:52:35.000000000","message":"Done","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FecA%3D","line":1,"updated":"2014-02-26 12:46:10.000000000","message":"I meant all the boilerplate - not just the vim header.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2014 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2Fa4A%3D","line":1,"in_reply_to":"AAAAU3%2F%2FecA%3D","updated":"2014-02-26 19:08:18.000000000","message":"Gotcha!","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"}],"neutron/callbacks/nova.py":[{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"0a06554f91ec69cba4c2fcd1b8933c0f086a3d28","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"VIF_UNPLUGGED \u003d \u0027vif-unplugged\u0027"},{"line_number":30,"context_line":"VIF_PLUGGED \u003d \u0027vif-plugged\u0027"},{"line_number":31,"context_line":"NEUTRON_NOVA_EVENT_STATUS_MAP \u003d {constants.PORT_STATUS_ACTIVE: \u0027completed\u0027,"},{"line_number":32,"context_line":"                                 constants.PORT_STATUS_ERROR: \u0027failed\u0027,"},{"line_number":33,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FuRw%3D","line":30,"updated":"2014-02-25 03:56:18.000000000","message":"These event names are kind of misleading. Its really nova that plugs the VIF (i.e. nova\u0027s GenericVIFDriver creates an OVS port for the VIF), and neutron that notifies nova when the port status changes, which may or may not be in direct response to the VIF being plugged by nova (it could be in response to changes to admin_state_up or due to a temporary outage). Why not just call these events PORT_DOWN and PORT_UP?","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":1689,"name":"Robert Kukura","email":"rk@theep.net","username":"rkukura"},"change_message_id":"c0ac254a636c892447098a91ee266cfdf94cd978","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"VIF_UNPLUGGED \u003d \u0027vif-unplugged\u0027"},{"line_number":30,"context_line":"VIF_PLUGGED \u003d \u0027vif-plugged\u0027"},{"line_number":31,"context_line":"NEUTRON_NOVA_EVENT_STATUS_MAP \u003d {constants.PORT_STATUS_ACTIVE: \u0027completed\u0027,"},{"line_number":32,"context_line":"                                 constants.PORT_STATUS_ERROR: \u0027failed\u0027,"},{"line_number":33,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2Fpdw%3D","line":30,"in_reply_to":"AAAAU3%2F%2FuIc%3D","updated":"2014-02-25 13:56:03.000000000","message":"I still feel this naming is a bit confusing and misleading. Can\u0027t we just keep the notification a simple \"status has changed\" and let nova do a port.get() to interpret the result?\n\nIf it is really is just a one-time event from neutron-\u003enova, maybe calling it VIF_READY would make sense.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d57832af861fbc9a9b8c0d2db1ee05500f4b598","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"VIF_UNPLUGGED \u003d \u0027vif-unplugged\u0027"},{"line_number":30,"context_line":"VIF_PLUGGED \u003d \u0027vif-plugged\u0027"},{"line_number":31,"context_line":"NEUTRON_NOVA_EVENT_STATUS_MAP \u003d {constants.PORT_STATUS_ACTIVE: \u0027completed\u0027,"},{"line_number":32,"context_line":"                                 constants.PORT_STATUS_ERROR: \u0027failed\u0027,"},{"line_number":33,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FuIc%3D","line":30,"in_reply_to":"AAAAU3%2F%2FuRw%3D","updated":"2014-02-25 04:06:29.000000000","message":"Hi Bob, The event is called vif-plugged() as it\u0027s the result of nova calling the vif_plugged() or unpluged() methods.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":45,"context_line":"            auth_url\u003dcfg.CONF.nova_admin_auth_url,"},{"line_number":46,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    def notify_port_status_changed(self, port, current_port_status,"},{"line_number":49,"context_line":"                                   previous_port_status, initiator):"},{"line_number":50,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":51,"context_line":"        if not port.device_id:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F73M%3D","line":48,"updated":"2014-02-24 00:43:30.000000000","message":"(Suggestion only) current -\u003e new ; previous -\u003e old\n\nAlso, consider extracting the logic that generates the event from sending it to simplify testing, e.g.\n\ndef get_event():\n  pass\n\ndef notify():\n  event \u003d get_event()\n  send_event(event)","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            return"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if not port.id:"},{"line_number":56,"context_line":"            LOG.warning(_(\"port.id is not set nova will not be notified of \""},{"line_number":57,"context_line":"                          \" port status change. \"))"},{"line_number":58,"context_line":"            return"},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F730%3D","line":56,"updated":"2014-02-24 00:43:30.000000000","message":"Run-on sentence","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            return"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        if not port.id:"},{"line_number":56,"context_line":"            LOG.warning(_(\"port.id is not set nova will not be notified of \""},{"line_number":57,"context_line":"                          \" port status change. \"))"},{"line_number":58,"context_line":"            return"},{"line_number":59,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxFQ%3D","line":56,"in_reply_to":"AAAAU3%2F%2F730%3D","updated":"2014-02-24 21:52:35.000000000","message":"Done","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        # We notify nova when a vif is unplugged which only occurs when"},{"line_number":61,"context_line":"        # the status goes from ACTIVE to DOWN"},{"line_number":62,"context_line":"        # ACTIVE-\u003eDOWN \u003d VIF_UNPLUGGED"},{"line_number":63,"context_line":"        if (previous_port_status \u003d\u003d constants.PORT_STATUS_ACTIVE and"},{"line_number":64,"context_line":"            current_port_status \u003d\u003d constants.PORT_STATUS_DOWN):"},{"line_number":65,"context_line":"            event_name \u003d VIF_UNPLUGGED"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F73s%3D","line":62,"updated":"2014-02-24 00:43:30.000000000","message":"This line is redundant.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"        # We notify nova when a vif is unplugged which only occurs when"},{"line_number":61,"context_line":"        # the status goes from ACTIVE to DOWN"},{"line_number":62,"context_line":"        # ACTIVE-\u003eDOWN \u003d VIF_UNPLUGGED"},{"line_number":63,"context_line":"        if (previous_port_status \u003d\u003d constants.PORT_STATUS_ACTIVE and"},{"line_number":64,"context_line":"            current_port_status \u003d\u003d constants.PORT_STATUS_DOWN):"},{"line_number":65,"context_line":"            event_name \u003d VIF_UNPLUGGED"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxFI%3D","line":62,"in_reply_to":"AAAAU3%2F%2F73s%3D","updated":"2014-02-24 21:52:35.000000000","message":"Done","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":68,"context_line":"        # when the state switches from:"},{"line_number":69,"context_line":"        # NOV_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN"},{"line_number":70,"context_line":"        elif (previous_port_status in [sql_attr.NO_VALUE,"},{"line_number":71,"context_line":"                                       constants.PORT_STATUS_DOWN,"},{"line_number":72,"context_line":"                                       constants.PORT_STATUS_BUILD]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F73k%3D","line":69,"updated":"2014-02-24 00:43:30.000000000","message":"This line is redundant and/or inaccurate (ACTIVE/ERROR)","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":68,"context_line":"        # when the state switches from:"},{"line_number":69,"context_line":"        # NOV_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN"},{"line_number":70,"context_line":"        elif (previous_port_status in [sql_attr.NO_VALUE,"},{"line_number":71,"context_line":"                                       constants.PORT_STATUS_DOWN,"},{"line_number":72,"context_line":"                                       constants.PORT_STATUS_BUILD]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxEo%3D","line":69,"in_reply_to":"AAAAU3%2F%2F73k%3D","updated":"2014-02-24 21:52:35.000000000","message":"Done","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # tell nova about."},{"line_number":78,"context_line":"        else:"},{"line_number":79,"context_line":"            LOG.debug(_(\"Ignoring state change previous_port_status: \""},{"line_number":80,"context_line":"                        \"s(pre_status)% current_port_status: s(cur_status)\""},{"line_number":81,"context_line":"                        \" port_id s(id)s\") %"},{"line_number":82,"context_line":"                      {\u0027pre_status\u0027: previous_port_status,"},{"line_number":83,"context_line":"                       \u0027cur_status\u0027: current_port_status,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F73A%3D","line":80,"updated":"2014-02-24 00:43:30.000000000","message":"Substitution formatting on this line and the next one are incorrect.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        # tell nova about."},{"line_number":78,"context_line":"        else:"},{"line_number":79,"context_line":"            LOG.debug(_(\"Ignoring state change previous_port_status: \""},{"line_number":80,"context_line":"                        \"s(pre_status)% current_port_status: s(cur_status)\""},{"line_number":81,"context_line":"                        \" port_id s(id)s\") %"},{"line_number":82,"context_line":"                      {\u0027pre_status\u0027: previous_port_status,"},{"line_number":83,"context_line":"                       \u0027cur_status\u0027: current_port_status,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxEs%3D","line":80,"in_reply_to":"AAAAU3%2F%2F73A%3D","updated":"2014-02-24 21:52:35.000000000","message":"Done","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":90,"context_line":"             \u0027status\u0027: NEUTRON_NOVA_EVENT_STATUS_MAP.get(current_port_status),"},{"line_number":91,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":92,"context_line":"        ]"},{"line_number":93,"context_line":"        # Error handing... What should we do here if we can\u0027t notify nova?"},{"line_number":94,"context_line":"        self.nclient.server_external_events.create(event)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F734%3D","line":93,"updated":"2014-02-24 00:43:30.000000000","message":"Log it as an error.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":90,"context_line":"             \u0027status\u0027: NEUTRON_NOVA_EVENT_STATUS_MAP.get(current_port_status),"},{"line_number":91,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":92,"context_line":"        ]"},{"line_number":93,"context_line":"        # Error handing... What should we do here if we can\u0027t notify nova?"},{"line_number":94,"context_line":"        self.nclient.server_external_events.create(event)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxEk%3D","line":93,"in_reply_to":"AAAAU3%2F%2F734%3D","updated":"2014-02-24 21:52:35.000000000","message":"Done","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            auth_url\u003dcfg.CONF.nova_admin_auth_url,"},{"line_number":44,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def notify_port_status_changed(self, port, current_port_status,"},{"line_number":47,"context_line":"                                   previous_port_status, initiator):"},{"line_number":48,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":49,"context_line":"        if not port.device_id:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FeSE%3D","line":46,"updated":"2014-02-26 12:46:10.000000000","message":"I still think event creation should be separated from the sending of the event.  Testing whether a given input produces the expected event should not require examining the call to the nova client, and there should be tests of the logging around sending the event that would be easier to write if the sending was separate.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"2917374d16a9a7b1aa30b7f33353c359faa8130f","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            auth_url\u003dcfg.CONF.nova_admin_auth_url,"},{"line_number":44,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def notify_port_status_changed(self, port, current_port_status,"},{"line_number":47,"context_line":"                                   previous_port_status, initiator):"},{"line_number":48,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":49,"context_line":"        if not port.device_id:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVX%2F%2F9r4%3D","line":46,"in_reply_to":"AAAAU3%2F%2Faso%3D","updated":"2014-02-27 05:18:52.000000000","message":"The point here is separation of concerns [1].  Generating the event has no dependency on how the event is sent and vice versa.  That should be reflected in the code so that if we change how the event is generated, we only have to modify the tests for event generation.  This makes for both easier code maintenance and easier bug reproduction since testing can be more focused.\n\n1: https://en.wikipedia.org/wiki/Separation_of_concerns","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            auth_url\u003dcfg.CONF.nova_admin_auth_url,"},{"line_number":44,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def notify_port_status_changed(self, port, current_port_status,"},{"line_number":47,"context_line":"                                   previous_port_status, initiator):"},{"line_number":48,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":49,"context_line":"        if not port.device_id:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2Faso%3D","line":46,"in_reply_to":"AAAAU3%2F%2FeSE%3D","updated":"2014-02-26 19:08:18.000000000","message":"I\u0027m not quite sure what you mean by event creation should be separated from the sending of an event. This method creates an event, then sends to it nova via:  response \u003d self.nclient.server_external_events.create(event) . I\u0027m not quite sure how you are proposing this to be decoupled.  I\u0027m curious to hear though. \n\nThe tests here: https://review.openstack.org/#/c/75253/3/neutron/tests/unit/callbacks/test_callbacks_nova.py are testing that the expected input sends the right event to nova though I could change the code to test the return value of this method instead though I\u0027m not sure decoupling that into another method really improves much imho.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":65,"context_line":"        # when the status goes from:"},{"line_number":66,"context_line":"        # NO_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN. In addition to the"},{"line_number":67,"context_line":"        # case when a port is in admin_state_up \u003d False as we want"},{"line_number":68,"context_line":"        # the instance to still boot."},{"line_number":69,"context_line":"        elif ((port.admin_state_up is False) or"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FeOU%3D","line":66,"updated":"2014-02-26 12:46:10.000000000","message":"ACTIVE/DOWN \u003d\u003e ACTIVE/ERROR\n\nAlso, does it make sense to notify at all if a plugin doesn\u0027t support accurate port status? I\u0027m wondering if Nova couldn\u0027t look at the port details it uses to perform the vif plug to determine whether it should wait for a notification or not, saving the overhead of unnecessary communication between the two services.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"2917374d16a9a7b1aa30b7f33353c359faa8130f","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":65,"context_line":"        # when the status goes from:"},{"line_number":66,"context_line":"        # NO_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN. In addition to the"},{"line_number":67,"context_line":"        # case when a port is in admin_state_up \u003d False as we want"},{"line_number":68,"context_line":"        # the instance to still boot."},{"line_number":69,"context_line":"        elif ((port.admin_state_up is False) or"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVX%2F%2F9u0%3D","line":66,"in_reply_to":"AAAAU3%2F%2Fa1k%3D","updated":"2014-02-27 05:18:52.000000000","message":"I mean that the comment contradicts the the port status in the if clause on line 74.  It\u0027s ERROR, not DOWN.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":65,"context_line":"        # when the status goes from:"},{"line_number":66,"context_line":"        # NO_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN. In addition to the"},{"line_number":67,"context_line":"        # case when a port is in admin_state_up \u003d False as we want"},{"line_number":68,"context_line":"        # the instance to still boot."},{"line_number":69,"context_line":"        elif ((port.admin_state_up is False) or"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2Fa1k%3D","line":66,"in_reply_to":"AAAAU3%2F%2FeOU%3D","updated":"2014-02-26 19:08:18.000000000","message":"What do you mean ACTIVE/DOWN -\u003e ACTIVE/ERROR?\n\nMy plan is to add something that a plugin can set that will cause neutron to notify nova whenever new ports are created. There\u0027s a config option in nova to make it non fatal if nova doesn\u0027t get the event message. My current thought is neutron should try to notify nova even if a plugin doesn\u0027t support accurate port status w/e a port is created.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"86487c4aa9232cb3a07bd913d4bd5d14852c369a","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":65,"context_line":"        # when the status goes from:"},{"line_number":66,"context_line":"        # NO_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN. In addition to the"},{"line_number":67,"context_line":"        # case when a port is in admin_state_up \u003d False as we want"},{"line_number":68,"context_line":"        # the instance to still boot."},{"line_number":69,"context_line":"        elif ((port.admin_state_up is False) or"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVX%2F%2F9gA%3D","line":66,"in_reply_to":"AAAAVX%2F%2F9u0%3D","updated":"2014-02-27 05:50:18.000000000","message":"AH I must be blind... Thanks!","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        ]"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            LOG.debug(_(\"Sending event: %s\"), event)"},{"line_number":95,"context_line":"            response \u003d self.nclient.server_external_events.create(event)"},{"line_number":96,"context_line":"            if response[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":97,"context_line":"                LOG.warning(_(\"Nova event: %s returned with failed status\"),"},{"line_number":98,"context_line":"                            event)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FebU%3D","line":95,"updated":"2014-02-26 12:46:10.000000000","message":"Please limit the scope of the try/except block to this line alone.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"2917374d16a9a7b1aa30b7f33353c359faa8130f","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        ]"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            LOG.debug(_(\"Sending event: %s\"), event)"},{"line_number":95,"context_line":"            response \u003d self.nclient.server_external_events.create(event)"},{"line_number":96,"context_line":"            if response[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":97,"context_line":"                LOG.warning(_(\"Nova event: %s returned with failed status\"),"},{"line_number":98,"context_line":"                            event)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVX%2F%2F9qo%3D","line":95,"in_reply_to":"AAAAU3%2F%2FayQ%3D","updated":"2014-02-27 05:18:52.000000000","message":"You won\u0027t have to initialize the response outside of the try block if you put lines 96-100 in an \u0027else\u0027 block.\n\nReference: http://docs.python.org/2/tutorial/errors.html#handling-exceptions (search for \u0027else\u0027)","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        ]"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            LOG.debug(_(\"Sending event: %s\"), event)"},{"line_number":95,"context_line":"            response \u003d self.nclient.server_external_events.create(event)"},{"line_number":96,"context_line":"            if response[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":97,"context_line":"                LOG.warning(_(\"Nova event: %s returned with failed status\"),"},{"line_number":98,"context_line":"                            event)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FayQ%3D","line":95,"in_reply_to":"AAAAU3%2F%2FebU%3D","updated":"2014-02-26 19:08:18.000000000","message":"The reason why I didn\u0027t do that is I\u0027d need initialize response outside of the try block if i wanted to do that. Do you still want me to do that?","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"86487c4aa9232cb3a07bd913d4bd5d14852c369a","unresolved":false,"context_lines":[{"line_number":92,"context_line":"        ]"},{"line_number":93,"context_line":"        try:"},{"line_number":94,"context_line":"            LOG.debug(_(\"Sending event: %s\"), event)"},{"line_number":95,"context_line":"            response \u003d self.nclient.server_external_events.create(event)"},{"line_number":96,"context_line":"            if response[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":97,"context_line":"                LOG.warning(_(\"Nova event: %s returned with failed status\"),"},{"line_number":98,"context_line":"                            event)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVX%2F%2F9fY%3D","line":95,"in_reply_to":"AAAAVX%2F%2F9qo%3D","updated":"2014-02-27 05:50:18.000000000","message":"doh yea...will do in the next patch set.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a578a4693a8923a00b31689b4a4e378f8b2cba24","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        if not port.id:"},{"line_number":63,"context_line":"            LOG.warning(_(\"Port ID not set! Nova will not be notified of \""},{"line_number":64,"context_line":"                          \" port status change.\"))"},{"line_number":65,"context_line":"            return"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # We only want to notifiy about nova ports."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fvpw%3D","line":64,"updated":"2014-03-04 11:32:47.000000000","message":"nit: you have 2 spaces in this log message...\"of[space][space]port status\"","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        if not port.id:"},{"line_number":63,"context_line":"            LOG.warning(_(\"Port ID not set! Nova will not be notified of \""},{"line_number":64,"context_line":"                          \" port status change.\"))"},{"line_number":65,"context_line":"            return"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # We only want to notifiy about nova ports."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fqy0%3D","line":64,"in_reply_to":"AAAAVn%2F%2Fvpw%3D","updated":"2014-03-04 19:02:38.000000000","message":"Done","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                       \u0027id\u0027: port.id})"},{"line_number":99,"context_line":"            return"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        port._notify_event \u003d ["},{"line_number":102,"context_line":"            {\u0027server_uuid\u0027: port.device_id,"},{"line_number":103,"context_line":"             \u0027name\u0027: event_name,"},{"line_number":104,"context_line":"             \u0027status\u0027: NEUTRON_NOVA_EVENT_STATUS_MAP.get(current_port_status),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Frv8%3D","line":101,"updated":"2014-03-04 17:40:16.000000000","message":"why is this a list? Does server_external_events.create support bulk? This should probably be a single element and use the list while calling the method.","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                       \u0027id\u0027: port.id})"},{"line_number":99,"context_line":"            return"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        port._notify_event \u003d ["},{"line_number":102,"context_line":"            {\u0027server_uuid\u0027: port.device_id,"},{"line_number":103,"context_line":"             \u0027name\u0027: event_name,"},{"line_number":104,"context_line":"             \u0027status\u0027: NEUTRON_NOVA_EVENT_STATUS_MAP.get(current_port_status),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fqyk%3D","line":101,"in_reply_to":"AAAAVn%2F%2Frv8%3D","updated":"2014-03-04 19:02:38.000000000","message":"It does support bulk. I\u0027ll add the list there.","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":105,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":106,"context_line":"        ]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def notify_nova(self, mapper, connection, port):"},{"line_number":109,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":110,"context_line":"        if not event:"},{"line_number":111,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fr78%3D","line":108,"updated":"2014-03-04 17:40:16.000000000","message":"what are mapper and connection for? Is that the prescribed signature for the event handler? It might be worth adding a note about it.","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":105,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":106,"context_line":"        ]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def notify_nova(self, mapper, connection, port):"},{"line_number":109,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":110,"context_line":"        if not event:"},{"line_number":111,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FqyA%3D","line":108,"in_reply_to":"AAAAVn%2F%2Fr78%3D","updated":"2014-03-04 19:02:38.000000000","message":"yea the signature is required from sqlalchemy. I\u0027ll add a note.","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                  \"status\"), event)"},{"line_number":119,"context_line":"                else:"},{"line_number":120,"context_line":"                    LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":121,"context_line":"        except Exception:"},{"line_number":122,"context_line":"            LOG.exception(_(\"Failed to notify nova on port status change:\""},{"line_number":123,"context_line":"                            \" Port id: %s\"), port.id)"},{"line_number":124,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fr9Q%3D","line":121,"updated":"2014-03-04 17:40:16.000000000","message":"Is this super-catch really necessary? Haven\u0027t you learned your lesson yet :)?","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                  \"status\"), event)"},{"line_number":119,"context_line":"                else:"},{"line_number":120,"context_line":"                    LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":121,"context_line":"        except Exception:"},{"line_number":122,"context_line":"            LOG.exception(_(\"Failed to notify nova on port status change:\""},{"line_number":123,"context_line":"                            \" Port id: %s\"), port.id)"},{"line_number":124,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fqxk%3D","line":121,"in_reply_to":"AAAAVn%2F%2Fr9Q%3D","updated":"2014-03-04 19:02:38.000000000","message":"I wanted to make sure that a failure talking to nova wouldn\u0027t cause a failure in neutron. For example, if nova is down; connection reset/ etc.","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c8d837e0813f56b78787f6c7aa07692f71b41f2d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def notify_nova(self, events):"},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"            for event in response:"},{"line_number":119,"context_line":"                if event[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":120,"context_line":"                    LOG.warning(_(\"Nova event: %s returned with failed \""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FpoA%3D","line":117,"updated":"2014-03-04 21:05:56.000000000","message":"Try/Else!","commit_id":"2de1e629741491ee07d3fccdd2c473c49c40d7e1"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"b2bed61ee6755c2e0b000828ab45cac9f2abd753","unresolved":false,"context_lines":[{"line_number":114,"context_line":"    def notify_nova(self, events):"},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"            for event in response:"},{"line_number":119,"context_line":"                if event[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":120,"context_line":"                    LOG.warning(_(\"Nova event: %s returned with failed \""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAVn%2F%2FoZU%3D","line":117,"in_reply_to":"AAAAVn%2F%2FpoA%3D","updated":"2014-03-04 23:27:28.000000000","message":"Done","commit_id":"2de1e629741491ee07d3fccdd2c473c49c40d7e1"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class NovaCallback(object):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoG0%3D","line":34,"updated":"2014-03-05 00:30:19.000000000","message":"Following up from commit message comment, these are not really callbacks.\n\nTo me a callback is a function that you pass to another function as a parameter. This just notifies nova.\n\nAnyway, I think terminology has been \u0027abused\u0027 already widely, and surely I\u0027m guilty myself of many terminology crimes, so feel free to disregard this comment.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class NovaCallback(object):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn%2FI%3D","line":34,"in_reply_to":"AAAAVn%2F%2FoG0%3D","updated":"2014-03-05 00:56:00.000000000","message":"if you have a better name i\u0027m happy to take it.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"},{"line_number":38,"context_line":"        # how to deal with different regions here...."},{"line_number":39,"context_line":"        self.nclient \u003d nclient.Client("},{"line_number":40,"context_line":"            username\u003dcfg.CONF.nova_admin_username,"},{"line_number":41,"context_line":"            api_key\u003dcfg.CONF.nova_admin_password,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoGo%3D","line":38,"updated":"2014-03-05 00:30:19.000000000","message":"Can\u0027t we designate a distinct neutron server for each nova region?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"99d1893808dad3b001297314eca6908a1d019c67","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"},{"line_number":38,"context_line":"        # how to deal with different regions here...."},{"line_number":39,"context_line":"        self.nclient \u003d nclient.Client("},{"line_number":40,"context_line":"            username\u003dcfg.CONF.nova_admin_username,"},{"line_number":41,"context_line":"            api_key\u003dcfg.CONF.nova_admin_password,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FnHI%3D","line":38,"in_reply_to":"AAAAVn%2F%2Fn%2FA%3D","updated":"2014-03-05 21:22:03.000000000","message":"Done","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"},{"line_number":38,"context_line":"        # how to deal with different regions here...."},{"line_number":39,"context_line":"        self.nclient \u003d nclient.Client("},{"line_number":40,"context_line":"            username\u003dcfg.CONF.nova_admin_username,"},{"line_number":41,"context_line":"            api_key\u003dcfg.CONF.nova_admin_password,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn%2FA%3D","line":38,"in_reply_to":"AAAAVn%2F%2FoGo%3D","updated":"2014-03-05 00:56:00.000000000","message":"Sure I\u0027ll add that.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                          \"port status change.\"))"},{"line_number":65,"context_line":"            return"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # We only want to notifiy about nova ports."},{"line_number":68,"context_line":"        if (not port.device_owner or"},{"line_number":69,"context_line":"            not port.device_owner.startswith(\u0027compute\u0027)):"},{"line_number":70,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoF4%3D","line":67,"updated":"2014-03-05 00:30:19.000000000","message":"notifiy -\u003e notify","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                          \"port status change.\"))"},{"line_number":65,"context_line":"            return"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        # We only want to notifiy about nova ports."},{"line_number":68,"context_line":"        if (not port.device_owner or"},{"line_number":69,"context_line":"            not port.device_owner.startswith(\u0027compute\u0027)):"},{"line_number":70,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn%2B8%3D","line":67,"in_reply_to":"AAAAVn%2F%2FoF4%3D","updated":"2014-03-05 00:56:00.000000000","message":"Done","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        # case when a port is in admin_state_up \u003d False as we want"},{"line_number":82,"context_line":"        # the instance to still boot."},{"line_number":83,"context_line":"        elif ((port.admin_state_up is False) or"},{"line_number":84,"context_line":"              (previous_port_status in [sql_attr.NO_VALUE,"},{"line_number":85,"context_line":"                                        constants.PORT_STATUS_DOWN,"},{"line_number":86,"context_line":"                                        constants.PORT_STATUS_BUILD]"},{"line_number":87,"context_line":"               and current_port_status in [constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoFY%3D","line":84,"updated":"2014-03-05 00:30:19.000000000","message":"I find rather ugly the use of sql_attr.NO_VALUE.\nWhy did you decide to use this? I guess that\u0027s to express a condition of undetermined value for status, but in that case we should probably not rely on values coming from sqlalchemy","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        # case when a port is in admin_state_up \u003d False as we want"},{"line_number":82,"context_line":"        # the instance to still boot."},{"line_number":83,"context_line":"        elif ((port.admin_state_up is False) or"},{"line_number":84,"context_line":"              (previous_port_status in [sql_attr.NO_VALUE,"},{"line_number":85,"context_line":"                                        constants.PORT_STATUS_DOWN,"},{"line_number":86,"context_line":"                                        constants.PORT_STATUS_BUILD]"},{"line_number":87,"context_line":"               and current_port_status in [constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn7I%3D","line":84,"in_reply_to":"AAAAVn%2F%2FoFY%3D","updated":"2014-03-05 00:56:00.000000000","message":"Right, in some cases we need to know the previous state. NO_VALUE is what sqlalchemy sets if the model did not have a previous value. I don\u0027t really follow why this is an issue though or ugly?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                                           constants.PORT_STATUS_ERROR])):"},{"line_number":89,"context_line":"            event_name \u003d VIF_PLUGGED"},{"line_number":90,"context_line":"        # All other status changes we ignore since they are not helpful to"},{"line_number":91,"context_line":"        # tell nova about."},{"line_number":92,"context_line":"        else:"},{"line_number":93,"context_line":"            LOG.debug(_(\"Ignoring state change previous_port_status: \""},{"line_number":94,"context_line":"                        \"%(pre_status)s current_port_status: %(cur_status)s\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoFA%3D","line":91,"updated":"2014-03-05 00:30:19.000000000","message":"Suggestion: All the remaining state transitions are of no interest to nova","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                                           constants.PORT_STATUS_ERROR])):"},{"line_number":89,"context_line":"            event_name \u003d VIF_PLUGGED"},{"line_number":90,"context_line":"        # All other status changes we ignore since they are not helpful to"},{"line_number":91,"context_line":"        # tell nova about."},{"line_number":92,"context_line":"        else:"},{"line_number":93,"context_line":"            LOG.debug(_(\"Ignoring state change previous_port_status: \""},{"line_number":94,"context_line":"                        \"%(pre_status)s current_port_status: %(cur_status)s\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn68%3D","line":91,"in_reply_to":"AAAAVn%2F%2FoFA%3D","updated":"2014-03-05 00:56:00.000000000","message":"Done","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                      {\u0027pre_status\u0027: previous_port_status,"},{"line_number":97,"context_line":"                       \u0027cur_status\u0027: current_port_status,"},{"line_number":98,"context_line":"                       \u0027id\u0027: port.id})"},{"line_number":99,"context_line":"            return"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        port._notify_event \u003d ["},{"line_number":102,"context_line":"            {\u0027server_uuid\u0027: port.device_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoDQ%3D","line":99,"updated":"2014-03-05 00:30:19.000000000","message":"Is there the need to notify nova for an ACTIVE -\u003e ERROR transition (backend failure).\n\nor for admin_state_up false -\u003e true transitions and viceversa (that would probably be tantamount to VIF_PLUGGED/VIF_UNPLUGGED)","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                      {\u0027pre_status\u0027: previous_port_status,"},{"line_number":97,"context_line":"                       \u0027cur_status\u0027: current_port_status,"},{"line_number":98,"context_line":"                       \u0027id\u0027: port.id})"},{"line_number":99,"context_line":"            return"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"        port._notify_event \u003d ["},{"line_number":102,"context_line":"            {\u0027server_uuid\u0027: port.device_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn6k%3D","line":99,"updated":"2014-03-05 00:56:00.000000000","message":"Not currently. Nova only cares about when vifs have been plugged at the moment. In the future if nova wants to consume those things we could add it.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"a99bc88376eb8cef4fa75f11bb7616763c76d0df","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        ]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def notify_nova_port_status(self, mapper, connection, port):"},{"line_number":109,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":110,"context_line":"        if event:"},{"line_number":111,"context_line":"            self.notify_nova(event)"},{"line_number":112,"context_line":"        port._notify_event \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn4I%3D","line":109,"updated":"2014-03-05 01:00:52.000000000","message":"(Suggestion only) Consider encapsulating access to the _notify_event attribute on the port:\n\n@property\ndef event(self):\n  return getattr(self, \u0027_notify_event\u0027, None)\n\n@event.setter\ndef event(self, value)\n  self._notify_event \u003d value","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"99d1893808dad3b001297314eca6908a1d019c67","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        ]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def notify_nova_port_status(self, mapper, connection, port):"},{"line_number":109,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":110,"context_line":"        if event:"},{"line_number":111,"context_line":"            self.notify_nova(event)"},{"line_number":112,"context_line":"        port._notify_event \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FefI%3D","line":109,"in_reply_to":"AAAAVn%2F%2Fn0I%3D","updated":"2014-03-05 21:22:03.000000000","message":"Actually this doesn\u0027t look like it will work because _notify_event isn\u0027t part of this class. It\u0027s just data that i tag to the port.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"f39cba18aa92b8ac8d2deb3bec31a6354f17e2fc","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        ]"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def notify_nova_port_status(self, mapper, connection, port):"},{"line_number":109,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":110,"context_line":"        if event:"},{"line_number":111,"context_line":"            self.notify_nova(event)"},{"line_number":112,"context_line":"        port._notify_event \u003d None"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn0I%3D","line":109,"in_reply_to":"AAAAVn%2F%2Fn4I%3D","updated":"2014-03-05 01:02:54.000000000","message":"Done","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":110,"context_line":"        if event:"},{"line_number":111,"context_line":"            self.notify_nova(event)"},{"line_number":112,"context_line":"        port._notify_event \u003d None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def notify_nova(self, events):"},{"line_number":115,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoEc%3D","line":112,"updated":"2014-03-05 00:30:19.000000000","message":"as you\u0027re clearing the event here, which makes sense, does it make sense clearing it at line 56 as well?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":110,"context_line":"        if event:"},{"line_number":111,"context_line":"            self.notify_nova(event)"},{"line_number":112,"context_line":"        port._notify_event \u003d None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def notify_nova(self, events):"},{"line_number":115,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn5w%3D","line":112,"in_reply_to":"AAAAVn%2F%2FoEc%3D","updated":"2014-03-05 00:56:00.000000000","message":"I did this intentionally in case one called directly into here with port._notify_event set. I\u0027ll remove one of them if you want.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        port._notify_event \u003d None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def notify_nova(self, events):"},{"line_number":115,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoEM%3D","line":115,"updated":"2014-03-05 00:30:19.000000000","message":"nit: sending event to nova","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        port._notify_event \u003d None"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def notify_nova(self, events):"},{"line_number":115,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn5Q%3D","line":115,"in_reply_to":"AAAAVn%2F%2FoEM%3D","updated":"2014-03-05 00:56:00.000000000","message":"Done","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"        except Exception:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":120,"context_line":"        else:"},{"line_number":121,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoC4%3D","line":118,"updated":"2014-03-05 00:30:19.000000000","message":"do we need to implement a retry mechanism for transient failures?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"        except Exception:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":120,"context_line":"        else:"},{"line_number":121,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn44%3D","line":118,"in_reply_to":"AAAAVn%2F%2FoC4%3D","updated":"2014-03-05 00:56:00.000000000","message":"I thought about it but I figure we\u0027ll find this out later :)","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"        except Exception:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":120,"context_line":"        else:"},{"line_number":121,"context_line":"            try:"},{"line_number":122,"context_line":"                for event in response:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoDM%3D","line":119,"updated":"2014-03-05 00:30:19.000000000","message":"you\u0027ll end up clearing the event at line 112 without having ever notified nova. I\u0027m not sure if this could be a problem.\n\nI was thinking of a missed VIF_UNPLUGGED event, followed then by a DOWN-\u003eACTIVE transition, which will cause a repeat VIF_PLUGGED event.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        try:"},{"line_number":117,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":118,"context_line":"        except Exception:"},{"line_number":119,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":120,"context_line":"        else:"},{"line_number":121,"context_line":"            try:"},{"line_number":122,"context_line":"                for event in response:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn4Y%3D","line":119,"in_reply_to":"AAAAVn%2F%2FoDM%3D","updated":"2014-03-05 00:56:00.000000000","message":"Hrm, Sorry I\u0027m not quite following. I call notify on 111 so i\u0027m not sure why it matters that i clear it on 112 ?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"a99bc88376eb8cef4fa75f11bb7616763c76d0df","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                                      \"status\"), event)"},{"line_number":126,"context_line":"                    else:"},{"line_number":127,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":128,"context_line":"            # in case nova returns us someething unexpected"},{"line_number":129,"context_line":"            except(KeyError, TypeError):"},{"line_number":130,"context_line":"                LOG.error(_(\"Nova returned us this response: %s\"), response)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn4o%3D","line":128,"updated":"2014-03-05 01:00:52.000000000","message":"someething -\u003e something","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"f39cba18aa92b8ac8d2deb3bec31a6354f17e2fc","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                                      \"status\"), event)"},{"line_number":126,"context_line":"                    else:"},{"line_number":127,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":128,"context_line":"            # in case nova returns us someething unexpected"},{"line_number":129,"context_line":"            except(KeyError, TypeError):"},{"line_number":130,"context_line":"                LOG.error(_(\"Nova returned us this response: %s\"), response)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn0o%3D","line":128,"in_reply_to":"AAAAVn%2F%2Fn4o%3D","updated":"2014-03-05 01:02:54.000000000","message":"Done","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class NovaCallback(object):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTgw%3D","line":34,"updated":"2014-03-06 23:38:30.000000000","message":"I can\u0027t find a better name, so feel free to call this class NovaCallback","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class NovaCallback(object):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FSg0%3D","line":34,"in_reply_to":"AAAAVn%2F%2FTBU%3D","updated":"2014-03-07 18:54:19.000000000","message":"@Henry i agree i like that name better. Done","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"690fb84109217e38569de319f5cffe885e4ece8d","unresolved":false,"context_lines":[{"line_number":31,"context_line":"                                 constants.PORT_STATUS_DOWN: \u0027completed\u0027}"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"class NovaCallback(object):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTBU%3D","line":34,"in_reply_to":"AAAAVn%2F%2FTgw%3D","updated":"2014-03-07 00:25:23.000000000","message":"How about \u0027Notifier\u0027? It doesn\u0027t seem to be the prevalent style, but you could also reduce the redundant prefixes in the naming, and rename the directory to neutron/notifiers.The usage of this class could then read something like this:\n\n  from neutron.notifiers import nova\n  self.nova_notifier \u003d nova.Notifier()\n  self.nova_notifier.send_port_status\n  self.nova_notifier.send_port_status_changed","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        the notify_nova method which checks for _notify_event."},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":"        # clear out previous _notify_event"},{"line_number":61,"context_line":"        port._notify_event \u003d None"},{"line_number":62,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":63,"context_line":"        if not port.device_id:"},{"line_number":64,"context_line":"            LOG.debug(_(\"device_id is not set on port yet.\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTQA%3D","line":61,"updated":"2014-03-06 23:38:30.000000000","message":"Is it possible to rule out that at this stage there won\u0027t be any other even still waiting for being processed?\n\nMaybe not, but it is also true that in that case it would not be useful at all notifying nova twice. The last transition should be the one that matters.\n\nLet\u0027s assume the following. perhaps this is a border-line and maybe even impossible event, so it might not be important dealing with it.\n\nInitial status is DOWN and there are two distinct transactions, operating concurrently\n\n1 - Transaction #1: status set to ACTIVE\n      notify_port_status_changes sets the event to \nVIF_PLUGGED (DOWN -\u003e ACTIVE)\n2 - Transaction #2: status set to DOWN\n      notify_port_status_changed clears the even and returns because the transition (DOWN -\u003e DOWN) is of no interest to nova\n3 - after_update triggered for transaction #1. Nothing happens because _notify_event is None\n4 - after_update triggered for transaction #2. Nothing happens because _notify_event is None\n\nthe final result is that we should have sent nova  a VIF_PLUGGED and then a VIF_UNPLUGGED but instead we send nothing, which to some extent is even better.\n\nSummarizing, this could either be genius or wrong; but I can\u0027t figure it out by myself!","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        the notify_nova method which checks for _notify_event."},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":"        # clear out previous _notify_event"},{"line_number":61,"context_line":"        port._notify_event \u003d None"},{"line_number":62,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":63,"context_line":"        if not port.device_id:"},{"line_number":64,"context_line":"            LOG.debug(_(\"device_id is not set on port yet.\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FMco%3D","line":61,"in_reply_to":"AAAAVn%2F%2FTQA%3D","updated":"2014-03-07 18:54:19.000000000","message":"In this case port will actually be a new object so in this case we\u0027ll send two events to nova.","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":114,"context_line":"        if event:"},{"line_number":115,"context_line":"            self.notify_nova(event)"},{"line_number":116,"context_line":"        port._notify_event \u003d None"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def notify_nova(self, events):"},{"line_number":119,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTQE%3D","line":116,"updated":"2014-03-06 23:38:30.000000000","message":"this is still redundant but it does not matter a lot","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":114,"context_line":"        if event:"},{"line_number":115,"context_line":"            self.notify_nova(event)"},{"line_number":116,"context_line":"        port._notify_event \u003d None"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def notify_nova(self, events):"},{"line_number":119,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FSf8%3D","line":116,"in_reply_to":"AAAAVn%2F%2FTQE%3D","updated":"2014-03-07 18:54:19.000000000","message":"Right I did this intentionally","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        port._notify_event \u003d None"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def notify_nova(self, events):"},{"line_number":119,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":120,"context_line":"        try:"},{"line_number":121,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":122,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTdk%3D","line":119,"updated":"2014-03-06 23:38:30.000000000","message":"I think it\u0027s just a single event, or is it?\nI mean, it would be cool if we could send several events at once, which is also consistent with the fact that _notify_event is actually a list","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        port._notify_event \u003d None"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def notify_nova(self, events):"},{"line_number":119,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":120,"context_line":"        try:"},{"line_number":121,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":122,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FSfo%3D","line":119,"in_reply_to":"AAAAVn%2F%2FTdk%3D","updated":"2014-03-07 18:54:19.000000000","message":"events","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":120,"context_line":"        try:"},{"line_number":121,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":122,"context_line":"        except Exception:"},{"line_number":123,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":124,"context_line":"        else:"},{"line_number":125,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTd4%3D","line":122,"updated":"2014-03-06 23:38:30.000000000","message":"The point i made previously (patch set #7) is that here we are just logging the exception, but not raising.\ntherefore after this call returns _notify_event will be set to None, and the event lost forever without having reached nova.\n\nHowever, since the code currently does not have any mechanisms for queueing events or retrying them, I think that we could not care less.","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        LOG.debug(_(\"Sending event: %s\"), events)"},{"line_number":120,"context_line":"        try:"},{"line_number":121,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":122,"context_line":"        except Exception:"},{"line_number":123,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":124,"context_line":"        else:"},{"line_number":125,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FSfI%3D","line":122,"in_reply_to":"AAAAVn%2F%2FTd4%3D","updated":"2014-03-07 18:54:19.000000000","message":"Ah I see what you mean. Right I don\u0027t have anything to queue up events and send them later. I figure we can add something like that later if this becomes an issue.","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        try:"},{"line_number":121,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":122,"context_line":"        except Exception:"},{"line_number":123,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":124,"context_line":"        else:"},{"line_number":125,"context_line":"            try:"},{"line_number":126,"context_line":"                for event in response:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTao%3D","line":123,"updated":"2014-03-06 23:38:30.000000000","message":"LOG.exception and LOG.error in a not-so-far future will trigger failures in CI jobs. If this is an exception was severity is such that a job should fails if it occurs, then it\u0027s ok. Otherwise consider LOG.warn","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        try:"},{"line_number":121,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"},{"line_number":122,"context_line":"        except Exception:"},{"line_number":123,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":124,"context_line":"        else:"},{"line_number":125,"context_line":"            try:"},{"line_number":126,"context_line":"                for event in response:"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FMY4%3D","line":123,"in_reply_to":"AAAAVn%2F%2FTao%3D","updated":"2014-03-07 18:54:19.000000000","message":"Lets keep it as log.exception for now and change it later if we need to. The reason why i want LOG.exception is because this can fail in many ways. Nova is down/ keystone credentials are wrong etc.","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":124,"context_line":"        else:"},{"line_number":125,"context_line":"            try:"},{"line_number":126,"context_line":"                for event in response:"},{"line_number":127,"context_line":"                    if event[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":128,"context_line":"                        LOG.warning(_(\"Nova event: %s returned with failed \""},{"line_number":129,"context_line":"                                      \"status\"), event)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTb0%3D","line":126,"updated":"2014-03-06 23:38:30.000000000","message":"is there a need to deal with the case in which event is None? Perhaps a LOG.warn, but I don\u0027t know if that can even happen.","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            LOG.exception(_(\"Failed to notify nova on events: %s\"), events)"},{"line_number":124,"context_line":"        else:"},{"line_number":125,"context_line":"            try:"},{"line_number":126,"context_line":"                for event in response:"},{"line_number":127,"context_line":"                    if event[\u0027status\u0027] \u003d\u003d \u0027failed\u0027:"},{"line_number":128,"context_line":"                        LOG.warning(_(\"Nova event: %s returned with failed \""},{"line_number":129,"context_line":"                                      \"status\"), event)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FMYU%3D","line":126,"in_reply_to":"AAAAVn%2F%2FTb0%3D","updated":"2014-03-07 18:54:19.000000000","message":"I do deal with that case by catching the exceptions on line 133. I definitely want to do deal with this because nova could return anything to use in response and we don\u0027t want to die because of that.","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":132,"context_line":"            # in case nova returns us something unexpected"},{"line_number":133,"context_line":"            except(KeyError, TypeError):"},{"line_number":134,"context_line":"                LOG.error(_(\"Nova returned us this response: %s\"), response)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTcY%3D","line":134,"updated":"2014-03-06 23:38:30.000000000","message":"pedantry:\nLOG.error(_(\"Error response returned from nova:%s\"), response)","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":132,"context_line":"            # in case nova returns us something unexpected"},{"line_number":133,"context_line":"            except(KeyError, TypeError):"},{"line_number":134,"context_line":"                LOG.error(_(\"Nova returned us this response: %s\"), response)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FSgw%3D","line":134,"in_reply_to":"AAAAVn%2F%2FTcY%3D","updated":"2014-03-07 18:54:19.000000000","message":"Done","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"}],"neutron/common/config.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":101,"context_line":"core_cli_opts \u003d ["},{"line_number":102,"context_line":"    cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":103,"context_line":"                default\u003d\u0027/opt/stack/neutron\u0027,"},{"line_number":104,"context_line":"#               default\u003d\u0027/var/lib/neutron\u0027,"},{"line_number":105,"context_line":"               help\u003d_(\"Where to store Neutron state files. \""},{"line_number":106,"context_line":"                      \"This directory must be writable by the agent.\")),"},{"line_number":107,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F71k%3D","line":104,"updated":"2014-02-24 00:43:30.000000000","message":"I know this is only WIP, but I\u0027d recommend using local.conf to set the value for development instead of changing the default here. \n\nReference: http://devstack.org/configuration.html","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":101,"context_line":"core_cli_opts \u003d ["},{"line_number":102,"context_line":"    cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":103,"context_line":"                default\u003d\u0027/opt/stack/neutron\u0027,"},{"line_number":104,"context_line":"#               default\u003d\u0027/var/lib/neutron\u0027,"},{"line_number":105,"context_line":"               help\u003d_(\"Where to store Neutron state files. \""},{"line_number":106,"context_line":"                      \"This directory must be writable by the agent.\")),"},{"line_number":107,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxEI%3D","line":104,"in_reply_to":"AAAAU3%2F%2F71k%3D","updated":"2014-02-24 21:52:35.000000000","message":"I think there is a bug somewhere in the unit test code or oslo.conf because i never used to have to do this. I just haven\u0027t had the cycles to figure out what\u0027s going on there...","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"core_cli_opts \u003d ["},{"line_number":102,"context_line":"    cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":103,"context_line":"               default\u003d\u0027/opt/stack/neutron\u0027,"},{"line_number":104,"context_line":"               help\u003d_(\"Where to store Neutron state files. \""},{"line_number":105,"context_line":"                      \"This directory must be writable by the agent.\")),"},{"line_number":106,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2Feao%3D","line":103,"updated":"2014-02-26 12:46:10.000000000","message":"I\u0027m guessing you didn\u0027t intend to make this change.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"core_cli_opts \u003d ["},{"line_number":102,"context_line":"    cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":103,"context_line":"               default\u003d\u0027/opt/stack/neutron\u0027,"},{"line_number":104,"context_line":"               help\u003d_(\"Where to store Neutron state files. \""},{"line_number":105,"context_line":"                      \"This directory must be writable by the agent.\")),"},{"line_number":106,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2Faxc%3D","line":103,"in_reply_to":"AAAAU3%2F%2Feao%3D","updated":"2014-02-26 19:08:18.000000000","message":"Gah no.. There is some bug right now i\u0027m hitting that unless i set this the tests fail to run locally.... :////","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    cfg.BoolOpt(\u0027force_gateway_on_subnet\u0027, default\u003dFalse,"},{"line_number":83,"context_line":"                help\u003d_(\"Ensure that configured gateway is on subnet\")),"},{"line_number":84,"context_line":"    cfg.BoolOpt(\u0027notify_nova_port_active\u0027, default\u003dTrue,"},{"line_number":85,"context_line":"                help\u003d_(\"Sent notification to nova when port status is\""},{"line_number":86,"context_line":"                       \" active\")),"},{"line_number":87,"context_line":"    cfg.StrOpt(\u0027nova_url\u0027,"},{"line_number":88,"context_line":"               default\u003d\u0027http://127.0.0.1:8774\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fr7o%3D","line":85,"updated":"2014-03-04 17:40:16.000000000","message":"send?","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    cfg.BoolOpt(\u0027force_gateway_on_subnet\u0027, default\u003dFalse,"},{"line_number":83,"context_line":"                help\u003d_(\"Ensure that configured gateway is on subnet\")),"},{"line_number":84,"context_line":"    cfg.BoolOpt(\u0027notify_nova_port_active\u0027, default\u003dTrue,"},{"line_number":85,"context_line":"                help\u003d_(\"Sent notification to nova when port status is\""},{"line_number":86,"context_line":"                       \" active\")),"},{"line_number":87,"context_line":"    cfg.StrOpt(\u0027nova_url\u0027,"},{"line_number":88,"context_line":"               default\u003d\u0027http://127.0.0.1:8774\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fqxg%3D","line":85,"in_reply_to":"AAAAVn%2F%2Fr7o%3D","updated":"2014-03-04 19:02:38.000000000","message":"Done","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":87,"context_line":"    cfg.StrOpt(\u0027nova_url\u0027,"},{"line_number":88,"context_line":"               default\u003d\u0027http://127.0.0.1:8774\u0027,"},{"line_number":89,"context_line":"               help\u003d_(\u0027URL for connection to nova\u0027)),"},{"line_number":90,"context_line":"    cfg.StrOpt(\u0027nova_admin_username\u0027,"},{"line_number":91,"context_line":"               help\u003d_(\u0027Username for connecting to nova in admin context\u0027)),"},{"line_number":92,"context_line":"    cfg.StrOpt(\u0027nova_admin_password\u0027,"},{"line_number":93,"context_line":"               help\u003d_(\u0027Password for connection to nova in admin context\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Frws%3D","line":90,"updated":"2014-03-04 17:40:16.000000000","message":"Please see my comments on neutron.conf","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"22c6b53028bd936380c431cdde496077293d1288","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"core_cli_opts \u003d ["},{"line_number":104,"context_line":"    cfg.StrOpt(\u0027state_path\u0027,"},{"line_number":105,"context_line":"               default\u003d\u0027/opt/stack/neutron\u0027,"},{"line_number":106,"context_line":"               help\u003d_(\"Where to store Neutron state files. \""},{"line_number":107,"context_line":"                      \"This directory must be writable by the agent.\")),"},{"line_number":108,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2F1l8%3D","line":105,"updated":"2014-03-03 21:20:25.000000000","message":"Doh! Will remove after this gets reviewed by some people first...","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":81,"context_line":"               help\u003d_(\"The hostname Neutron is running on\")),"},{"line_number":82,"context_line":"    cfg.BoolOpt(\u0027force_gateway_on_subnet\u0027, default\u003dFalse,"},{"line_number":83,"context_line":"                help\u003d_(\"Ensure that configured gateway is on subnet\")),"},{"line_number":84,"context_line":"    cfg.BoolOpt(\u0027notify_nova_port_active\u0027, default\u003dFalse,"},{"line_number":85,"context_line":"                help\u003d_(\"Send notification to nova when port status is\""},{"line_number":86,"context_line":"                       \" active\")),"},{"line_number":87,"context_line":"    cfg.StrOpt(\u0027nova_url\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTZg%3D","line":84,"updated":"2014-03-06 23:38:30.000000000","message":"we expect in the future to notify nova of all port status transitions. I also think you already notify for more than just the transition to active.\n\nHence perhaps this param should be called notify_nova_on_port_status_changes","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":81,"context_line":"               help\u003d_(\"The hostname Neutron is running on\")),"},{"line_number":82,"context_line":"    cfg.BoolOpt(\u0027force_gateway_on_subnet\u0027, default\u003dFalse,"},{"line_number":83,"context_line":"                help\u003d_(\"Ensure that configured gateway is on subnet\")),"},{"line_number":84,"context_line":"    cfg.BoolOpt(\u0027notify_nova_port_active\u0027, default\u003dFalse,"},{"line_number":85,"context_line":"                help\u003d_(\"Send notification to nova when port status is\""},{"line_number":86,"context_line":"                       \" active\")),"},{"line_number":87,"context_line":"    cfg.StrOpt(\u0027nova_url\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FMX8%3D","line":84,"in_reply_to":"AAAAVn%2F%2FTZg%3D","updated":"2014-03-07 18:54:19.000000000","message":"Done","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"86237c0f518ba4bb82d776fd3151f94ba09450ae","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    cfg.StrOpt(\u0027nova_region_name\u0027,"},{"line_number":101,"context_line":"               help\u003d_(\u0027Name of nova region to use. Useful if keystone manages\u0027"},{"line_number":102,"context_line":"                      \u0027 more than one region.\u0027)),"},{"line_number":103,"context_line":"    cfg.IntOpt(\u0027send_events_interval\u0027, default\u003d2,"},{"line_number":104,"context_line":"               help\u003d_(\u0027Number of seconds between sending events to nova if \u0027"},{"line_number":105,"context_line":"                      \u0027there are any events to send.\u0027)),"},{"line_number":106,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAAVn%2F%2Bxjg%3D","line":103,"updated":"2014-03-12 08:52:22.000000000","message":"this perhaps can be reduced to 1 or even .5 in a subsequent patch to improve efficiency","commit_id":"a58808cd9e1b45e2c601510973202b742059df4d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"b822629b7fc58286516332d7b51f23f1527a9b28","unresolved":false,"context_lines":[{"line_number":100,"context_line":"    cfg.StrOpt(\u0027nova_region_name\u0027,"},{"line_number":101,"context_line":"               help\u003d_(\u0027Name of nova region to use. Useful if keystone manages\u0027"},{"line_number":102,"context_line":"                      \u0027 more than one region.\u0027)),"},{"line_number":103,"context_line":"    cfg.IntOpt(\u0027send_events_interval\u0027, default\u003d2,"},{"line_number":104,"context_line":"               help\u003d_(\u0027Number of seconds between sending events to nova if \u0027"},{"line_number":105,"context_line":"                      \u0027there are any events to send.\u0027)),"},{"line_number":106,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAAWH%2F%2F9gA%3D","line":103,"in_reply_to":"AAAAVn%2F%2Bxjg%3D","updated":"2014-03-12 17:21:28.000000000","message":"We can but that will cause the loop to run even faster. I set it at 2 to allow some batching of events. If we want to send the messages right away I can use eventlet.Queue() and have a greenthread just block on that queue and send right away when there is a message.","commit_id":"a58808cd9e1b45e2c601510973202b742059df4d"}],"neutron/db/db_base_plugin_v2.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        #                This connection is setup as memory for the tests."},{"line_number":233,"context_line":"        db.configure_db()"},{"line_number":234,"context_line":"        self.nova_callback \u003d nova.NovaCallback()"},{"line_number":235,"context_line":"        event.listen(models_v2.Port.status, \u0027set\u0027,"},{"line_number":236,"context_line":"                     self.nova_callback.notify_port_status_changed)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F7yY%3D","line":235,"updated":"2014-02-24 00:43:30.000000000","message":"The use of an orm-specific event is a little worrying, since it would seem to preclude use of raw sql.  Disregarding that, will this approach support all plugins (i.e. do all plugins update the port status on/around vif plug) or will it be necessary to falsely notify nova of success on port creation to avoid blocking nova until the timeout for event receipt is hit?","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        #                This connection is setup as memory for the tests."},{"line_number":233,"context_line":"        db.configure_db()"},{"line_number":234,"context_line":"        self.nova_callback \u003d nova.NovaCallback()"},{"line_number":235,"context_line":"        event.listen(models_v2.Port.status, \u0027set\u0027,"},{"line_number":236,"context_line":"                     self.nova_callback.notify_port_status_changed)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxDk%3D","line":235,"in_reply_to":"AAAAU3%2F%2F7yY%3D","updated":"2014-02-24 21:52:35.000000000","message":"I plan to add a way for plugins that don\u0027t implement this to add a __notify_nova_on_port_creation \u003d True in their plugin class and we\u0027ll notify nova no matter what the port status is.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"689a601400e1755bd9afd4e408badb0c4aacc0be","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def __init__(self):"},{"line_number":229,"context_line":"        db.configure_db()"},{"line_number":230,"context_line":"        self.nova_callback \u003d nova.NovaCallback()"},{"line_number":231,"context_line":"        event.listen(models_v2.Port, \u0027after_insert\u0027,"},{"line_number":232,"context_line":"                     self.nova_callback.notify_nova)"},{"line_number":233,"context_line":"        event.listen(models_v2.Port, \u0027after_update\u0027,"},{"line_number":234,"context_line":"                     self.nova_callback.notify_nova)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVX%2F%2F9ms%3D","line":231,"updated":"2014-02-27 05:30:14.000000000","message":"So is it necessary to watch these events to ensure that nova is notified when db changes are actually committed as opposed to the value of port status changing on a model instance?  If so, is it necessary to track port status?  What I\u0027m wondering is whether the after_insert/after_update events would have access to the old value of status so that the event could be generated at db commit instead of before.","commit_id":"8efdb25756b4107f5ba37b089adccfde608bdaf6"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"7a194f0bbd584b0fc6f14594da866030f92d0356","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def __init__(self):"},{"line_number":229,"context_line":"        db.configure_db()"},{"line_number":230,"context_line":"        self.nova_callback \u003d nova.NovaCallback()"},{"line_number":231,"context_line":"        event.listen(models_v2.Port, \u0027after_insert\u0027,"},{"line_number":232,"context_line":"                     self.nova_callback.notify_nova)"},{"line_number":233,"context_line":"        event.listen(models_v2.Port, \u0027after_update\u0027,"},{"line_number":234,"context_line":"                     self.nova_callback.notify_nova)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVX%2F%2F8wM%3D","line":231,"in_reply_to":"AAAAVX%2F%2F9dQ%3D","updated":"2014-02-27 07:26:44.000000000","message":"About using sql-alchemy history,  I\u0027m not sure how sql-alchemy keeps history for a table, but, in other engines I\u0027ve worked with, it\u0027s too expensive and leads to a very big table containing all-database-history, In that case, keeping track ourselves could be a better option. I must educate myself about sql-alchemy \u0027:-)","commit_id":"8efdb25756b4107f5ba37b089adccfde608bdaf6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"d9c311666e83bcf9f83b99b3ada274861050fecc","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    def __init__(self):"},{"line_number":229,"context_line":"        db.configure_db()"},{"line_number":230,"context_line":"        self.nova_callback \u003d nova.NovaCallback()"},{"line_number":231,"context_line":"        event.listen(models_v2.Port, \u0027after_insert\u0027,"},{"line_number":232,"context_line":"                     self.nova_callback.notify_nova)"},{"line_number":233,"context_line":"        event.listen(models_v2.Port, \u0027after_update\u0027,"},{"line_number":234,"context_line":"                     self.nova_callback.notify_nova)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAVX%2F%2F9dQ%3D","line":231,"in_reply_to":"AAAAVX%2F%2F9ms%3D","updated":"2014-02-27 05:58:12.000000000","message":"So is it necessary to watch these events to ensure that nova is notified when db changes are actually committed as opposed to the value of port status changing on a model instance? \n\narosen --- That\u0027s exactly right. Previously, the code would notify whenever the values changed (as you pointed out) and not committed which isn\u0027t ideal. \n\nIf so, is it necessary to track port status? \n\narosen - yes, because we need to know the prev status in some cases for the status that we send to nova. \n\nWhat I\u0027m wondering is whether the after_insert/after_update events would have access to the old value of status so that the event could be generated at db commit instead of before.\n\narosen -- I actually pass the event in via: port._event_notity which is set in notify_port_status_changed(). In sqlalchemy 9 it has a way to get access to the history though our version seems to old to do this. I think the trick of passing in ._event_notify might be fine for now until we can bump the version of sqlalchemy.","commit_id":"8efdb25756b4107f5ba37b089adccfde608bdaf6"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"51a506f3b84a57233b0890b363705d155a81fe57","unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def __init__(self):"},{"line_number":229,"context_line":"        db.configure_db()"},{"line_number":230,"context_line":"        if cfg.CONF.notify_nova_port_active:"},{"line_number":231,"context_line":"            self.nova_callback \u003d nova.NovaCallback()"},{"line_number":232,"context_line":"            event.listen(models_v2.Port, \u0027after_insert\u0027,"},{"line_number":233,"context_line":"                         self.nova_callback.notify_nova)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2FrxE%3D","line":230,"updated":"2014-03-04 17:40:16.000000000","message":"I think the two-pronged approach you came up with (where the status is set in one method and the update sent with another) might not work with direct sqlalchemy update statements like this:\n\nhttp://docs.sqlalchemy.org/en/rel_0_9/core/selectable.html#sqlalchemy.sql.expression.TableClause.update","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"7d239000b13c82d19b0aa868e47466bde535b1b3","unresolved":false,"context_lines":[{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def __init__(self):"},{"line_number":229,"context_line":"        db.configure_db()"},{"line_number":230,"context_line":"        if cfg.CONF.notify_nova_port_active:"},{"line_number":231,"context_line":"            self.nova_callback \u003d nova.NovaCallback()"},{"line_number":232,"context_line":"            event.listen(models_v2.Port, \u0027after_insert\u0027,"},{"line_number":233,"context_line":"                         self.nova_callback.notify_nova)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAVn%2F%2Fqw4%3D","line":230,"in_reply_to":"AAAAVn%2F%2FrxE%3D","updated":"2014-03-04 19:02:38.000000000","message":"i believe you are right. One needs to use the ORM model directly right now otherwise they will have to call notify themselves.","commit_id":"d2ec7c40108eb0832128744399c6f1e4e382f951"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            event.listen(models_v2.Port, \u0027after_update\u0027,"},{"line_number":235,"context_line":"                         self.nova_callback.notify_nova_port_status)"},{"line_number":236,"context_line":"            event.listen(models_v2.Port.status, \u0027set\u0027,"},{"line_number":237,"context_line":"                         self.nova_callback.notify_port_status_changed)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    @classmethod"},{"line_number":240,"context_line":"    def register_dict_extend_funcs(cls, resource, funcs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoBI%3D","line":237,"updated":"2014-03-05 00:30:19.000000000","message":"I\u0027m not really sure we want to have db level listeners here.\nI understand there was probably no easier way of doing this and the alternative were equally ugly.\n\nThis is however a piece of code we\u0027ll have to come back to once we\u0027ll implement the plan of moving db access logic out of the plugin class. In the meanwhile I guess it\u0027s ok.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"c7f796abcb558268e4424352f3cc01d080c4bf45","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            event.listen(models_v2.Port, \u0027after_update\u0027,"},{"line_number":235,"context_line":"                         self.nova_callback.notify_nova_port_status)"},{"line_number":236,"context_line":"            event.listen(models_v2.Port.status, \u0027set\u0027,"},{"line_number":237,"context_line":"                         self.nova_callback.notify_port_status_changed)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    @classmethod"},{"line_number":240,"context_line":"    def register_dict_extend_funcs(cls, resource, funcs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FnHU%3D","line":237,"in_reply_to":"AAAAVn%2F%2Fn4U%3D","updated":"2014-03-05 03:00:53.000000000","message":"I wonder if a more elegant way to deal with this is to use an _augmented_ session object. In the end, virtually every operation in Neutron carries a context and hence a session, thus giving us the interceptor for doing the notification bits.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            event.listen(models_v2.Port, \u0027after_update\u0027,"},{"line_number":235,"context_line":"                         self.nova_callback.notify_nova_port_status)"},{"line_number":236,"context_line":"            event.listen(models_v2.Port.status, \u0027set\u0027,"},{"line_number":237,"context_line":"                         self.nova_callback.notify_port_status_changed)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    @classmethod"},{"line_number":240,"context_line":"    def register_dict_extend_funcs(cls, resource, funcs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn4U%3D","line":237,"in_reply_to":"AAAAVn%2F%2FoBI%3D","updated":"2014-03-05 00:56:00.000000000","message":"I agree though I think for now we wanted some way to support this without changing all the plugin code.","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def __init__(self):"},{"line_number":225,"context_line":"        db.configure_db()"},{"line_number":226,"context_line":"        if cfg.CONF.notify_nova_port_active:"},{"line_number":227,"context_line":"            self.nova_callback \u003d nova.NovaCallback()"},{"line_number":228,"context_line":"            event.listen(models_v2.Port, \u0027after_insert\u0027,"},{"line_number":229,"context_line":"                         self.nova_callback.notify_nova_port_status)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTZU%3D","line":226,"updated":"2014-03-06 23:38:30.000000000","message":"am I too pedant if I ask you to add a #NOTE here explaining other developers why these listeners were added?","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":223,"context_line":""},{"line_number":224,"context_line":"    def __init__(self):"},{"line_number":225,"context_line":"        db.configure_db()"},{"line_number":226,"context_line":"        if cfg.CONF.notify_nova_port_active:"},{"line_number":227,"context_line":"            self.nova_callback \u003d nova.NovaCallback()"},{"line_number":228,"context_line":"            event.listen(models_v2.Port, \u0027after_insert\u0027,"},{"line_number":229,"context_line":"                         self.nova_callback.notify_nova_port_status)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FMH0%3D","line":226,"in_reply_to":"AAAAVn%2F%2FTZU%3D","updated":"2014-03-07 18:54:19.000000000","message":"Done","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"}],"neutron/db/models_v2.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"bc4a97001dfad84b124da6b88bdb378636c66a79","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    fixed_ips \u003d orm.relationship(IPAllocation, backref\u003d\u0027ports\u0027, lazy\u003d\u0027joined\u0027)"},{"line_number":127,"context_line":"    mac_address \u003d sa.Column(sa.String(32), nullable\u003dFalse)"},{"line_number":128,"context_line":"    admin_state_up \u003d sa.Column(sa.Boolean(), nullable\u003dFalse)"},{"line_number":129,"context_line":"    status \u003d sa.Column(sa.String(16), nullable\u003dFalse)"},{"line_number":130,"context_line":"    device_id \u003d sa.Column(sa.String(255), nullable\u003dFalse)"},{"line_number":131,"context_line":"    device_owner \u003d sa.Column(sa.String(255), nullable\u003dFalse)"},{"line_number":132,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2FoA0%3D","line":129,"updated":"2014-03-05 00:30:19.000000000","message":"if you give a default here, could you avoid then using NO_VALUE as a possible state for evaluating transitions?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a0670196a9642d701b4061df3551b4b5742b0bb4","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    fixed_ips \u003d orm.relationship(IPAllocation, backref\u003d\u0027ports\u0027, lazy\u003d\u0027joined\u0027)"},{"line_number":127,"context_line":"    mac_address \u003d sa.Column(sa.String(32), nullable\u003dFalse)"},{"line_number":128,"context_line":"    admin_state_up \u003d sa.Column(sa.Boolean(), nullable\u003dFalse)"},{"line_number":129,"context_line":"    status \u003d sa.Column(sa.String(16), nullable\u003dFalse)"},{"line_number":130,"context_line":"    device_id \u003d sa.Column(sa.String(255), nullable\u003dFalse)"},{"line_number":131,"context_line":"    device_owner \u003d sa.Column(sa.String(255), nullable\u003dFalse)"},{"line_number":132,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAVn%2F%2Fn3k%3D","line":129,"in_reply_to":"AAAAVn%2F%2FoA0%3D","updated":"2014-03-05 00:56:00.000000000","message":"Perhaps, I haven\u0027t tried it. Though, i\u0027m curious why you\u0027re brought  this up. In my opinion the prev_value of something being NO_VALUE seems legit?","commit_id":"aef7385e3e07d74259929c7e8a2b045b6c856f47"}],"neutron/notifiers/nova.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"25876dee276627a1ab4236694bfa2831bab6c560","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from novaclient.v1_1.contrib import server_external_events"},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":"from sqlalchemy.orm import attributes as sql_attr"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from neutron.common import constants"},{"line_number":23,"context_line":"from neutron.openstack.common import log as logging"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FIHc%3D","line":20,"updated":"2014-03-08 19:31:05.000000000","message":"one blank line","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from novaclient.v1_1.contrib import server_external_events"},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":"from sqlalchemy.orm import attributes as sql_attr"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from neutron.common import constants"},{"line_number":23,"context_line":"from neutron.openstack.common import log as logging"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FHpI%3D","line":20,"in_reply_to":"AAAAVn%2F%2FIHc%3D","updated":"2014-03-10 18:33:58.000000000","message":"Done","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5c13806affb7ac81085eb43f9b494eb635520bdc","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class Notifier(object):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"},{"line_number":38,"context_line":"        # how to deal with different regions here...."},{"line_number":39,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":40,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FA3E%3D","line":37,"updated":"2014-03-10 18:04:35.000000000","message":"(Suggestion only) Would it make sense to separate the client creation from the notifier instantiation to simplify testing of region handling?  This is probably a forward-looking concern, but I\u0027ve been considering whether dependency injection (i.e. passing the nova client to __init__) would make more sense than having to mock the attribute at test-time.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"08119b0f6ecd23d1f9235a9b85b0ab311755a63a","unresolved":false,"context_lines":[{"line_number":34,"context_line":"class Notifier(object):"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    def __init__(self):"},{"line_number":37,"context_line":"        # TODO(arosen): we need to cache the endpoints and figure out"},{"line_number":38,"context_line":"        # how to deal with different regions here...."},{"line_number":39,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":40,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2B%2FM8%3D","line":37,"in_reply_to":"AAAAVn%2F%2FA3E%3D","updated":"2014-03-10 21:17:17.000000000","message":"Then we\u0027d need to do this and pass the nova client everytime we initialize Notifier?","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"3029d685bdd35e8b35dd94cd3c9b83bd47e1b2da","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            region_name\u003dcfg.CONF.nova_region_name,"},{"line_number":49,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def port_status_changed(self, port, current_port_status,"},{"line_number":52,"context_line":"                            previous_port_status, initiator):"},{"line_number":53,"context_line":"        \"\"\"Determine if nova needs to be notified due to port status change."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FFDM%3D","line":51,"updated":"2014-03-10 05:30:07.000000000","message":"Do you want to verbify this method name? Maybe \u0027record_port_status_change\u0027?","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            region_name\u003dcfg.CONF.nova_region_name,"},{"line_number":49,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def port_status_changed(self, port, current_port_status,"},{"line_number":52,"context_line":"                            previous_port_status, initiator):"},{"line_number":53,"context_line":"        \"\"\"Determine if nova needs to be notified due to port status change."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FA4c%3D","line":51,"in_reply_to":"AAAAVn%2F%2FFDM%3D","updated":"2014-03-10 18:33:58.000000000","message":"Done","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5c13806affb7ac81085eb43f9b494eb635520bdc","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        the notify_nova method which checks for _notify_event."},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":"        # clear out previous _notify_event"},{"line_number":61,"context_line":"        port._notify_event \u003d None"},{"line_number":62,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":63,"context_line":"        if not port.device_id:"},{"line_number":64,"context_line":"            LOG.debug(_(\"device_id is not set on port yet.\"))"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAyo%3D","line":61,"updated":"2014-03-10 18:04:35.000000000","message":"(Suggestion only)  Consider separating out setting the notify event on the port, e.g.\n\ndef create_port_event(...):\n   pass\n\ndef port_status_changed(port, *args, **kwargs):\n   port._notify_event \u003d None\n   event \u003d create_port_event(*args, **kwargs)\n   if event:\n     port._notify_event \u003d event\n\nMy rule of thumb is: separate it if you can.  This simple strategy makes both maintenance and testing much easier.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"08119b0f6ecd23d1f9235a9b85b0ab311755a63a","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        the notify_nova method which checks for _notify_event."},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":"        # clear out previous _notify_event"},{"line_number":61,"context_line":"        port._notify_event \u003d None"},{"line_number":62,"context_line":"        # If there is no device_id set there is nothing we can do here."},{"line_number":63,"context_line":"        if not port.device_id:"},{"line_number":64,"context_line":"            LOG.debug(_(\"device_id is not set on port yet.\"))"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2B%2FLo%3D","line":61,"in_reply_to":"AAAAVn%2F%2FAyo%3D","updated":"2014-03-10 21:17:17.000000000","message":"I hear what you\u0027re saying though I don\u0027t think this really buys us much here. The notify event is set on lines 102-107 if needed. Once there are more events we should definitely pull that out .","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"25876dee276627a1ab4236694bfa2831bab6c560","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        # We only want to notify about nova ports."},{"line_number":73,"context_line":"        if (not port.device_owner or"},{"line_number":74,"context_line":"            not port.device_owner.startswith(\u0027compute\u0027)):"},{"line_number":75,"context_line":"            return"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        # We notify nova when a vif is unplugged which only occurs when"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FIDQ%3D","line":74,"updated":"2014-03-08 19:31:05.000000000","message":"Nit: Isn\u0027t \"compute:\" better?","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        # We only want to notify about nova ports."},{"line_number":73,"context_line":"        if (not port.device_owner or"},{"line_number":74,"context_line":"            not port.device_owner.startswith(\u0027compute\u0027)):"},{"line_number":75,"context_line":"            return"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        # We notify nova when a vif is unplugged which only occurs when"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FHpE%3D","line":74,"in_reply_to":"AAAAVn%2F%2FIDQ%3D","updated":"2014-03-10 18:33:58.000000000","message":"Done","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"3029d685bdd35e8b35dd94cd3c9b83bd47e1b2da","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":84,"context_line":"        # when the status goes from:"},{"line_number":85,"context_line":"        # NO_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN."},{"line_number":86,"context_line":"        elif (previous_port_status in [sql_attr.NO_VALUE,"},{"line_number":87,"context_line":"                                       constants.PORT_STATUS_DOWN,"},{"line_number":88,"context_line":"                                       constants.PORT_STATUS_BUILD]"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FFD4%3D","line":85,"updated":"2014-03-10 05:30:07.000000000","message":"This comment doesn\u0027t match the condition. The to \u0027ACTIVE/DOWN\u0027 should be \u0027ACTIVE/ERROR\u0027.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        # We only notify nova when a vif is plugged which only occurs"},{"line_number":84,"context_line":"        # when the status goes from:"},{"line_number":85,"context_line":"        # NO_VALUE/DOWN/BUILD -\u003e ACTIVE/DOWN."},{"line_number":86,"context_line":"        elif (previous_port_status in [sql_attr.NO_VALUE,"},{"line_number":87,"context_line":"                                       constants.PORT_STATUS_DOWN,"},{"line_number":88,"context_line":"                                       constants.PORT_STATUS_BUILD]"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FE6w%3D","line":85,"in_reply_to":"AAAAVn%2F%2FFD4%3D","updated":"2014-03-10 18:33:58.000000000","message":"Done","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"25876dee276627a1ab4236694bfa2831bab6c560","unresolved":false,"context_lines":[{"line_number":104,"context_line":"             \u0027name\u0027: event_name,"},{"line_number":105,"context_line":"             \u0027status\u0027: NEUTRON_NOVA_EVENT_STATUS_MAP.get(current_port_status),"},{"line_number":106,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":107,"context_line":"        ]"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def send_nova_port_status(self, mapper, connection, port):"},{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FICo%3D","line":107,"updated":"2014-03-08 19:31:05.000000000","message":"Question: When port status is updated, port_status_changed hook is first called and after db update is done send_nova_port_status hook is called. Is it right?","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":104,"context_line":"             \u0027name\u0027: event_name,"},{"line_number":105,"context_line":"             \u0027status\u0027: NEUTRON_NOVA_EVENT_STATUS_MAP.get(current_port_status),"},{"line_number":106,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":107,"context_line":"        ]"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def send_nova_port_status(self, mapper, connection, port):"},{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAn8%3D","line":107,"in_reply_to":"AAAAVn%2F%2FICo%3D","updated":"2014-03-10 18:33:58.000000000","message":"correct","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"3029d685bdd35e8b35dd94cd3c9b83bd47e1b2da","unresolved":false,"context_lines":[{"line_number":106,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":107,"context_line":"        ]"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def send_nova_port_status(self, mapper, connection, port):"},{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":111,"context_line":"        if event:"},{"line_number":112,"context_line":"            self.notify_nova(event)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FFIA%3D","line":109,"updated":"2014-03-10 05:30:07.000000000","message":"Remove \u0027_nova\u0027 infix?  i.e. \u0027send_port_status\u0027","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":106,"context_line":"             \u0027tag\u0027: port.id}"},{"line_number":107,"context_line":"        ]"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def send_nova_port_status(self, mapper, connection, port):"},{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":111,"context_line":"        if event:"},{"line_number":112,"context_line":"            self.notify_nova(event)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAn4%3D","line":109,"in_reply_to":"AAAAVn%2F%2FFIA%3D","updated":"2014-03-10 18:33:58.000000000","message":"Done","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"25876dee276627a1ab4236694bfa2831bab6c560","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    def send_nova_port_status(self, mapper, connection, port):"},{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":111,"context_line":"        if event:"},{"line_number":112,"context_line":"            self.notify_nova(event)"},{"line_number":113,"context_line":"        port._notify_event \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def notify_nova(self, events):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FIDk%3D","line":112,"updated":"2014-03-08 19:31:05.000000000","message":"The argument of notify_nova at L.115 is a plural form, but a singular form is used here. I just wonder why?","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    def send_nova_port_status(self, mapper, connection, port):"},{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":111,"context_line":"        if event:"},{"line_number":112,"context_line":"            self.notify_nova(event)"},{"line_number":113,"context_line":"        port._notify_event \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def notify_nova(self, events):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAmg%3D","line":112,"in_reply_to":"AAAAVn%2F%2FIAU%3D","updated":"2014-03-10 18:33:58.000000000","message":"Right we the interface nova exposes allows us to send multiple events in one api request. Right now we are only sending a single event though.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"e7db70f2262f2037e2489270e7940a4624ab928a","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    def send_nova_port_status(self, mapper, connection, port):"},{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":111,"context_line":"        if event:"},{"line_number":112,"context_line":"            self.notify_nova(event)"},{"line_number":113,"context_line":"        port._notify_event \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def notify_nova(self, events):"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FIAU%3D","line":112,"in_reply_to":"AAAAVn%2F%2FIDk%3D","updated":"2014-03-08 19:44:01.000000000","message":"Looking at network event patch https://review.openstack.org/#/c/78041/8/neutron/notifiers/nova.py, it seems \"[event]\" need to used.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"3029d685bdd35e8b35dd94cd3c9b83bd47e1b2da","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":111,"context_line":"        if event:"},{"line_number":112,"context_line":"            self.notify_nova(event)"},{"line_number":113,"context_line":"        port._notify_event \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def notify_nova(self, events):"},{"line_number":116,"context_line":"        LOG.debug(_(\"Sending events: %s\"), events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FFBE%3D","line":113,"updated":"2014-03-10 05:30:07.000000000","message":"Consider indenting this under the if.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        event \u003d getattr(port, \"_notify_event\", None)"},{"line_number":111,"context_line":"        if event:"},{"line_number":112,"context_line":"            self.notify_nova(event)"},{"line_number":113,"context_line":"        port._notify_event \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def notify_nova(self, events):"},{"line_number":116,"context_line":"        LOG.debug(_(\"Sending events: %s\"), events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAmQ%3D","line":113,"in_reply_to":"AAAAVn%2F%2FFBE%3D","updated":"2014-03-10 18:33:58.000000000","message":"I want to make sure we clear this here just incase.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"3029d685bdd35e8b35dd94cd3c9b83bd47e1b2da","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            self.notify_nova(event)"},{"line_number":113,"context_line":"        port._notify_event \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def notify_nova(self, events):"},{"line_number":116,"context_line":"        LOG.debug(_(\"Sending events: %s\"), events)"},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FFH4%3D","line":115,"updated":"2014-03-10 05:30:07.000000000","message":"Private method? It\u0027s in nova.Notifier class, so name it \u0027_send\u0027 or \u0027_send_events\u0027?","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            self.notify_nova(event)"},{"line_number":113,"context_line":"        port._notify_event \u003d None"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def notify_nova(self, events):"},{"line_number":116,"context_line":"        LOG.debug(_(\"Sending events: %s\"), events)"},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            response \u003d self.nclient.server_external_events.create(events)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAlg%3D","line":115,"in_reply_to":"AAAAVn%2F%2FFH4%3D","updated":"2014-03-10 18:33:58.000000000","message":"Done","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5c13806affb7ac81085eb43f9b494eb635520bdc","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                    else:"},{"line_number":128,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":129,"context_line":"            # in case nova returns us something unexpected"},{"line_number":130,"context_line":"            except(KeyError, TypeError):"},{"line_number":131,"context_line":"                LOG.error(_(\"Error response returned from nova: %s\"),"},{"line_number":132,"context_line":"                          response)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FA9s%3D","line":130,"updated":"2014-03-10 18:04:35.000000000","message":"Consider limiting the try/catch block to dict access, both because it improves code clarity and to ensure that an error with a single event doesn\u0027t prevent logging the status of valid events, e.g.\n\n  response_error \u003d False\n  for event in response:\n    try:\n      status \u003d event[\u0027status\u0027]\n    except (KeyError, TypeError):\n      response_error \u003d True\n    else:\n      [log event status]\n  if response_error:\n    [log error]","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"08119b0f6ecd23d1f9235a9b85b0ab311755a63a","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                    else:"},{"line_number":128,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":129,"context_line":"            # in case nova returns us something unexpected"},{"line_number":130,"context_line":"            except(KeyError, TypeError):"},{"line_number":131,"context_line":"                LOG.error(_(\"Error response returned from nova: %s\"),"},{"line_number":132,"context_line":"                          response)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2B%2FFs%3D","line":130,"in_reply_to":"AAAAVn%2F%2FA9s%3D","updated":"2014-03-10 21:17:17.000000000","message":"Done, also there is a bug in this code if response isn\u0027t a list;","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6e7d880a821c58b6cb6d2f341ba2b030862fd532","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                    else:"},{"line_number":127,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":128,"context_line":"            # in case nova returns us something unexpected"},{"line_number":129,"context_line":"            except(KeyError, TypeError):"},{"line_number":130,"context_line":"                LOG.error(_(\"Error response returned from nova: %s\"),"},{"line_number":131,"context_line":"                          response)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2B%2FaU%3D","line":129,"updated":"2014-03-10 20:38:39.000000000","message":"It would be helpful if you would reply to all non-suggestions even if only to indicate that you do not intend to address it.","commit_id":"9ed52cb4e679585611127cef6bd0750490543f79"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"9ecf3d67022f94d68dd7d8a6510eaa53e98689b1","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                    else:"},{"line_number":127,"context_line":"                        LOG.info(_(\"Nova event response: %s\"), event)"},{"line_number":128,"context_line":"            # in case nova returns us something unexpected"},{"line_number":129,"context_line":"            except(KeyError, TypeError):"},{"line_number":130,"context_line":"                LOG.error(_(\"Error response returned from nova: %s\"),"},{"line_number":131,"context_line":"                          response)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2B%2FE8%3D","line":129,"in_reply_to":"AAAAVn%2F%2B%2FaU%3D","updated":"2014-03-10 21:20:36.000000000","message":"Sorry about that you submitted your comments after I started working on a new patch and didn\u0027t see them. Fixed.","commit_id":"9ed52cb4e679585611127cef6bd0750490543f79"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"1bec19e5259ede3a1958133cd0d3dded0dce2554","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        # We notify nova when a vif is unplugged which only occurs when"},{"line_number":77,"context_line":"        # the status goes from ACTIVE to DOWN."},{"line_number":78,"context_line":"        if (previous_port_status \u003d\u003d constants.PORT_STATUS_ACTIVE and"},{"line_number":79,"context_line":"            current_port_status \u003d\u003d constants.PORT_STATUS_DOWN):"},{"line_number":80,"context_line":"            event_name \u003d VIF_UNPLUGGED"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9jw%3D","line":78,"updated":"2014-03-11 01:33:42.000000000","message":"It\u0027s kind of crazy to have to duplicate this kind of logic in the tests.  The first thing I\u0027d like to suggest is extracting event name determination into its own method so it can be easily mocked out in unrelated tests.  The second is making the extracted method more data-driven, e.g.\n \nevent_name_config \u003d [\n([PORT_STATUS_ACTIVE], [PORT_STATUS_DOWN], VIF_UNPLUGGED)\n  ...\n]\nfor pre_status, current_status, name in event_name_config:\n  if (previous_port_status in pre_status and \n          current_port_status in current_status):\n     event_name \u003d name\n     break\n\nThe idea here is that you only test that the method executes in a single path successfully.  There\u0027s no point in testing that each data configuration is correct, since it\u0027s just as likely to be wrong a second time and maintaining it is problematic for that very reason.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2a8c5f1292c9c8bf4bc546bf261a7c995365bab7","unresolved":false,"context_lines":[{"line_number":75,"context_line":""},{"line_number":76,"context_line":"        # We notify nova when a vif is unplugged which only occurs when"},{"line_number":77,"context_line":"        # the status goes from ACTIVE to DOWN."},{"line_number":78,"context_line":"        if (previous_port_status \u003d\u003d constants.PORT_STATUS_ACTIVE and"},{"line_number":79,"context_line":"            current_port_status \u003d\u003d constants.PORT_STATUS_DOWN):"},{"line_number":80,"context_line":"            event_name \u003d VIF_UNPLUGGED"},{"line_number":81,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9fI%3D","line":78,"in_reply_to":"AAAAVn%2F%2B9jw%3D","updated":"2014-03-11 01:44:14.000000000","message":"I\u0027d prefer to just leave this for now if that\u0027s okay.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"46c2b8eecb358f94ed3a0d8389692d8c2c26bde4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        # how to deal with different regions here...."},{"line_number":38,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":39,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"},{"line_number":40,"context_line":"        self.nclient \u003d nclient.Client("},{"line_number":41,"context_line":"            username\u003dcfg.CONF.nova_admin_username,"},{"line_number":42,"context_line":"            api_key\u003dcfg.CONF.nova_admin_password,"},{"line_number":43,"context_line":"            project_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAVn%2F%2B4wM%3D","line":40,"updated":"2014-03-11 14:46:10.000000000","message":"Seems like we need a bit of logic to reauth here otherwise we\u0027ll get 403\u0027s in 24 hrs for a default config.","commit_id":"268b67aa0f212823052b0526fcc3b2e4ee6d4dfc"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6b691e82aa581f08e03d1834d75fc1eda54249b4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        # how to deal with different regions here...."},{"line_number":38,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":39,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"},{"line_number":40,"context_line":"        self.nclient \u003d nclient.Client("},{"line_number":41,"context_line":"            username\u003dcfg.CONF.nova_admin_username,"},{"line_number":42,"context_line":"            api_key\u003dcfg.CONF.nova_admin_password,"},{"line_number":43,"context_line":"            project_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAVn%2F%2B4PM%3D","line":40,"in_reply_to":"AAAAVn%2F%2B4ig%3D","updated":"2014-03-11 15:29:21.000000000","message":"It does here: https://github.com/openstack/python-novaclient/blob/master/novaclient/client.py#L262","commit_id":"268b67aa0f212823052b0526fcc3b2e4ee6d4dfc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"44559d2da227aabcbd0bd158af6542d35940aab3","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        # how to deal with different regions here...."},{"line_number":38,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":39,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"},{"line_number":40,"context_line":"        self.nclient \u003d nclient.Client("},{"line_number":41,"context_line":"            username\u003dcfg.CONF.nova_admin_username,"},{"line_number":42,"context_line":"            api_key\u003dcfg.CONF.nova_admin_password,"},{"line_number":43,"context_line":"            project_id\u003dNone,"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAVn%2F%2B4ig%3D","line":40,"in_reply_to":"AAAAVn%2F%2B4wM%3D","updated":"2014-03-11 15:04:05.000000000","message":"Client should reauthenticate on its own.","commit_id":"268b67aa0f212823052b0526fcc3b2e4ee6d4dfc"}],"neutron/tests/unit/callbacks/__init__.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32ad77f74a403a6d8b583bdbc6b466a35537094e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright 2014 OpenStack Foundation."},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2F7z8%3D","line":1,"updated":"2014-02-24 00:43:30.000000000","message":"Boilerplate not required for empty file.","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"97053107e160fafbd7ffaee74e1dac7c47c56c8f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright 2014 OpenStack Foundation."},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAU3%2F%2FxDM%3D","line":1,"in_reply_to":"AAAAU3%2F%2F7z8%3D","updated":"2014-02-24 21:52:35.000000000","message":"Done","commit_id":"95db8b0deff63a552034402e4a46b0845f82bd2d"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FeZ4%3D","line":1,"updated":"2014-02-26 12:46:10.000000000","message":"Boilerplate not required.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2014 OpenStack Foundation."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FaxQ%3D","line":1,"in_reply_to":"AAAAU3%2F%2FeZ4%3D","updated":"2014-02-26 19:08:18.000000000","message":"Done","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"}],"neutron/tests/unit/callbacks/test_callbacks_nova.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                                      status\u003dcurrent_port_status)"},{"line_number":70,"context_line":"                self._notify_port_status_changed_helper(current_port_status,"},{"line_number":71,"context_line":"                                                        previous_port_status,"},{"line_number":72,"context_line":"                                                        port)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_no_notify_no_device_owner(self):"},{"line_number":75,"context_line":"        port \u003d models_v2.Port(id\u003d\u0027port-uuid\u0027, device_id\u003d\u0027device-uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTVs%3D","line":72,"updated":"2014-03-06 23:38:30.000000000","message":"looking back at this tests I am still not entirely sure why admin_state_up False -\u003e True is not a transition we should make nova aware of. Is that because the only purpose these notifications serve at the moment is synchronizing vm boot?","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                                      status\u003dcurrent_port_status)"},{"line_number":70,"context_line":"                self._notify_port_status_changed_helper(current_port_status,"},{"line_number":71,"context_line":"                                                        previous_port_status,"},{"line_number":72,"context_line":"                                                        port)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_no_notify_no_device_owner(self):"},{"line_number":75,"context_line":"        port \u003d models_v2.Port(id\u003d\u0027port-uuid\u0027, device_id\u003d\u0027device-uuid\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FMGU%3D","line":72,"in_reply_to":"AAAAVn%2F%2FTVs%3D","updated":"2014-03-07 18:54:19.000000000","message":"If you create a port that is admin_state_up\u003dFalse and try to boot on it the port will never go to active state since it\u0027s down. Because of this we just notify nova that the port is active. That said we no longer actually need to notify nova of this because if a port in nova is admin_state_up\u003dFalse it doesn\u0027t want for the notification.","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e6327fadf60eee4d227c5ce8fa6cb8c6a826fb11","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                                                        previous_port_status,"},{"line_number":72,"context_line":"                                                        port)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_no_notify_no_device_owner(self):"},{"line_number":75,"context_line":"        port \u003d models_v2.Port(id\u003d\u0027port-uuid\u0027, device_id\u003d\u0027device-uuid\u0027,"},{"line_number":76,"context_line":"                              status\u003dconstants.PORT_STATUS_ACTIVE)"},{"line_number":77,"context_line":"        self._notify_port_status_changed_helper(constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FTWs%3D","line":74,"updated":"2014-03-06 23:38:30.000000000","message":"nit: test_port_without_device_owner_does_not_notify\n\n(just if you want, and similarly for other tests)","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fa02735b064cd1e1e44b301a2e5698408a7a538f","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                                                        previous_port_status,"},{"line_number":72,"context_line":"                                                        port)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_no_notify_no_device_owner(self):"},{"line_number":75,"context_line":"        port \u003d models_v2.Port(id\u003d\u0027port-uuid\u0027, device_id\u003d\u0027device-uuid\u0027,"},{"line_number":76,"context_line":"                              status\u003dconstants.PORT_STATUS_ACTIVE)"},{"line_number":77,"context_line":"        self._notify_port_status_changed_helper(constants.PORT_STATUS_ACTIVE,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAVn%2F%2FMGQ%3D","line":74,"in_reply_to":"AAAAVn%2F%2FTWs%3D","updated":"2014-03-07 18:54:19.000000000","message":"Done","commit_id":"846448a43ac9c8fc1f273d610872401b5c534aae"}],"neutron/tests/unit/notifiers/test_notifiers_nova.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5c13806affb7ac81085eb43f9b494eb635520bdc","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        self.addCleanup(self.nclient_p.stop)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_init_nova_client(self):"},{"line_number":41,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":42,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"},{"line_number":43,"context_line":"        self.nclient.assert_has_called("}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FA1o%3D","line":40,"updated":"2014-03-10 18:04:35.000000000","message":"This doesn\u0027t make sense as a standalone test, and it doesn\u0027t appear to be called from any other test.  What am I missing?","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        self.addCleanup(self.nclient_p.stop)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_init_nova_client(self):"},{"line_number":41,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":42,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"},{"line_number":43,"context_line":"        self.nclient.assert_has_called("}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAlE%3D","line":40,"in_reply_to":"AAAAVn%2F%2FA1o%3D","updated":"2014-03-10 18:33:58.000000000","message":"it tests that the nova client is called with those config options.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5c13806affb7ac81085eb43f9b494eb635520bdc","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            region\u003dcfg.CONF.nova_region_name,"},{"line_number":50,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_notify_port_status_all_values(self):"},{"line_number":53,"context_line":"        states \u003d [constants.PORT_STATUS_ACTIVE, constants.PORT_STATUS_DOWN,"},{"line_number":54,"context_line":"                  constants.PORT_STATUS_ERROR, constants.PORT_STATUS_BUILD,"},{"line_number":55,"context_line":"                  sql_attr.NO_VALUE]"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FA1U%3D","line":52,"updated":"2014-03-10 18:04:35.000000000","message":"This test needs a refactor.  port_status_changed() should be tested directly when evaluating what event is generated.   It isn\u0027t necessary to test the event delivery mechanism for each possible event.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            region\u003dcfg.CONF.nova_region_name,"},{"line_number":50,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_notify_port_status_all_values(self):"},{"line_number":53,"context_line":"        states \u003d [constants.PORT_STATUS_ACTIVE, constants.PORT_STATUS_DOWN,"},{"line_number":54,"context_line":"                  constants.PORT_STATUS_ERROR, constants.PORT_STATUS_BUILD,"},{"line_number":55,"context_line":"                  sql_attr.NO_VALUE]"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAjU%3D","line":52,"in_reply_to":"AAAAVn%2F%2FA1U%3D","updated":"2014-03-10 18:33:58.000000000","message":"This doesn\u0027t actually test the event delivery mechanism. see line 136","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6e7d880a821c58b6cb6d2f341ba2b030862fd532","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        self.addCleanup(self.nclient_p.stop)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_init_nova_client(self):"},{"line_number":41,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":42,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"},{"line_number":43,"context_line":"        self.nclient.assert_has_called("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2B%2FcU%3D","line":40,"updated":"2014-03-10 20:38:39.000000000","message":"If the intention is to test nova client init, it should be separated out of __init__ so it could be explicitly invoked in isolation.\n\nBut really, this test should simply be removed.  It duplicates exactly what appears in the code, and it\u0027s just as likely to duplicate an error as catch it.","commit_id":"9ed52cb4e679585611127cef6bd0750490543f79"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"9ecf3d67022f94d68dd7d8a6510eaa53e98689b1","unresolved":false,"context_lines":[{"line_number":37,"context_line":""},{"line_number":38,"context_line":"        self.addCleanup(self.nclient_p.stop)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_init_nova_client(self):"},{"line_number":41,"context_line":"        bypass_url \u003d \"%s/%s\" % (cfg.CONF.nova_url,"},{"line_number":42,"context_line":"                                cfg.CONF.nova_admin_tenant_id)"},{"line_number":43,"context_line":"        self.nclient.assert_has_called("}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2B%2FQ0%3D","line":40,"in_reply_to":"AAAAVn%2F%2B%2FcU%3D","updated":"2014-03-10 21:20:36.000000000","message":"will remove","commit_id":"9ed52cb4e679585611127cef6bd0750490543f79"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6e7d880a821c58b6cb6d2f341ba2b030862fd532","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            region\u003dcfg.CONF.nova_region_name,"},{"line_number":50,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_notify_port_status_all_values(self):"},{"line_number":53,"context_line":"        states \u003d [constants.PORT_STATUS_ACTIVE, constants.PORT_STATUS_DOWN,"},{"line_number":54,"context_line":"                  constants.PORT_STATUS_ERROR, constants.PORT_STATUS_BUILD,"},{"line_number":55,"context_line":"                  sql_attr.NO_VALUE]"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2B%2FdQ%3D","line":52,"updated":"2014-03-10 20:38:39.000000000","message":"If this  doesn\u0027t actually test the event delivery mechanism, then it shouldn\u0027t be necessary to mock it out.  Please refactor the target method accordingly.","commit_id":"9ed52cb4e679585611127cef6bd0750490543f79"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"9ecf3d67022f94d68dd7d8a6510eaa53e98689b1","unresolved":false,"context_lines":[{"line_number":49,"context_line":"            region\u003dcfg.CONF.nova_region_name,"},{"line_number":50,"context_line":"            extensions\u003d[server_external_events])"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def test_notify_port_status_all_values(self):"},{"line_number":53,"context_line":"        states \u003d [constants.PORT_STATUS_ACTIVE, constants.PORT_STATUS_DOWN,"},{"line_number":54,"context_line":"                  constants.PORT_STATUS_ERROR, constants.PORT_STATUS_BUILD,"},{"line_number":55,"context_line":"                  sql_attr.NO_VALUE]"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2B%2FD8%3D","line":52,"in_reply_to":"AAAAVn%2F%2B%2FdQ%3D","updated":"2014-03-10 21:20:36.000000000","message":"Ah, sorry I didn\u0027t realise I was doing that below. Done","commit_id":"9ed52cb4e679585611127cef6bd0750490543f79"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"1bec19e5259ede3a1958133cd0d3dded0dce2554","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.tests.unit import test_db_plugin"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TestNovaNotify(test_db_plugin.NeutronDbPluginV2TestCase):"},{"line_number":28,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":29,"context_line":"        self.nclient_p \u003d mock.patch.object(nclient, \"Client\")"},{"line_number":30,"context_line":"        self.nclient \u003d self.nclient_p.start()"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9rs%3D","line":27,"updated":"2014-03-11 01:33:42.000000000","message":"Why does this base class need to be used? The initialization overhead would seem unnecessary for testing the NovaNotify given that the plugin is entirely mocked out.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2a8c5f1292c9c8bf4bc546bf261a7c995365bab7","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.tests.unit import test_db_plugin"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TestNovaNotify(test_db_plugin.NeutronDbPluginV2TestCase):"},{"line_number":28,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":29,"context_line":"        self.nclient_p \u003d mock.patch.object(nclient, \"Client\")"},{"line_number":30,"context_line":"        self.nclient \u003d self.nclient_p.start()"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9gU%3D","line":27,"in_reply_to":"AAAAVn%2F%2B9rs%3D","updated":"2014-03-11 01:44:14.000000000","message":"Right it\u0027s no longer needed. Previously i was called some methods from that class but now i don\u0027t.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"1bec19e5259ede3a1958133cd0d3dded0dce2554","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TestNovaNotify(test_db_plugin.NeutronDbPluginV2TestCase):"},{"line_number":28,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":29,"context_line":"        self.nclient_p \u003d mock.patch.object(nclient, \"Client\")"},{"line_number":30,"context_line":"        self.nclient \u003d self.nclient_p.start()"},{"line_number":31,"context_line":"        super(TestNovaNotify, self).setUp(plugin,"},{"line_number":32,"context_line":"                                          mock_notify_port_status\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9o4%3D","line":29,"updated":"2014-03-11 01:33:42.000000000","message":"(Suggestion only) It\u0027s not necessary to save a reference to the patch since it\u0027s not used outside of this method.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2a8c5f1292c9c8bf4bc546bf261a7c995365bab7","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TestNovaNotify(test_db_plugin.NeutronDbPluginV2TestCase):"},{"line_number":28,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":29,"context_line":"        self.nclient_p \u003d mock.patch.object(nclient, \"Client\")"},{"line_number":30,"context_line":"        self.nclient \u003d self.nclient_p.start()"},{"line_number":31,"context_line":"        super(TestNovaNotify, self).setUp(plugin,"},{"line_number":32,"context_line":"                                          mock_notify_port_status\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9fg%3D","line":29,"in_reply_to":"AAAAVn%2F%2B9o4%3D","updated":"2014-03-11 01:44:14.000000000","message":"Done","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"1bec19e5259ede3a1958133cd0d3dded0dce2554","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"        self.nova_notifier \u003d nova.Notifier()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        self.addCleanup(self.nclient_p.stop)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def test_notify_port_status_all_values(self):"},{"line_number":39,"context_line":"        states \u003d [constants.PORT_STATUS_ACTIVE, constants.PORT_STATUS_DOWN,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9rg%3D","line":36,"updated":"2014-03-11 01:33:42.000000000","message":"Best practice is to add the cleanup immediately after the start so that any errors in between do not cause problems, i.e. after line 30.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2a8c5f1292c9c8bf4bc546bf261a7c995365bab7","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"        self.nova_notifier \u003d nova.Notifier()"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"        self.addCleanup(self.nclient_p.stop)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    def test_notify_port_status_all_values(self):"},{"line_number":39,"context_line":"        states \u003d [constants.PORT_STATUS_ACTIVE, constants.PORT_STATUS_DOWN,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9fw%3D","line":36,"in_reply_to":"AAAAVn%2F%2B9rg%3D","updated":"2014-03-11 01:44:14.000000000","message":"Done","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c13dba106bac4d8755d37ab1f7c95ab32b708d0e","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TestNovaNotify(base.BaseTestCase):"},{"line_number":28,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":29,"context_line":"        nclient_p \u003d mock.patch.object(nclient, \"Client\")"},{"line_number":30,"context_line":"        self.nclient \u003d nclient_p.start()"},{"line_number":31,"context_line":"        self.addCleanup(nclient_p.stop)"},{"line_number":32,"context_line":"        super(TestNovaNotify, self).setUp()"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2B9L4%3D","line":29,"updated":"2014-03-11 02:41:28.000000000","message":"It doesn\u0027t appear that this mock is needed since there are no tests for send_event.  Is that intentional?","commit_id":"469948950baceb816f0672b666682b530e42bde6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"9aeffa99ed9d5081a790f7b7c76f9c2a02fcc735","unresolved":false,"context_lines":[{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TestNovaNotify(base.BaseTestCase):"},{"line_number":28,"context_line":"    def setUp(self, plugin\u003dNone):"},{"line_number":29,"context_line":"        nclient_p \u003d mock.patch.object(nclient, \"Client\")"},{"line_number":30,"context_line":"        self.nclient \u003d nclient_p.start()"},{"line_number":31,"context_line":"        self.addCleanup(nclient_p.stop)"},{"line_number":32,"context_line":"        super(TestNovaNotify, self).setUp()"}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2B9JY%3D","line":29,"in_reply_to":"AAAAVn%2F%2B9L4%3D","updated":"2014-03-11 02:47:01.000000000","message":"I\u0027ll remove and move to the patch above.","commit_id":"469948950baceb816f0672b666682b530e42bde6"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"c13dba106bac4d8755d37ab1f7c95ab32b708d0e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                self._record_port_status_changed_helper(current_port_status,"},{"line_number":47,"context_line":"                                                        previous_port_status,"},{"line_number":48,"context_line":"                                                        port)"},{"line_number":49,"context_line":"                self._record_port_status_changed_helper(current_port_status,"},{"line_number":50,"context_line":"                                                        previous_port_status,"},{"line_number":51,"context_line":"                                                        port)"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2B9MI%3D","line":49,"updated":"2014-03-11 02:41:28.000000000","message":"Hmm, is it intentional that this statement duplicates the one above?","commit_id":"469948950baceb816f0672b666682b530e42bde6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"9aeffa99ed9d5081a790f7b7c76f9c2a02fcc735","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                self._record_port_status_changed_helper(current_port_status,"},{"line_number":47,"context_line":"                                                        previous_port_status,"},{"line_number":48,"context_line":"                                                        port)"},{"line_number":49,"context_line":"                self._record_port_status_changed_helper(current_port_status,"},{"line_number":50,"context_line":"                                                        previous_port_status,"},{"line_number":51,"context_line":"                                                        port)"},{"line_number":52,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"AAAAVn%2F%2B9Jw%3D","line":49,"in_reply_to":"AAAAVn%2F%2B9MI%3D","updated":"2014-03-11 02:47:01.000000000","message":"Done","commit_id":"469948950baceb816f0672b666682b530e42bde6"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"46c2b8eecb358f94ed3a0d8389692d8c2c26bde4","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def _record_port_status_changed_helper(self, current_port_status,"},{"line_number":76,"context_line":"                                           previous_port_status, port):"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        if not port.device_id:"},{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        if not port.id:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAVn%2F%2B4yw%3D","line":78,"updated":"2014-03-11 14:46:10.000000000","message":"if not (port.device_id or port.id or port.device_owner or port.device_owner.startswith(\u0027compute:\u0027)):\n    return","commit_id":"268b67aa0f212823052b0526fcc3b2e4ee6d4dfc"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"8c77c760bf7263d6ab22818331a4ef719c159711","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def _record_port_status_changed_helper(self, current_port_status,"},{"line_number":76,"context_line":"                                           previous_port_status, port):"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        if not port.device_id:"},{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        if not port.id:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAVn%2F%2B4J8%3D","line":78,"in_reply_to":"AAAAVn%2F%2B4O8%3D","updated":"2014-03-11 15:38:54.000000000","message":"These should be ands but sure.","commit_id":"268b67aa0f212823052b0526fcc3b2e4ee6d4dfc"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6b691e82aa581f08e03d1834d75fc1eda54249b4","unresolved":false,"context_lines":[{"line_number":75,"context_line":"    def _record_port_status_changed_helper(self, current_port_status,"},{"line_number":76,"context_line":"                                           previous_port_status, port):"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        if not port.device_id:"},{"line_number":79,"context_line":"            return"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        if not port.id:"}],"source_content_type":"text/x-python","patch_set":21,"id":"AAAAVn%2F%2B4O8%3D","line":78,"in_reply_to":"AAAAVn%2F%2B4yw%3D","updated":"2014-03-11 15:29:21.000000000","message":"Done","commit_id":"268b67aa0f212823052b0526fcc3b2e4ee6d4dfc"}],"neutron/tests/unit/test_db_plugin.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":78,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":81,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":82,"context_line":"        if self.mock_notify_port_status:"},{"line_number":83,"context_line":"            self.nova_callback_p \u003d mock.patch(\u0027neutron.callbacks.nova.\u0027"},{"line_number":84,"context_line":"                                              \u0027nclient.Client\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2FeX8%3D","line":81,"updated":"2014-02-26 12:46:10.000000000","message":"I don\u0027t think it should be necessary to store this value for use on tearDown.  Use the conditional to start the patch and addCleanup in the same block.\n\nif mocking:\n patch \u003d mock.patch(\u0027foo\u0027)\n patch.start()\n# Unless for some crazy reason the order of patch\n# halt is important, use stopall.\nself.addCleanup(mock.patch.stopall)\n\nSee: http://mock.readthedocs.org/en/latest/patch.html#mock.patch.stopall","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"2917374d16a9a7b1aa30b7f33353c359faa8130f","unresolved":false,"context_lines":[{"line_number":78,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":81,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":82,"context_line":"        if self.mock_notify_port_status:"},{"line_number":83,"context_line":"            self.nova_callback_p \u003d mock.patch(\u0027neutron.callbacks.nova.\u0027"},{"line_number":84,"context_line":"                                              \u0027nclient.Client\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVX%2F%2F9p8%3D","line":81,"in_reply_to":"AAAAU3%2F%2Fawo%3D","updated":"2014-02-27 05:18:52.000000000","message":"tearDown and addCleanup can coexists.  We just haven\u0027t gotten around to migrating everything to the addCleanup approach.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":78,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":81,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":82,"context_line":"        if self.mock_notify_port_status:"},{"line_number":83,"context_line":"            self.nova_callback_p \u003d mock.patch(\u0027neutron.callbacks.nova.\u0027"},{"line_number":84,"context_line":"                                              \u0027nclient.Client\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAU3%2F%2Fawo%3D","line":81,"in_reply_to":"AAAAU3%2F%2FeX8%3D","updated":"2014-02-26 19:08:18.000000000","message":"I\u0027ll give that a shot. The reason why I didn\u0027t do that is this file doesn\u0027t use an addCleanup and defines a     def tearDown(self): so i wasn\u0027t sure if that would work.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"86487c4aa9232cb3a07bd913d4bd5d14852c369a","unresolved":false,"context_lines":[{"line_number":78,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":81,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":82,"context_line":"        if self.mock_notify_port_status:"},{"line_number":83,"context_line":"            self.nova_callback_p \u003d mock.patch(\u0027neutron.callbacks.nova.\u0027"},{"line_number":84,"context_line":"                                              \u0027nclient.Client\u0027)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAVX%2F%2F9fA%3D","line":81,"in_reply_to":"AAAAVX%2F%2F9p8%3D","updated":"2014-02-27 05:50:18.000000000","message":"Hrm i actually added a self.addCleanup(self.nova_callback_p.stop) though it didn\u0027t work. I\u0027ll give the stopall a shot as well later.","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"25876dee276627a1ab4236694bfa2831bab6c560","unresolved":false,"context_lines":[{"line_number":76,"context_line":"    resource_prefix_map \u003d {}"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def setUp(self, plugin\u003dNone, service_plugins\u003dNone,"},{"line_number":79,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":82,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FIFE%3D","line":79,"updated":"2014-03-08 19:31:05.000000000","message":"I am not sure which is better passing it as a parameter or class attribute as follows:\n\n  class NeutronDbPluginV2TestCase(...):\n    mock_notify_port_status \u003d True","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"5c13806affb7ac81085eb43f9b494eb635520bdc","unresolved":false,"context_lines":[{"line_number":79,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":82,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"},{"line_number":85,"context_line":"                                              \u0027nclient.Client\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FA6o%3D","line":82,"updated":"2014-03-10 18:04:35.000000000","message":"You haven\u0027t addressed my review comment on this block from patch #3, in line with Akihiro\u0027s comment on this one.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":79,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":82,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"},{"line_number":85,"context_line":"                                              \u0027nclient.Client\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAek%3D","line":82,"in_reply_to":"AAAAVn%2F%2FA6o%3D","updated":"2014-03-10 18:33:58.000000000","message":"I\u0027ve tried doing this but it doesn\u0027t work. I believe since this method also defines a tearDown.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"25876dee276627a1ab4236694bfa2831bab6c560","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"},{"line_number":85,"context_line":"                                              \u0027nclient.Client\u0027)"},{"line_number":86,"context_line":"            self.nova_notifier \u003d self.nova_notifier_p.start()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        super(NeutronDbPluginV2TestCase, self).setUp()"},{"line_number":89,"context_line":"        # Make sure at each test according extensions for the plugin is loaded"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FIFI%3D","line":86,"updated":"2014-03-08 19:31:05.000000000","message":"Nit: Do we need to do this before super().setUp? If there is no reason, I think it is better to move it after super.setUp. If there are logic before and after super(), I tend to this why.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"},{"line_number":85,"context_line":"                                              \u0027nclient.Client\u0027)"},{"line_number":86,"context_line":"            self.nova_notifier \u003d self.nova_notifier_p.start()"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        super(NeutronDbPluginV2TestCase, self).setUp()"},{"line_number":89,"context_line":"        # Make sure at each test according extensions for the plugin is loaded"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAho%3D","line":86,"in_reply_to":"AAAAVn%2F%2FIFI%3D","updated":"2014-03-10 18:33:58.000000000","message":"Done","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"25876dee276627a1ab4236694bfa2831bab6c560","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        # Restore the original attribute map"},{"line_number":172,"context_line":"        attributes.RESOURCE_ATTRIBUTE_MAP \u003d self._attribute_map_bk"},{"line_number":173,"context_line":"        if self.mock_notify_port_status:"},{"line_number":174,"context_line":"            self.nova_notifier_p.stop()"},{"line_number":175,"context_line":"        super(NeutronDbPluginV2TestCase, self).tearDown()"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def _req(self, method, resource, data\u003dNone, fmt\u003dNone, id\u003dNone, params\u003dNone,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FIFU%3D","line":174,"updated":"2014-03-08 19:31:05.000000000","message":"It is better to use addCleanup in setUp.","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"3175f5402a598149f544d034ccf3e9518723019e","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        # Restore the original attribute map"},{"line_number":172,"context_line":"        attributes.RESOURCE_ATTRIBUTE_MAP \u003d self._attribute_map_bk"},{"line_number":173,"context_line":"        if self.mock_notify_port_status:"},{"line_number":174,"context_line":"            self.nova_notifier_p.stop()"},{"line_number":175,"context_line":"        super(NeutronDbPluginV2TestCase, self).tearDown()"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def _req(self, method, resource, data\u003dNone, fmt\u003dNone, id\u003dNone, params\u003dNone,"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAVn%2F%2FAeQ%3D","line":174,"in_reply_to":"AAAAVn%2F%2FIFU%3D","updated":"2014-03-10 18:33:58.000000000","message":"I agree though it it doesn\u0027t seem to work out of the box. I think because this method defines a teardown","commit_id":"34070688f2d8ec93518a469aa1f723e7e2ba28f5"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"6e7d880a821c58b6cb6d2f341ba2b030862fd532","unresolved":false,"context_lines":[{"line_number":79,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":82,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"},{"line_number":85,"context_line":"                                              \u0027nclient.Client\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2B%2FbM%3D","line":82,"updated":"2014-03-10 20:38:39.000000000","message":"I\u0027ll investigate why exactly the mock doesn\u0027t work since that is counter to my experience.","commit_id":"9ed52cb4e679585611127cef6bd0750490543f79"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"4f6d8fefccc88ca21d6fff20152e70ca521b173e","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def setUp(self, plugin\u003dNone, service_plugins\u003dNone,"},{"line_number":79,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":82,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B910%3D","line":81,"updated":"2014-03-11 00:42:33.000000000","message":"I don\u0027t think the plugin tests should be running with notifications enabled.  It would only add overhead.  Consider changing the name of \u0027mock_notify_port_status\u0027 to \u0027enable_nova_events\u0027, defaulted to False, and then override notify_nova_on_port_status_changes accordingly.\n\nThat will put the onus on the notification test class to do the mocking (i.e. TestNovaNotify.setUp).  I think the problem with the mocking that appears here is that it is targeting an instance variable (nclient).  Mocking the nova class directly appears to work correctly, e.g.\n\n  nova_client_p \u003d mock.patch(\u0027novaclient.v1_1.client.Client\u0027)\n  nova_client_p.start()\n  self.addCleanup(nova_client_p.stop)","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"1bec19e5259ede3a1958133cd0d3dded0dce2554","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def setUp(self, plugin\u003dNone, service_plugins\u003dNone,"},{"line_number":79,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":82,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9no%3D","line":81,"in_reply_to":"AAAAVn%2F%2B910%3D","updated":"2014-03-11 01:33:42.000000000","message":"Huh, and now I see that the notification method is already mocking stuff out, please disregard the latter part of the previous comment.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"2a8c5f1292c9c8bf4bc546bf261a7c995365bab7","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    def setUp(self, plugin\u003dNone, service_plugins\u003dNone,"},{"line_number":79,"context_line":"              ext_mgr\u003dNone, mock_notify_port_status\u003dTrue):"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        #NOTE(arosen): Yuk! but I don\u0027t know a better way to hook this in.."},{"line_number":82,"context_line":"        self.mock_notify_port_status \u003d mock_notify_port_status"},{"line_number":83,"context_line":"        if self.mock_notify_port_status:"},{"line_number":84,"context_line":"            self.nova_notifier_p \u003d mock.patch(\u0027neutron.notifiers.nova.\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAAVn%2F%2B9kA%3D","line":81,"in_reply_to":"AAAAVn%2F%2B910%3D","updated":"2014-03-11 01:44:14.000000000","message":"Right, currently they are not because this mocks them out.","commit_id":"1338dac47c2af4647d3a746babbd24974c97f5d4"}],"requirements.txt":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"ffd63f43c321ca7e35d2f500c098e28dac5f8150","unresolved":false,"context_lines":[{"line_number":27,"context_line":"oslo.rootwrap"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"python-novaclient\u003e\u003d2.15.0 # TODO(arosen): BUMP when external_event_code "},{"line_number":30,"context_line":"\t\t\t\t\t\t\t\t  #               is merged."}],"source_content_type":"text/plain","patch_set":3,"id":"AAAAU3%2F%2FeWw%3D","line":30,"updated":"2014-02-26 12:46:10.000000000","message":"Yuck, tabs!","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"10a4291b03e3a6609b4e3f21b7dc94c5105f0961","unresolved":false,"context_lines":[{"line_number":27,"context_line":"oslo.rootwrap"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"python-novaclient\u003e\u003d2.15.0 # TODO(arosen): BUMP when external_event_code "},{"line_number":30,"context_line":"\t\t\t\t\t\t\t\t  #               is merged."}],"source_content_type":"text/plain","patch_set":3,"id":"AAAAU3%2F%2Fapo%3D","line":30,"in_reply_to":"AAAAU3%2F%2FeWw%3D","updated":"2014-02-26 19:08:18.000000000","message":"yea my .vimrc doesn\u0027t work for .txt\u0027s :)","commit_id":"cd32f45b4e4bb07f602380beabeffa3bf41a1de0"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"689a601400e1755bd9afd4e408badb0c4aacc0be","unresolved":false,"context_lines":[{"line_number":27,"context_line":"oslo.rootwrap"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"python-novaclient\u003e\u003d2.15.0 # TODO(arosen): BUMP when external_event_code "},{"line_number":30,"context_line":"\t\t\t\t\t\t\t\t  #               is merged."}],"source_content_type":"text/plain","patch_set":4,"id":"AAAAVX%2F%2F9pM%3D","line":30,"updated":"2014-02-27 05:30:14.000000000","message":"tabs","commit_id":"8efdb25756b4107f5ba37b089adccfde608bdaf6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"d9c311666e83bcf9f83b99b3ada274861050fecc","unresolved":false,"context_lines":[{"line_number":27,"context_line":"oslo.rootwrap"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"python-novaclient\u003e\u003d2.15.0 # TODO(arosen): BUMP when external_event_code "},{"line_number":30,"context_line":"\t\t\t\t\t\t\t\t  #               is merged."}],"source_content_type":"text/plain","patch_set":4,"id":"AAAAVX%2F%2F9eg%3D","line":30,"in_reply_to":"AAAAVX%2F%2F9pM%3D","updated":"2014-02-27 05:58:12.000000000","message":"right this line will have to change anyways before this can merge.","commit_id":"8efdb25756b4107f5ba37b089adccfde608bdaf6"}]}
