)]}'
{"neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver.py":[{"author":{"_account_id":10980,"name":"Doug Wiegley","email":"dougwig@parkside.io","username":"dougw"},"change_message_id":"f8e2594c3bad23b2f6887fd3dd712abe81984c29","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import config as conf"},{"line_number":25,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import constants as const"},{"line_number":26,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import exceptions as cexc"},{"line_number":27,"context_line":"import re"},{"line_number":28,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import nexus_snippets as snipp"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_9e811bc6","line":27,"updated":"2014-11-27 03:56:17.000000000","message":"system imports go in a block of their own at the top","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"ab2872539096eec86e16cb3f198d638ac733cb06","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import config as conf"},{"line_number":25,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import constants as const"},{"line_number":26,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import exceptions as cexc"},{"line_number":27,"context_line":"import re"},{"line_number":28,"context_line":"from neutron.plugins.ml2.drivers.cisco.nexus import nexus_snippets as snipp"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"LOG \u003d logging.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_36278cb7","line":27,"in_reply_to":"5a890539_9e811bc6","updated":"2014-12-05 14:42:15.000000000","message":"Done","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":9820,"name":"Liping Mao","email":"limao@cisco.com","username":"LipingMao"},"change_message_id":"75e4fb22fe4c77992e5277edc83ad8fcd0461d9b","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    def get_interface_switch_trunk_allowed(self, nexus_host,"},{"line_number":138,"context_line":"                                           intf_type, interface):"},{"line_number":139,"context_line":"        \"\"\"Given the nexus host and specific interface data, get the "},{"line_number":140,"context_line":"           interface data from host and determine if "},{"line_number":141,"context_line":"           \u0027switchport trunk allowed vlan\u0027 is configured."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"           :param nexus_host: IP address of Nexus switch"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_9b0f6e88","line":140,"updated":"2014-11-27 01:35:01.000000000","message":"strip black space.","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"ab2872539096eec86e16cb3f198d638ac733cb06","unresolved":false,"context_lines":[{"line_number":137,"context_line":"    def get_interface_switch_trunk_allowed(self, nexus_host,"},{"line_number":138,"context_line":"                                           intf_type, interface):"},{"line_number":139,"context_line":"        \"\"\"Given the nexus host and specific interface data, get the "},{"line_number":140,"context_line":"           interface data from host and determine if "},{"line_number":141,"context_line":"           \u0027switchport trunk allowed vlan\u0027 is configured."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"           :param nexus_host: IP address of Nexus switch"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_562a587e","line":140,"in_reply_to":"5a890539_9b0f6e88","updated":"2014-12-05 14:42:15.000000000","message":"Done","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":10980,"name":"Doug Wiegley","email":"dougwig@parkside.io","username":"dougw"},"change_message_id":"f8e2594c3bad23b2f6887fd3dd712abe81984c29","unresolved":false,"context_lines":[{"line_number":165,"context_line":"            except Exception:"},{"line_number":166,"context_line":"                result \u003d None"},{"line_number":167,"context_line":"            return result"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def create_vlan(self, nexus_host, vlanid, vlanname):"},{"line_number":170,"context_line":"        \"\"\"Create a VLAN on Nexus Switch given the VLAN ID and Name.\"\"\""},{"line_number":171,"context_line":"        confstr \u003d self.create_xml_snippet("}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_be86d7d9","line":168,"updated":"2014-11-27 03:56:17.000000000","message":"Shouldn\u0027t this function return a boolean?\nThe nesting levels also seem odd; return in the except, and then the else doesn\u0027t need to exist.","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"ab2872539096eec86e16cb3f198d638ac733cb06","unresolved":false,"context_lines":[{"line_number":165,"context_line":"            except Exception:"},{"line_number":166,"context_line":"                result \u003d None"},{"line_number":167,"context_line":"            return result"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def create_vlan(self, nexus_host, vlanid, vlanname):"},{"line_number":170,"context_line":"        \"\"\"Create a VLAN on Nexus Switch given the VLAN ID and Name.\"\"\""},{"line_number":171,"context_line":"        confstr \u003d self.create_xml_snippet("}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_f630a4ea","line":168,"in_reply_to":"5a890539_be86d7d9","updated":"2014-12-05 14:42:15.000000000","message":"Done","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":9820,"name":"Liping Mao","email":"limao@cisco.com","username":"LipingMao"},"change_message_id":"75e4fb22fe4c77992e5277edc83ad8fcd0461d9b","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        ret_exc \u003d self._edit_config(nexus_host, target\u003d\u0027running\u0027,"},{"line_number":242,"context_line":"                          config\u003dconfstr)"},{"line_number":243,"context_line":"        if ret_exc:"},{"line_number":244,"context_line":"            LOG.debug(\"Failed to add switchport trunk vlan %s on int %s %s.\","},{"line_number":245,"context_line":"                vlanid, intf_type, interface)"},{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Successfully added switchport trunk vlan %s on int \""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_1b445eb6","line":244,"updated":"2014-11-27 01:35:01.000000000","message":"LOG.error is better?","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"ab2872539096eec86e16cb3f198d638ac733cb06","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        ret_exc \u003d self._edit_config(nexus_host, target\u003d\u0027running\u0027,"},{"line_number":242,"context_line":"                          config\u003dconfstr)"},{"line_number":243,"context_line":"        if ret_exc:"},{"line_number":244,"context_line":"            LOG.debug(\"Failed to add switchport trunk vlan %s on int %s %s.\","},{"line_number":245,"context_line":"                vlanid, intf_type, interface)"},{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Successfully added switchport trunk vlan %s on int \""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_5651780c","line":244,"in_reply_to":"5a890539_1b445eb6","updated":"2014-12-05 14:42:15.000000000","message":"Done","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"50133e515f3c7e65a991e482584fb11bcc0671cd","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        LOG.debug(\"GET call returned interface %s %s config\","},{"line_number":163,"context_line":"            intf_type, interface)"},{"line_number":164,"context_line":"        try:"},{"line_number":165,"context_line":"            result \u003d re.search(\"switchport trunk allowed vlan\", response)"},{"line_number":166,"context_line":"            if (result is None):"},{"line_number":167,"context_line":"                result \u003d False"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_2d4d7b3b","line":164,"updated":"2014-12-04 19:12:12.000000000","message":"can you put this try inside of try above?","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"f2d94bf5c6685e8f4fee9b6b451bc4e68d36dcbc","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        LOG.debug(\"GET call returned interface %s %s config\","},{"line_number":163,"context_line":"            intf_type, interface)"},{"line_number":164,"context_line":"        try:"},{"line_number":165,"context_line":"            result \u003d re.search(\"switchport trunk allowed vlan\", response)"},{"line_number":166,"context_line":"            if (result is None):"},{"line_number":167,"context_line":"                result \u003d False"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_b0446473","line":164,"in_reply_to":"5a890539_2d4d7b3b","updated":"2014-12-05 14:41:55.000000000","message":"Done","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"50133e515f3c7e65a991e482584fb11bcc0671cd","unresolved":false,"context_lines":[{"line_number":224,"context_line":"           \"\"\""},{"line_number":225,"context_line":"        response \u003d self.get_interface_switch_trunk_allowed(nexus_host,"},{"line_number":226,"context_line":"            intf_type, interface)"},{"line_number":227,"context_line":"        if (response is False):"},{"line_number":228,"context_line":"            #"},{"line_number":229,"context_line":"            # If \u0027switchport trunk allowed vlan\u0027 not configured on the"},{"line_number":230,"context_line":"            # switch, configure the VLAN onto the interface without the"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_0de43f3a","line":227,"updated":"2014-12-04 19:12:12.000000000","message":"consider\nsnippet \u003d snipp.CMD_INT_VLAN_SNIPPET if (response is False) else snipp.CMD_INT_VLAN_ADD_SNIPPET","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"f2d94bf5c6685e8f4fee9b6b451bc4e68d36dcbc","unresolved":false,"context_lines":[{"line_number":224,"context_line":"           \"\"\""},{"line_number":225,"context_line":"        response \u003d self.get_interface_switch_trunk_allowed(nexus_host,"},{"line_number":226,"context_line":"            intf_type, interface)"},{"line_number":227,"context_line":"        if (response is False):"},{"line_number":228,"context_line":"            #"},{"line_number":229,"context_line":"            # If \u0027switchport trunk allowed vlan\u0027 not configured on the"},{"line_number":230,"context_line":"            # switch, configure the VLAN onto the interface without the"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_d05e5044","line":227,"in_reply_to":"5a890539_0de43f3a","updated":"2014-12-05 14:41:55.000000000","message":"Done","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"50133e515f3c7e65a991e482584fb11bcc0671cd","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        )"},{"line_number":246,"context_line":"        ret_exc \u003d self._edit_config(nexus_host, target\u003d\u0027running\u0027,"},{"line_number":247,"context_line":"                          config\u003dconfstr)"},{"line_number":248,"context_line":"        if ret_exc:"},{"line_number":249,"context_line":"            LOG.err(\"Failed to add switchport trunk vlan %s on int %s %s.\","},{"line_number":250,"context_line":"                vlanid, intf_type, interface)"},{"line_number":251,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_edbff3f9","line":248,"updated":"2014-12-04 19:12:12.000000000","message":"doesn\u0027t look like you need ret_exc","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"f2d94bf5c6685e8f4fee9b6b451bc4e68d36dcbc","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        )"},{"line_number":246,"context_line":"        ret_exc \u003d self._edit_config(nexus_host, target\u003d\u0027running\u0027,"},{"line_number":247,"context_line":"                          config\u003dconfstr)"},{"line_number":248,"context_line":"        if ret_exc:"},{"line_number":249,"context_line":"            LOG.err(\"Failed to add switchport trunk vlan %s on int %s %s.\","},{"line_number":250,"context_line":"                vlanid, intf_type, interface)"},{"line_number":251,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_3050742b","line":248,"in_reply_to":"5a890539_edbff3f9","updated":"2014-12-05 14:41:55.000000000","message":"We discussed and decided to keep.","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"},{"author":{"_account_id":10980,"name":"Doug Wiegley","email":"dougwig@parkside.io","username":"dougw"},"change_message_id":"a6c188f79f370a6191057b61dc0ef06aed1c2d35","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":169,"context_line":"                intf_type, interface)"},{"line_number":170,"context_line":"            result \u003d False"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        return result"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def create_vlan(self, nexus_host, vlanid, vlanname):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_1839b63f","line":171,"updated":"2014-12-05 17:49:35.000000000","message":"This looks good, but I\u0027d suggest setting result \u003d False before the try, and then you only need to set it to true if result is not None later on, and not worry about setting to false everywhere.","commit_id":"4713936ef260b0ffd1e6e661e88e5a42a34ea9f0"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"bc99982e478eefc7e1239a3f726f728a6d376b90","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":169,"context_line":"                intf_type, interface)"},{"line_number":170,"context_line":"            result \u003d False"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        return result"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def create_vlan(self, nexus_host, vlanid, vlanname):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_659daa57","line":171,"in_reply_to":"5a890539_1839b63f","updated":"2014-12-05 21:11:58.000000000","message":"Done","commit_id":"4713936ef260b0ffd1e6e661e88e5a42a34ea9f0"},{"author":{"_account_id":10980,"name":"Doug Wiegley","email":"dougwig@parkside.io","username":"dougw"},"change_message_id":"a6c188f79f370a6191057b61dc0ef06aed1c2d35","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                          config\u003dconfstr)"},{"line_number":243,"context_line":"        if ret_exc:"},{"line_number":244,"context_line":"            LOG.err(\"Failed to add switchport trunk vlan %s on int %s %s.\","},{"line_number":245,"context_line":"                vlanid, intf_type, interface)"},{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Successfully added switchport trunk vlan %s on int \""},{"line_number":248,"context_line":"                \"%s %s.\", vlanid, intf_type, interface)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_f8222a01","line":245,"updated":"2014-12-05 17:49:35.000000000","message":"This will need an i18n hint.  LOG.error(_LE(...)).","commit_id":"4713936ef260b0ffd1e6e661e88e5a42a34ea9f0"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"bc99982e478eefc7e1239a3f726f728a6d376b90","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                          config\u003dconfstr)"},{"line_number":243,"context_line":"        if ret_exc:"},{"line_number":244,"context_line":"            LOG.err(\"Failed to add switchport trunk vlan %s on int %s %s.\","},{"line_number":245,"context_line":"                vlanid, intf_type, interface)"},{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Successfully added switchport trunk vlan %s on int \""},{"line_number":248,"context_line":"                \"%s %s.\", vlanid, intf_type, interface)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_85aa966f","line":245,"in_reply_to":"5a890539_f8222a01","updated":"2014-12-05 21:11:58.000000000","message":"Done","commit_id":"4713936ef260b0ffd1e6e661e88e5a42a34ea9f0"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"293cf57bd9104cd4f1242b6b8015e94843d62be2","unresolved":false,"context_lines":[{"line_number":161,"context_line":"            try:"},{"line_number":162,"context_line":"                result \u003d re.search(\"switchport trunk allowed vlan\", response)"},{"line_number":163,"context_line":"                result \u003d False if result is None else True"},{"line_number":164,"context_line":"            except Exception:"},{"line_number":165,"context_line":"                pass"},{"line_number":166,"context_line":"        except Exception:"},{"line_number":167,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_85053416","line":164,"updated":"2014-12-16 17:27:01.000000000","message":"No try-except is needed for re.search. It can only throw an exception if response is None, and it is better to check for that explicitly.","commit_id":"0aa3e88c4ca8603de4785054ac911ac5241b2daf"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"293cf57bd9104cd4f1242b6b8015e94843d62be2","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                result \u003d False if result is None else True"},{"line_number":164,"context_line":"            except Exception:"},{"line_number":165,"context_line":"                pass"},{"line_number":166,"context_line":"        except Exception:"},{"line_number":167,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":168,"context_line":"                intf_type, interface)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_3764b3e4","line":166,"updated":"2014-12-16 17:27:01.000000000","message":"This catch is too broad. Looks like _get_config can only throw NexusConnectFailed.","commit_id":"0aa3e88c4ca8603de4785054ac911ac5241b2daf"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"a376bbd396ceffdeb42fe58f955d1dece3f2ceb1","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                result \u003d False if result is None else True"},{"line_number":164,"context_line":"            except Exception:"},{"line_number":165,"context_line":"                pass"},{"line_number":166,"context_line":"        except Exception:"},{"line_number":167,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":168,"context_line":"                intf_type, interface)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_495c3826","line":166,"in_reply_to":"3a961159_3764b3e4","updated":"2014-12-17 01:14:04.000000000","message":"Actually _get_config can return a number of exceptions from the ncclient.  These exceptions aren\u0027t readily available since we dynamically import ncclient package and they don\u0027t seem to be accessible.  Some exceptions I\u0027ve seen when rebooting N3K include SessionCloseError, SSHError, and TimeOutExpired.","commit_id":"0aa3e88c4ca8603de4785054ac911ac5241b2daf"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"33d8d6299ad568002c2808570dfd2ea3c5565bcc","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                result \u003d False if result is None else True"},{"line_number":164,"context_line":"            except Exception:"},{"line_number":165,"context_line":"                pass"},{"line_number":166,"context_line":"        except Exception:"},{"line_number":167,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":168,"context_line":"                intf_type, interface)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_d8362cb4","line":166,"in_reply_to":"3a961159_495c3826","updated":"2014-12-17 05:02:42.000000000","message":"_get_config calls nxos_connect, which already does the broad catch for the ncclient exceptions (line 123) and maps them to NexusConnectFailed.","commit_id":"0aa3e88c4ca8603de4785054ac911ac5241b2daf"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"72071f31ea8a73f804f5938f409830e0600af7c8","unresolved":false,"context_lines":[{"line_number":163,"context_line":"                result \u003d False if result is None else True"},{"line_number":164,"context_line":"            except Exception:"},{"line_number":165,"context_line":"                pass"},{"line_number":166,"context_line":"        except Exception:"},{"line_number":167,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":168,"context_line":"                intf_type, interface)"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_9982dffe","line":166,"in_reply_to":"3a961159_d8362cb4","updated":"2014-12-17 12:39:51.000000000","message":"Actually nxos_connect only gets fully called once.   After that, at the beginning of the function it checks it we are already connect and simply returns mgr pointer.  Any connection failures thereafter will be returned in mgr.get OR mgr.edit_config.  A thorough investigation of connection issues have been investigated beneath 1399998.","commit_id":"0aa3e88c4ca8603de4785054ac911ac5241b2daf"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"88fb350a1146b7f5edf8e3103a74007f934694f2","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            LOG.debug(\"GET call returned interface %s %s config\","},{"line_number":160,"context_line":"                intf_type, interface)"},{"line_number":161,"context_line":"            result \u003d re.search(\"switchport trunk allowed vlan\", response)"},{"line_number":162,"context_line":"            result \u003d False if result is None else True"},{"line_number":163,"context_line":"        except Exception:"},{"line_number":164,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":165,"context_line":"                intf_type, interface)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_bf0bf87b","line":162,"updated":"2014-12-31 05:47:43.000000000","message":"No exception is expected from lines 159-162, so they should go after the try-except.","commit_id":"61142f195a9ae9a1fe502fe520aa217eeb08c66a"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"2eb6eadc674087d626c143d6d1da63820da6bdc8","unresolved":false,"context_lines":[{"line_number":159,"context_line":"            LOG.debug(\"GET call returned interface %s %s config\","},{"line_number":160,"context_line":"                intf_type, interface)"},{"line_number":161,"context_line":"            result \u003d re.search(\"switchport trunk allowed vlan\", response)"},{"line_number":162,"context_line":"            result \u003d False if result is None else True"},{"line_number":163,"context_line":"        except Exception:"},{"line_number":164,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":165,"context_line":"                intf_type, interface)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_426a061b","line":162,"in_reply_to":"3a961159_bf0bf87b","updated":"2015-01-05 19:47:07.000000000","message":"As we discussed via email,  I will instead add an else to try-except since the except merely logs the event.","commit_id":"61142f195a9ae9a1fe502fe520aa217eeb08c66a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"28164df567ac1285d436d9b0a3e632b266cbda3b","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            response \u003d self._get_config(nexus_host, confstr)"},{"line_number":159,"context_line":"            LOG.debug(\"GET call returned interface %s %s config\","},{"line_number":160,"context_line":"                intf_type, interface)"},{"line_number":161,"context_line":"            result \u003d re.search(\"switchport trunk allowed vlan\", response)"},{"line_number":162,"context_line":"        except Exception:"},{"line_number":163,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":164,"context_line":"                intf_type, interface)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_30f8e07b","line":161,"updated":"2015-01-05 20:54:16.000000000","message":"Please move lines 159-161 to the else. Only the operation which we expect to raise an exception (_get_config) should be inside the try.","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4f639c80163e40b37ce5a47ef390aa90b216b14a","unresolved":false,"context_lines":[{"line_number":158,"context_line":"            response \u003d self._get_config(nexus_host, confstr)"},{"line_number":159,"context_line":"            LOG.debug(\"GET call returned interface %s %s config\","},{"line_number":160,"context_line":"                intf_type, interface)"},{"line_number":161,"context_line":"            result \u003d re.search(\"switchport trunk allowed vlan\", response)"},{"line_number":162,"context_line":"        except Exception:"},{"line_number":163,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":164,"context_line":"                intf_type, interface)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_4bcb0172","line":161,"in_reply_to":"3a961159_30f8e07b","updated":"2015-01-05 21:36:13.000000000","message":"Search can indeed return an exception.  Prefer to leave as is.  For example,\n\n\u003e\u003e\u003e xyz \u003d None\n\u003e\u003e\u003e result \u003d re.search(\"This is a test\", xyz)\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in ?\n  File \"/usr/lib64/python2.4/sre.py\", line 134, in search\n    return _compile(pattern, flags).search(string)\nTypeError: expected string or buffer","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"27cf571bbff1ad2a0ca92d7400b4925614ec6db4","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":164,"context_line":"                intf_type, interface)"},{"line_number":165,"context_line":"        else:"},{"line_number":166,"context_line":"            result \u003d False if result is None else True"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        return result"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_50c1ec7e","line":166,"updated":"2015-01-05 20:45:08.000000000","message":"no need for lines 165-166, just do:\n return bool(result)","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4f639c80163e40b37ce5a47ef390aa90b216b14a","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            LOG.debug(\"Failed to get interface %s %s config\","},{"line_number":164,"context_line":"                intf_type, interface)"},{"line_number":165,"context_line":"        else:"},{"line_number":166,"context_line":"            result \u003d False if result is None else True"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        return result"},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_2ba3159f","line":166,"in_reply_to":"3a961159_50c1ec7e","updated":"2015-01-05 21:36:13.000000000","message":"What I\u0027ve written is clear which I\u0027m comfortable with.","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"27cf571bbff1ad2a0ca92d7400b4925614ec6db4","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        # \u0027add\u0027 keyword to define initial vlan config; otherwise"},{"line_number":227,"context_line":"        # include the \u0027add\u0027 keyword."},{"line_number":228,"context_line":"        #"},{"line_number":229,"context_line":"        snippet \u003d (snipp.CMD_INT_VLAN_SNIPPET if response is False"},{"line_number":230,"context_line":"            else snipp.CMD_INT_VLAN_ADD_SNIPPET)"},{"line_number":231,"context_line":"        confstr \u003d self.build_intf_confstr("},{"line_number":232,"context_line":"            snippet\u003dsnippet,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_d0631caf","line":229,"updated":"2015-01-05 20:45:08.000000000","message":"prefer:\n snippet \u003d (snipp.CMD_INT_VLAN_SNIPPET if not response else snipp.CMD_INT_VLAN_ADD_SNIPPET)","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4f639c80163e40b37ce5a47ef390aa90b216b14a","unresolved":false,"context_lines":[{"line_number":226,"context_line":"        # \u0027add\u0027 keyword to define initial vlan config; otherwise"},{"line_number":227,"context_line":"        # include the \u0027add\u0027 keyword."},{"line_number":228,"context_line":"        #"},{"line_number":229,"context_line":"        snippet \u003d (snipp.CMD_INT_VLAN_SNIPPET if response is False"},{"line_number":230,"context_line":"            else snipp.CMD_INT_VLAN_ADD_SNIPPET)"},{"line_number":231,"context_line":"        confstr \u003d self.build_intf_confstr("},{"line_number":232,"context_line":"            snippet\u003dsnippet,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_4bff8134","line":229,"in_reply_to":"3a961159_d0631caf","updated":"2015-01-05 21:36:13.000000000","message":"Done","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"27cf571bbff1ad2a0ca92d7400b4925614ec6db4","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Successfully added switchport trunk vlan %s \""},{"line_number":248,"context_line":"                \"on int %s %s.\","},{"line_number":249,"context_line":"                vlanid, intf_type, interface)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def disable_vlan_on_trunk_int(self, nexus_host, vlanid, intf_type,"},{"line_number":252,"context_line":"                                  interface):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_3072a07c","line":249,"updated":"2015-01-05 20:45:08.000000000","message":"please don\u0027t use positional arguments, prefer dictionary form, as in the code above.","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"4f639c80163e40b37ce5a47ef390aa90b216b14a","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        else:"},{"line_number":247,"context_line":"            LOG.debug(\"Successfully added switchport trunk vlan %s \""},{"line_number":248,"context_line":"                \"on int %s %s.\","},{"line_number":249,"context_line":"                vlanid, intf_type, interface)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def disable_vlan_on_trunk_int(self, nexus_host, vlanid, intf_type,"},{"line_number":252,"context_line":"                                  interface):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_6bf8bd4a","line":249,"in_reply_to":"3a961159_3072a07c","updated":"2015-01-05 21:36:13.000000000","message":"Done","commit_id":"febda4eb32e613231bfc91661f9d0fc09a5d1a4a"}],"neutron/plugins/ml2/drivers/cisco/nexus/nexus_snippets.py":[{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"50133e515f3c7e65a991e482584fb11bcc0671cd","unresolved":false,"context_lines":[{"line_number":30,"context_line":"\"\"\""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"EXEC_GET_INTF_SNIPPET \u003d \"\"\""},{"line_number":33,"context_line":"    \u003ccmd\u003eshow running-config int %s %s\u003c/cmd\u003e"},{"line_number":34,"context_line":"\"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"CMD_VLAN_CONF_SNIPPET \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_c2f4f9f2","line":33,"updated":"2014-12-04 19:12:12.000000000","message":"change int to interface","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"f2d94bf5c6685e8f4fee9b6b451bc4e68d36dcbc","unresolved":false,"context_lines":[{"line_number":30,"context_line":"\"\"\""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"EXEC_GET_INTF_SNIPPET \u003d \"\"\""},{"line_number":33,"context_line":"    \u003ccmd\u003eshow running-config int %s %s\u003c/cmd\u003e"},{"line_number":34,"context_line":"\"\"\""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"CMD_VLAN_CONF_SNIPPET \u003d \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"5a890539_d02570c2","line":33,"in_reply_to":"5a890539_c2f4f9f2","updated":"2014-12-05 14:41:55.000000000","message":"Done","commit_id":"fa9c12fd5e0b5373d3264e1e6b7e1a99c0b45ba6"}],"neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py":[{"author":{"_account_id":9820,"name":"Liping Mao","email":"limao@cisco.com","username":"LipingMao"},"change_message_id":"75e4fb22fe4c77992e5277edc83ad8fcd0461d9b","unresolved":false,"context_lines":[{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        Confirm that for the second VLAN configured on a Nexus interface,"},{"line_number":422,"context_line":"        the get command string does not return \u0027switchport trunk allowed vlan\u0027"},{"line_number":423,"context_line":"        config since it is on a different host.  This too results in "},{"line_number":424,"context_line":"        configuring this CLI without the \u0027add\u0027 keyword."},{"line_number":425,"context_line":""},{"line_number":426,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_3b775a0a","line":423,"updated":"2014-11-27 01:35:01.000000000","message":"strip black space.","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"},{"author":{"_account_id":13426,"name":"Carol Bouchard","email":"cabthatsme@gmail.com","username":"caboucha"},"change_message_id":"ab2872539096eec86e16cb3f198d638ac733cb06","unresolved":false,"context_lines":[{"line_number":420,"context_line":""},{"line_number":421,"context_line":"        Confirm that for the second VLAN configured on a Nexus interface,"},{"line_number":422,"context_line":"        the get command string does not return \u0027switchport trunk allowed vlan\u0027"},{"line_number":423,"context_line":"        config since it is on a different host.  This too results in "},{"line_number":424,"context_line":"        configuring this CLI without the \u0027add\u0027 keyword."},{"line_number":425,"context_line":""},{"line_number":426,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_1643703f","line":423,"in_reply_to":"5a890539_3b775a0a","updated":"2014-12-05 14:42:15.000000000","message":"Done","commit_id":"ec3cc67a167243006eb1143ad1f1b34daf9f05ff"}]}
