)]}'
{"quantum/plugins/nicira/nicira_nvp_plugin/QuantumPlugin.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":509,"context_line":"                      port_data[\u0027network_id\u0027])"},{"line_number":510,"context_line":"            return"},{"line_number":511,"context_line":"        port \u003d self._nvp_get_port_id(context, self.default_cluster,"},{"line_number":512,"context_line":"                                     port_data)"},{"line_number":513,"context_line":"        if port is None:"},{"line_number":514,"context_line":"            raise q_exc.PortNotFound(port_id\u003dport_data[\u0027id\u0027])"},{"line_number":515,"context_line":"        # TODO(bgh): if this is a bridged network and the lswitch we just got"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2FySc%3D","line":512,"updated":"2013-03-12 16:41:27.000000000","message":"Does this introduce a chance for problems if NVP data + quantum data is inconsistent, since if the port is not found in NVP, we will raise a PortNotFound in the following line?\n\nI think this would only be possible with respect to ports that were part of a Folsom deployment, but still that seems like something we\u0027d like to avoid.","commit_id":"0bcbd4d511234e0d12ca8398b3dc06a732996345"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"90f4427bf005a7caafa109e7117dc8336a987a48","unresolved":false,"context_lines":[{"line_number":509,"context_line":"                      port_data[\u0027network_id\u0027])"},{"line_number":510,"context_line":"            return"},{"line_number":511,"context_line":"        port \u003d self._nvp_get_port_id(context, self.default_cluster,"},{"line_number":512,"context_line":"                                     port_data)"},{"line_number":513,"context_line":"        if port is None:"},{"line_number":514,"context_line":"            raise q_exc.PortNotFound(port_id\u003dport_data[\u0027id\u0027])"},{"line_number":515,"context_line":"        # TODO(bgh): if this is a bridged network and the lswitch we just got"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2Fx4E%3D","line":512,"in_reply_to":"AAAAN3%2F%2FyQU%3D","updated":"2013-03-12 20:03:08.000000000","message":"This all looks great and works for me.","commit_id":"0bcbd4d511234e0d12ca8398b3dc06a732996345"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":509,"context_line":"                      port_data[\u0027network_id\u0027])"},{"line_number":510,"context_line":"            return"},{"line_number":511,"context_line":"        port \u003d self._nvp_get_port_id(context, self.default_cluster,"},{"line_number":512,"context_line":"                                     port_data)"},{"line_number":513,"context_line":"        if port is None:"},{"line_number":514,"context_line":"            raise q_exc.PortNotFound(port_id\u003dport_data[\u0027id\u0027])"},{"line_number":515,"context_line":"        # TODO(bgh): if this is a bridged network and the lswitch we just got"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2FyQU%3D","line":512,"in_reply_to":"AAAAN3%2F%2FySc%3D","updated":"2013-03-12 16:52:20.000000000","message":"This is intended (and hopefully correct) behaviour.\n\n_nvp_get_port_id first checks in the local db (as the previous code did), and then if that is not found it goes straight to NVP and queries ports there to find the one with the corresponding quantum id.\n\nFolsom code did set the q_port_id tag, so the PortNotFound error will be raised only if the port is deleted  directly via the NVP API, or if the q_port_id tag is removed or altered.","commit_id":"0bcbd4d511234e0d12ca8398b3dc06a732996345"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"90f4427bf005a7caafa109e7117dc8336a987a48","unresolved":false,"context_lines":[{"line_number":1509,"context_line":"            if self._network_is_external(context,"},{"line_number":1510,"context_line":"                                         quantum_db_port[\u0027network_id\u0027]):"},{"line_number":1511,"context_line":"                return quantum_db_port"},{"line_number":1512,"context_line":"            nvp_id \u003d self._nvp_get_port_id(context, self.default_cluster,"},{"line_number":1513,"context_line":"                                           quantum_db_port)"},{"line_number":1514,"context_line":"            #TODO: pass the appropriate cluster here"},{"line_number":1515,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2Fx4M%3D","line":1512,"updated":"2013-03-12 20:03:08.000000000","message":"I tested this with having a port in the quantum_db and not in nvp and the following exception is raised here: http://codepad.org/WpOUQTlU because nvp_id will \u003d\u003d None and Then on line 1516 in nvplib.get_logical_port_status() it does:  \n\n     query \u003d (\"/ws.v1/lswitch/\" + switch + \"/lport/\"\n              + port + \"?relations\u003dLogicalPortStatus\")\nThe following change makes this work for me: \n\n\n--- a/quantum/plugins/nicira/nicira_nvp_plugin/nvplib.py\n+++ b/quantum/plugins/nicira/nicira_nvp_plugin/nvplib.py\n@@ -641,6 +641,8 @@ def delete_port(cluster, switch, port):\n \n \n def get_logical_port_status(cluster, switch, port):\n+    if not port:\n+        raise exception.PortNotFound(port_id\u003dport, net_id\u003dswitch)\n     query \u003d (\"/ws.v1/lswitch/\" + switch + \"/lport/\"\n              + port + \"?relations\u003dLogicalPortStatus\")\n     try:","commit_id":"0bcbd4d511234e0d12ca8398b3dc06a732996345"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1509,"context_line":"            if self._network_is_external(context,"},{"line_number":1510,"context_line":"                                         quantum_db_port[\u0027network_id\u0027]):"},{"line_number":1511,"context_line":"                return quantum_db_port"},{"line_number":1512,"context_line":"            nvp_id \u003d self._nvp_get_port_id(context, self.default_cluster,"},{"line_number":1513,"context_line":"                                           quantum_db_port)"},{"line_number":1514,"context_line":"            #TODO: pass the appropriate cluster here"},{"line_number":1515,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAN3%2F%2Fxbo%3D","line":1512,"in_reply_to":"AAAAN3%2F%2Fx4M%3D","updated":"2013-03-12 23:57:01.000000000","message":"I don\u0027t think this was working before that, indeed that\u0027s the failure I was seeing.\n\nIf you have a port in quantum db and not in nvp - the routine called at line 1512 should actually return a port id !\u003dNone.\n\nIf you get port_id \u003d\u003d None this means you don\u0027t have it neither in quantum nor in NVP.\n\nanyway, the last patch just skips the step on nvp is nvp_port_id\u003d\u003dNone","commit_id":"0bcbd4d511234e0d12ca8398b3dc06a732996345"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"90f4427bf005a7caafa109e7117dc8336a987a48","unresolved":false,"context_lines":[{"line_number":1509,"context_line":"            if self._network_is_external(context,"},{"line_number":1510,"context_line":"                                         quantum_db_port[\u0027network_id\u0027]):"},{"line_number":1511,"context_line":"                return quantum_db_port"},{"line_number":1512,"context_line":"            nvp_id \u003d self._nvp_get_port_id(context, self.default_cluster,"},{"line_number":1513,"context_line":"                                           quantum_db_port)"},{"line_number":1514,"context_line":"            #TODO: pass the appropriate cluster here"},{"line_number":1515,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2FxSU%3D","line":1512,"updated":"2013-03-13 01:55:07.000000000","message":"it looks like nvp_id can be None here in which case when we pass it to like 1516 we will fail. This can happen in the case when we have a quantum port.id but that id isn\u0027t in nvp.","commit_id":"6fa3c411bd2662915c111f5a7eb4ea45897d56bf"}],"quantum/plugins/nicira/nicira_nvp_plugin/nvplib.py":[{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"change_message_id":"f058954c462ec04a3d479711ad5c62e4d0493f9d","unresolved":false,"context_lines":[{"line_number":678,"context_line":""},{"line_number":679,"context_line":""},{"line_number":680,"context_line":"def get_port_by_quantum_tag(cluster, lswitch_uuid, quantum_port_id):"},{"line_number":681,"context_line":"    \"\"\"Return the NVP UUID of the logical port with tag q_port_id"},{"line_number":682,"context_line":"    equal to quantum_port_id or None if the port is not Found."},{"line_number":683,"context_line":"    \"\"\""},{"line_number":684,"context_line":"    uri \u003d _build_uri_path(LSWITCHPORT_RESOURCE,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAN3%2F%2F0KM%3D","line":681,"updated":"2013-03-11 16:59:38.000000000","message":"I am just wondering if unit tests are required for this new function. Thanks!","commit_id":"05c6ed43a2451a7126e4a6cf5bafc28ba688d387"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":678,"context_line":""},{"line_number":679,"context_line":""},{"line_number":680,"context_line":"def get_port_by_quantum_tag(cluster, lswitch_uuid, quantum_port_id):"},{"line_number":681,"context_line":"    \"\"\"Return the NVP UUID of the logical port with tag q_port_id"},{"line_number":682,"context_line":"    equal to quantum_port_id or None if the port is not Found."},{"line_number":683,"context_line":"    \"\"\""},{"line_number":684,"context_line":"    uri \u003d _build_uri_path(LSWITCHPORT_RESOURCE,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAN3%2F%2Fz%2F4%3D","line":681,"in_reply_to":"AAAAN3%2F%2F0KM%3D","updated":"2013-03-11 18:07:35.000000000","message":"This is probably not covered by unit tests so far.\nThe nvp plugin unit tests usually cover this library \u0027indirectly\u0027 (i know it\u0027s not good) but probably the function it\u0027s missed because it\u0027s called only if the db was initialized with folsom code.\n\nLet me see how hard it will be to add a test.","commit_id":"05c6ed43a2451a7126e4a6cf5bafc28ba688d387"}]}
