)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"703cad8927309d1ec67a2b5967e194647a72ba19","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Check for valid local_ip for OVS tunnel"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When tunneling is enabled in OVS, there should be a check to"},{"line_number":10,"context_line":"check that the IP address in local_ip belongs to the host."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-bug: #1408603"},{"line_number":13,"context_line":"Change-Id: I4b4527c28d0738890e33b343c9e17941e780bc24"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"fa32b979_b127d561","line":10,"updated":"2015-06-19 03:03:06.000000000","message":"doesn\u0027t this rather belong to neutron-sanity-check?","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"5bc27d62f4e1921c67bcb32045f389f86afa3780","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Check for valid local_ip for OVS tunnel"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When tunneling is enabled in OVS, there should be a check to"},{"line_number":10,"context_line":"check that the IP address in local_ip belongs to the host."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Closes-bug: #1408603"},{"line_number":13,"context_line":"Change-Id: I4b4527c28d0738890e33b343c9e17941e780bc24"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"fa32b979_059e7762","line":10,"in_reply_to":"fa32b979_b127d561","updated":"2015-06-19 06:52:55.000000000","message":"No. In sanity check we look for support for features(vxlan, patch ports,\n ip route2, namespace, etables, ovsdb) in the nodes.\n This is  check for user configuration. Already there are checks in ovs_neutron_agent.py like\n 1) if user has provided loca_ip or not in the config  \n2) valid tunnel types provided or not\nSo I am checking whether user provided valid local_ip or not in the config","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"}],"neutron/agent/linux/ip_lib.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"62e02f67edf1f48eeb55664c8431349b3fab5d0d","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def get_namespaces(cls, root_helper):"},{"line_number":204,"context_line":"        output \u003d cls._execute(\u0027\u0027, \u0027netns\u0027, (\u0027list\u0027,), root_helper\u003droot_helper)"},{"line_number":205,"context_line":"        return [l.strip() for l in output.split(\u0027\\n\u0027)]"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def get_interface_by_ip(self, ip):"},{"line_number":208,"context_line":"        for device in self.get_devices():"},{"line_number":209,"context_line":"            if device.addr.list(to\u003dip):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_0204ce13","line":206,"updated":"2015-02-09 13:58:32.000000000","message":"I know this patch is just moving this function around, but looking at it, it\u0027s kind of silly that it performs N system calls (Where N \u003d Number of devices) instead of just 1. Right now it\u0027s only used on agent start up, but if we ever start using it on a higher frequency it\u0027d be good to make it more efficient.\n\nAlso, this function will fail on IPv6 link local addresses as they can be present on more than one device (For example a physical device and a bridge connected to that device will share the same MAC address and thus IPv6 link local address). I\u0027d appreciate a docstring stating that, as well as a TO-DO to invoke ip_lib just once.","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"7a1a5a7a5b1534f453ce625605654c9e91e498ad","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def get_namespaces(cls, root_helper):"},{"line_number":204,"context_line":"        output \u003d cls._execute(\u0027\u0027, \u0027netns\u0027, (\u0027list\u0027,), root_helper\u003droot_helper)"},{"line_number":205,"context_line":"        return [l.strip() for l in output.split(\u0027\\n\u0027)]"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def get_interface_by_ip(self, ip):"},{"line_number":208,"context_line":"        for device in self.get_devices():"},{"line_number":209,"context_line":"            if device.addr.list(to\u003dip):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_82f51ecd","line":206,"in_reply_to":"da86d52c_0204ce13","updated":"2015-02-09 14:04:49.000000000","message":"+1","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"6af56efbb2e538723b276d4d8793a6ff59aee93e","unresolved":false,"context_lines":[{"line_number":203,"context_line":"    def get_namespaces(cls, root_helper):"},{"line_number":204,"context_line":"        output \u003d cls._execute(\u0027\u0027, \u0027netns\u0027, (\u0027list\u0027,), root_helper\u003droot_helper)"},{"line_number":205,"context_line":"        return [l.strip() for l in output.split(\u0027\\n\u0027)]"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def get_interface_by_ip(self, ip):"},{"line_number":208,"context_line":"        for device in self.get_devices():"},{"line_number":209,"context_line":"            if device.addr.list(to\u003dip):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_47dea640","line":206,"in_reply_to":"da86d52c_0204ce13","updated":"2015-02-10 10:33:08.000000000","message":"Thanks Assaf. Then I won\u0027t use this function, instead I will use the below code to check the validity of the ip\n\nif utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, ip], root_helper\u003dself.root_helper)\n\nand on top of this code, I will add a comment saying that - \"this  will fail on IPv6 link local addresses as they can be present on more than one device (For example a physical device and a bridge connected to that device will share the same MAC address and thus IPv6 link local address)\"","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac9c416c446c685f1c799802a1882aa278cf28aa","unresolved":false,"context_lines":[{"line_number":191,"context_line":""},{"line_number":192,"context_line":"class IPDevice(SubProcessBase):"},{"line_number":193,"context_line":"    def __init__(self, name, namespace\u003dNone):"},{"line_number":194,"context_line":"        super(IPDevice, self).__init__(namespace\u003dnamespace)"},{"line_number":195,"context_line":"        self.name \u003d name"},{"line_number":196,"context_line":"        self.link \u003d IpLinkCommand(self)"},{"line_number":197,"context_line":"        self.addr \u003d IpAddrCommand(self)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bab921fb_1e00eda9","line":194,"updated":"2015-04-22 18:28:18.000000000","message":"self.name \u003d name if name else \u0027\u0027\n\nSome commands, like \u0027ip addr show\u0027 don\u0027t need a device name, although some methods won\u0027t like this.","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac9c416c446c685f1c799802a1882aa278cf28aa","unresolved":false,"context_lines":[{"line_number":364,"context_line":""},{"line_number":365,"context_line":"        if scope:"},{"line_number":366,"context_line":"            args +\u003d [\u0027scope\u0027, scope]"},{"line_number":367,"context_line":"        if to:"},{"line_number":368,"context_line":"            args +\u003d [\u0027to\u0027, to]"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        for line in self._run(options, tuple(args)).split(\u0027\\n\u0027):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bab921fb_7ee7e912","line":367,"updated":"2015-04-22 18:28:18.000000000","message":"if not ip_version:\n    options \u003d [get_ip_version(to)]","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac9c416c446c685f1c799802a1882aa278cf28aa","unresolved":false,"context_lines":[{"line_number":593,"context_line":"    \"\"\"Check if the ip exists on the agent\u0027s host.\"\"\""},{"line_number":594,"context_line":"    if utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, ip]):"},{"line_number":595,"context_line":"        return True"},{"line_number":596,"context_line":"    return False"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"def device_exists(device_name, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"dac4157f_15d16723","line":596,"updated":"2015-04-22 18:28:18.000000000","message":"I think this can actually be done more like device_exists() below with just a small change to the IPDevice class above.\n\ndef ip_exists(cidr, device\u003dNone, namespace\u003dNone):\n    \"\"\"Return True if the cidr exists on a device in the namespace.\"\"\"\n    try:\n        dev \u003d IPDevice(device, namespace\u003dnamespace)\n        dev.set_log_fail_as_error(False)\n        for address in dev.addr.list(to\u003dcidr):\n            if address[\u0027cidr\u0027] \u003d\u003d cidr:\n                return True\n    except RuntimeError:\n        pass\n    return False","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"c19acfd846852ae0e878f2418084062af5bd4a2a","unresolved":false,"context_lines":[{"line_number":593,"context_line":"    \"\"\"Check if the ip exists on the agent\u0027s host.\"\"\""},{"line_number":594,"context_line":"    if utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, ip]):"},{"line_number":595,"context_line":"        return True"},{"line_number":596,"context_line":"    return False"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"def device_exists(device_name, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_205334e3","line":596,"in_reply_to":"bab921fb_9469678e","updated":"2015-06-15 14:15:44.000000000","message":"Brian I agree with Venkata here. Creating an IPDevice that doesn\u0027t point to a device is a very surprising API. Maybe there\u0027s another way to share code?","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"dbc1c360411de4f62f85dc581eea0198402592cd","unresolved":false,"context_lines":[{"line_number":593,"context_line":"    \"\"\"Check if the ip exists on the agent\u0027s host.\"\"\""},{"line_number":594,"context_line":"    if utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, ip]):"},{"line_number":595,"context_line":"        return True"},{"line_number":596,"context_line":"    return False"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"def device_exists(device_name, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bab921fb_9469678e","line":596,"in_reply_to":"dac4157f_15d16723","updated":"2015-04-23 07:47:01.000000000","message":"It is like creating a dummy IPDevice structure and using it know whether Ip address exists on the host or not.\nI think, usually the IPDevice structure is used to refer an interface device and any networking stuff(address/routers etc) associated with that interface are done by creating IPDevice object and calling its methods.\nHere the intention is not to know if the ip exists on which particular interface device. We are checking if the ip address exists on the host(on any interface, doesn\u0027t bother about that).\n\ndev.addr.list(to\u003dcidr) will parse the output of ip command, which even we don\u0027t need. \"ip addr show to  \u003cip_address\u003e\" command will return string output if the ip exists on any interface, otherwise it returns None. That is sufficient to know whether ip exists on host or not(on any interface).\n\nI am of the opinion that IPDevice is used if neutron want to do anything with the interface device. All other classes(IpAddrCommand, IpLinkCommand, IpRouteCommand, IpNeighCommand) are associated with this IPdevice interface. \n\nIf you are convinced with my opinion let me know. Otherwise I will be fine to do the changes as per your suggestion.","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"60906c1f9e844befa270adb04d25cd40332d65d2","unresolved":false,"context_lines":[{"line_number":593,"context_line":"    \"\"\"Check if the ip exists on the agent\u0027s host.\"\"\""},{"line_number":594,"context_line":"    if utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, ip]):"},{"line_number":595,"context_line":"        return True"},{"line_number":596,"context_line":"    return False"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"def device_exists(device_name, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_61705e73","line":596,"in_reply_to":"fa32b979_205334e3","updated":"2015-06-15 15:02:07.000000000","message":"Assaf, yeah, after looking at the patch it is a bit hacky.  I guess I\u0027m fine with it living here or in the IPWrapper class, since using that would make it easier to support an optional namespace argument, something like:\n\ncmd \u003d [\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, ip]\nip_wrapper \u003d IPWrapper(namespace\u003dns_name)\nip_wrapper.netns.execute(cmd)\n...","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0e1a52ee976bf3460587b9ff647d3977e9f353a3","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        output \u003d cls._execute([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":195,"context_line":"        return [l.strip() for l in output.split(\u0027\\n\u0027)]"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"class IPDevice(SubProcessBase):"},{"line_number":199,"context_line":"    def __init__(self, name, namespace\u003dNone):"},{"line_number":200,"context_line":"        super(IPDevice, self).__init__(namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_f530b058","line":197,"updated":"2015-06-15 14:05:09.000000000","message":"This is such a weird API :( name becomes optional now for an IPDevice? So you can run system-wide commands by instantiating an IPDevice that doesn\u0027t point to a specific device? This doesn\u0027t make any sense to me.","commit_id":"c91c2b06325021912232a63096ae91259854008b"}],"neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"557ed8988e5911a0738499b94ac6eb1fd29654ce","unresolved":false,"context_lines":[{"line_number":1664,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled without a valid local_ip.\u0027)"},{"line_number":1665,"context_line":"            raise ValueError(msg)"},{"line_number":1666,"context_line":"        # Verify if the ip exists on the agent\u0027s host"},{"line_number":1667,"context_line":"        elif not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):"},{"line_number":1668,"context_line":"            msg \u003d _(\"Tunneling can\u0027t be enabled with invalid local_ip \u0027%s\u0027.\""},{"line_number":1669,"context_line":"                    \" IP couldn\u0027t be found on this host\u0027s interfaces.\""},{"line_number":1670,"context_line":"                    ) % kwargs[\u0027local_ip\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_5a19ce20","line":1667,"updated":"2015-07-03 09:19:10.000000000","message":"I think it is better to combine these two if statement:\n\nif not kwargs[\u0027local_ip\u0027] or not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):","commit_id":"d93b9fd447cb230a14272aeb31b87f07926f429f"},{"author":{"_account_id":16242,"name":"Rayman Lwo","email":"liangliang.luo@easystack.cn","username":"Rayman"},"change_message_id":"8698052836f9fc16070ff3e10874db2531b8c0a4","unresolved":false,"context_lines":[{"line_number":1664,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled without a valid local_ip.\u0027)"},{"line_number":1665,"context_line":"            raise ValueError(msg)"},{"line_number":1666,"context_line":"        # Verify if the ip exists on the agent\u0027s host"},{"line_number":1667,"context_line":"        elif not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):"},{"line_number":1668,"context_line":"            msg \u003d _(\"Tunneling can\u0027t be enabled with invalid local_ip \u0027%s\u0027.\""},{"line_number":1669,"context_line":"                    \" IP couldn\u0027t be found on this host\u0027s interfaces.\""},{"line_number":1670,"context_line":"                    ) % kwargs[\u0027local_ip\u0027]"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba3cc151_f50a331f","line":1667,"in_reply_to":"ba3cc151_5a19ce20","updated":"2015-07-03 09:37:04.000000000","message":"But how to raise two exception with different msg when combin these two if statement?","commit_id":"d93b9fd447cb230a14272aeb31b87f07926f429f"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"82de70cb4c9758fbc50f23ffefaf51f9619294c5","unresolved":false,"context_lines":[{"line_number":1736,"context_line":"        raise SystemExit(1)"},{"line_number":1737,"context_line":"    prepare_xen_compute()"},{"line_number":1738,"context_line":"    # Verify if the ip exists on the agent\u0027s host"},{"line_number":1739,"context_line":"    if not ip_lib.IPWrapper().get_device_by_ip(cfg.CONF.OVS.local_ip):"},{"line_number":1740,"context_line":"        msg \u003d _(\"Tunneling can\u0027t be enabled with invalid local_ip \u0027%s\u0027.\""},{"line_number":1741,"context_line":"                \" IP couldn\u0027t be found on this host\u0027s interfaces.\""},{"line_number":1742,"context_line":"                ) % cfg.CONF.OVS.local_ip"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_320a4627","line":1739,"updated":"2015-08-03 09:08:28.000000000","message":"i prefer to use agent_config[\u0027local_ip\u0027] rather than cfg.CONF.","commit_id":"7b67ac8ddae8d104da00597a9556246bd58164fc"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"82de70cb4c9758fbc50f23ffefaf51f9619294c5","unresolved":false,"context_lines":[{"line_number":1740,"context_line":"        msg \u003d _(\"Tunneling can\u0027t be enabled with invalid local_ip \u0027%s\u0027.\""},{"line_number":1741,"context_line":"                \" IP couldn\u0027t be found on this host\u0027s interfaces.\""},{"line_number":1742,"context_line":"                ) % cfg.CONF.OVS.local_ip"},{"line_number":1743,"context_line":"        raise ValueError(msg)"},{"line_number":1744,"context_line":"    try:"},{"line_number":1745,"context_line":"        agent \u003d OVSNeutronAgent(bridge_classes, **agent_config)"},{"line_number":1746,"context_line":"    except (RuntimeError, ValueError) as e:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_5237d2fd","line":1743,"updated":"2015-08-03 09:08:28.000000000","message":"LOG.error() and SystemExit(1) are more appropriate here i guess.","commit_id":"7b67ac8ddae8d104da00597a9556246bd58164fc"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"1f40b951b30b326218ef50c1d36bf41e89eed1ba","unresolved":false,"context_lines":[{"line_number":1740,"context_line":"        msg \u003d _(\"Tunneling can\u0027t be enabled with invalid local_ip \u0027%s\u0027.\""},{"line_number":1741,"context_line":"                \" IP couldn\u0027t be found on this host\u0027s interfaces.\""},{"line_number":1742,"context_line":"                ) % cfg.CONF.OVS.local_ip"},{"line_number":1743,"context_line":"        raise ValueError(msg)"},{"line_number":1744,"context_line":"    try:"},{"line_number":1745,"context_line":"        agent \u003d OVSNeutronAgent(bridge_classes, **agent_config)"},{"line_number":1746,"context_line":"    except (RuntimeError, ValueError) as e:"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a50d1a3_de79a894","line":1743,"in_reply_to":"3a50d1a3_5237d2fd","updated":"2015-08-03 11:45:07.000000000","message":"+1","commit_id":"7b67ac8ddae8d104da00597a9556246bd58164fc"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"ba0d9390d268506b613f9ee8c0ffd5ebec87342b","unresolved":false,"context_lines":[{"line_number":1740,"context_line":"        msg \u003d _(\"Tunneling can\u0027t be enabled with invalid local_ip \u0027%s\u0027.\""},{"line_number":1741,"context_line":"                \" IP couldn\u0027t be found on this host\u0027s interfaces.\""},{"line_number":1742,"context_line":"                ) % cfg.CONF.OVS.local_ip"},{"line_number":1743,"context_line":"        raise ValueError(msg)"},{"line_number":1744,"context_line":"    try:"},{"line_number":1745,"context_line":"        agent \u003d OVSNeutronAgent(bridge_classes, **agent_config)"},{"line_number":1746,"context_line":"    except (RuntimeError, ValueError) as e:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a4dcd0f_7c5eb513","line":1743,"in_reply_to":"3a50d1a3_de79a894","updated":"2015-08-04 14:21:35.000000000","message":"+1","commit_id":"7b67ac8ddae8d104da00597a9556246bd58164fc"}],"neutron/plugins/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"7a1a5a7a5b1534f453ce625605654c9e91e498ad","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if tunnel_types:"},{"line_number":208,"context_line":"            self.enable_tunneling \u003d True"},{"line_number":209,"context_line":"            if not self.ip_wrapper.get_interface_by_ip(local_ip):"},{"line_number":210,"context_line":"                LOG.warning(_LW(\u0027Tunneling is enabled, a valid local_ip \u0027"},{"line_number":211,"context_line":"                                \u0027must be provided\u0027))"},{"line_number":212,"context_line":"        else:"},{"line_number":213,"context_line":"            self.enable_tunneling \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_220f12e3","line":210,"updated":"2015-02-09 14:04:49.000000000","message":"why warning, it should be info","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"6af56efbb2e538723b276d4d8793a6ff59aee93e","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if tunnel_types:"},{"line_number":208,"context_line":"            self.enable_tunneling \u003d True"},{"line_number":209,"context_line":"            if not self.ip_wrapper.get_interface_by_ip(local_ip):"},{"line_number":210,"context_line":"                LOG.warning(_LW(\u0027Tunneling is enabled, a valid local_ip \u0027"},{"line_number":211,"context_line":"                                \u0027must be provided\u0027))"},{"line_number":212,"context_line":"        else:"},{"line_number":213,"context_line":"            self.enable_tunneling \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_e7eddab8","line":210,"in_reply_to":"da86d52c_220f12e3","updated":"2015-02-10 10:33:08.000000000","message":"Thanks Romil. For similar check in linuxbridge_neutron_agent, they are using warning. So I started using that. I also prefer \"warning\" over \"info\", as when the user sees warning he can correct the host_ip used for tunnel. If we use info, he can completely ignore this message as there will be many info logs.","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"23002d34624308013badd3ca2122337a70615319","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if tunnel_types:"},{"line_number":208,"context_line":"            self.enable_tunneling \u003d True"},{"line_number":209,"context_line":"            if not self.ip_wrapper.get_interface_by_ip(local_ip):"},{"line_number":210,"context_line":"                LOG.warning(_LW(\u0027Tunneling is enabled, a valid local_ip \u0027"},{"line_number":211,"context_line":"                                \u0027must be provided\u0027))"},{"line_number":212,"context_line":"        else:"},{"line_number":213,"context_line":"            self.enable_tunneling \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_b92f8687","line":210,"in_reply_to":"da86d52c_426f74c5","updated":"2015-02-10 11:38:58.000000000","message":"Here we are not returning when a valid locap_ip is not provided. We are just throwing warning message and continuing. So still a tunnel can be created with the provided local_ip.\n\nI think the message conveys that - tunneling is already enabled, but invalid local_ip is provided.","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"0be0d4cdb4e737925e9bfab9e4b6afad1331db82","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if tunnel_types:"},{"line_number":208,"context_line":"            self.enable_tunneling \u003d True"},{"line_number":209,"context_line":"            if not self.ip_wrapper.get_interface_by_ip(local_ip):"},{"line_number":210,"context_line":"                LOG.warning(_LW(\u0027Tunneling is enabled, a valid local_ip \u0027"},{"line_number":211,"context_line":"                                \u0027must be provided\u0027))"},{"line_number":212,"context_line":"        else:"},{"line_number":213,"context_line":"            self.enable_tunneling \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_b96786b6","line":210,"in_reply_to":"da86d52c_b92f8687","updated":"2015-02-10 11:47:26.000000000","message":"Ideally, tunnel shouldn\u0027t be created with wrong local_ip we should raise here.\n\nI didn\u0027t get you that\u0027s the actual bug we need to fix here, right?\n\n\"There should be a sanity check to check that the IP address in local_ip belongs to the host.\"\n\nand if that local_ip does not belong to the host then it won\u0027t make any sense to form the tunnels.","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"2a98051ac0d329b5cadad57d6f2973a23bbac7fb","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if tunnel_types:"},{"line_number":208,"context_line":"            self.enable_tunneling \u003d True"},{"line_number":209,"context_line":"            if not self.ip_wrapper.get_interface_by_ip(local_ip):"},{"line_number":210,"context_line":"                LOG.warning(_LW(\u0027Tunneling is enabled, a valid local_ip \u0027"},{"line_number":211,"context_line":"                                \u0027must be provided\u0027))"},{"line_number":212,"context_line":"        else:"},{"line_number":213,"context_line":"            self.enable_tunneling \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_c58b6966","line":210,"in_reply_to":"da86d52c_b96786b6","updated":"2015-02-10 13:30:01.000000000","message":"Thanks Romil. I will add LOG.error and return","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"ac5a71737db7d04657586fa680b383089f93ff67","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        if tunnel_types:"},{"line_number":208,"context_line":"            self.enable_tunneling \u003d True"},{"line_number":209,"context_line":"            if not self.ip_wrapper.get_interface_by_ip(local_ip):"},{"line_number":210,"context_line":"                LOG.warning(_LW(\u0027Tunneling is enabled, a valid local_ip \u0027"},{"line_number":211,"context_line":"                                \u0027must be provided\u0027))"},{"line_number":212,"context_line":"        else:"},{"line_number":213,"context_line":"            self.enable_tunneling \u003d False"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_426f74c5","line":210,"in_reply_to":"da86d52c_e7eddab8","updated":"2015-02-10 10:44:04.000000000","message":"\"Tunneling is enabled\" its kind of confusing, I feel we should say\n\u0027Unable to create tunnel endpoints, a valid local_ip must be provided\u0027 as warning msg.","commit_id":"506d85dca9c8284c6ee0e44435b2c1653d87aaad"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fe9ccf8dd1e51cd364398b6b225cdb4cbf30e202","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            if not self.ip_exists_on_host(local_ip):"},{"line_number":209,"context_line":"                LOG.error(_LE(\"Invalid local_ip %s provided for tunneling\"),"},{"line_number":210,"context_line":"                          local_ip)"},{"line_number":211,"context_line":"                return"},{"line_number":212,"context_line":"        else:"},{"line_number":213,"context_line":"            self.enable_tunneling \u003d False"},{"line_number":214,"context_line":"        self.local_ip \u003d local_ip"}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_e0b2bf47","line":211,"updated":"2015-02-12 09:24:37.000000000","message":"in any case you should exit with error here. This will exit with return code 0 I believe","commit_id":"96f4f97f1b287a71cbb2b0269facf76c4b755e6d"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"a5ac6742bf9ac21eb7a37f9f9cfe10697f8fe483","unresolved":false,"context_lines":[{"line_number":1571,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled without a valid local_ip.\u0027)"},{"line_number":1572,"context_line":"            raise ValueError(msg)"},{"line_number":1573,"context_line":"        # Verify if the ip exists on the agent\u0027s host."},{"line_number":1574,"context_line":"        # This may fail on IPv6 link local addresses as they can be present"},{"line_number":1575,"context_line":"        # on more than one device (For example a physical device and a bridge"},{"line_number":1576,"context_line":"        # connected to that device will share the same MAC address and thus"},{"line_number":1577,"context_line":"        # IPv6 link local address)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_281d6b74","line":1574,"updated":"2015-02-19 22:28:40.000000000","message":"is it possible to add a check for that so that we prevent this kind of failures?","commit_id":"6659c43f807126635d4c653fe1544cdc96b02f3d"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"57ca9eee041fa30c2a5725a4991ee8151f947dbd","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"        # on more than one device (For example a physical device and a bridge"},{"line_number":1576,"context_line":"        # connected to that device will share the same MAC address and thus"},{"line_number":1577,"context_line":"        # IPv6 link local address)"},{"line_number":1578,"context_line":"        elif not utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027,"},{"line_number":1579,"context_line":"                               kwargs[\u0027local_ip\u0027]],"},{"line_number":1580,"context_line":"                               root_helper\u003dkwargs[\u0027root_helper\u0027]):"},{"line_number":1581,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_86d54945","line":1578,"updated":"2015-02-20 15:43:26.000000000","message":"I think a check like this should live over in linux/ip_lib.py since it might be useful elsewhere, and it\u0027s linux-specific code.\n\nAlso, if this is supposed to check this IP is on a certain device (config.OVS.tunnel_bridge ?) then device_exists_with_ip_mac() could be easily modified to check for IP or MAC instead of requiring both.","commit_id":"6659c43f807126635d4c653fe1544cdc96b02f3d"},{"author":{"_account_id":8976,"name":"shihanzhang","email":"ayshihanzhang@gmail.com","username":"shihanzhang"},"change_message_id":"3a61317f9f64844b0cd6c01c62d792b846cb0f23","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"        # on more than one device (For example a physical device and a bridge"},{"line_number":1576,"context_line":"        # connected to that device will share the same MAC address and thus"},{"line_number":1577,"context_line":"        # IPv6 link local address)"},{"line_number":1578,"context_line":"        elif not utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027,"},{"line_number":1579,"context_line":"                               kwargs[\u0027local_ip\u0027]],"},{"line_number":1580,"context_line":"                               root_helper\u003dkwargs[\u0027root_helper\u0027]):"},{"line_number":1581,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_baa44ba6","line":1578,"updated":"2015-02-13 02:00:55.000000000","message":"if the IP is a invaild IP, the return of utils.execute() is also not empty, so I think it is better to add \u0027check_exit_code\u0027 to check this!","commit_id":"6659c43f807126635d4c653fe1544cdc96b02f3d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"bb26c9857963deca33f1a0016067d1c6b2b0820c","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"        # on more than one device (For example a physical device and a bridge"},{"line_number":1576,"context_line":"        # connected to that device will share the same MAC address and thus"},{"line_number":1577,"context_line":"        # IPv6 link local address)"},{"line_number":1578,"context_line":"        elif not utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027,"},{"line_number":1579,"context_line":"                               kwargs[\u0027local_ip\u0027]],"},{"line_number":1580,"context_line":"                               root_helper\u003dkwargs[\u0027root_helper\u0027]):"},{"line_number":1581,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"dac4157f_be2186fd","line":1578,"in_reply_to":"ba7be1f8_86d54945","updated":"2015-04-22 12:59:46.000000000","message":"I will move the check to  linux/ip_lib.py\n\nThis is not about checking ip on a certain device, so no need to modify device_exists_with_ip_mac()","commit_id":"6659c43f807126635d4c653fe1544cdc96b02f3d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"052cdf90154f1917bc92c23c7b78bea9eb8d18cb","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"        # on more than one device (For example a physical device and a bridge"},{"line_number":1576,"context_line":"        # connected to that device will share the same MAC address and thus"},{"line_number":1577,"context_line":"        # IPv6 link local address)"},{"line_number":1578,"context_line":"        elif not utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027,"},{"line_number":1579,"context_line":"                               kwargs[\u0027local_ip\u0027]],"},{"line_number":1580,"context_line":"                               root_helper\u003dkwargs[\u0027root_helper\u0027]):"},{"line_number":1581,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_cdf4e288","line":1578,"in_reply_to":"da86d52c_baa44ba6","updated":"2015-02-13 05:35:27.000000000","message":"Thanks shihanzhang. \n\nThe returncode(or exit_code) is zero for both valid and invalid ip. \nIf the ip is valid, then \u0027 ip addr show to\u0027 command gives info about the interface(i.e returns valid string). If the ip is invalid, then this command doesn\u0027t produce any output(i.e returns empty). \n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nubuntu@stack2:~$ ip addr show to 10.43.99.5\n2: eth0: \u003cBROADCAST,MULTICAST,UP,LOWER_UP\u003e mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\n    inet 10.43.99.5/24 brd 10.43.99.255 scope global eth0\n       valid_lft forever preferred_lft forever\nubuntu@stack2:~$ echo $?\n0\nubuntu@stack2:~$ ip addr show to 10.43.99.6\nubuntu@stack2:~$ echo $?\n0\nubuntu@stack2:~$ \n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nAlso below q-agt log for invalid ip 10.43.99.6\n\n2015-02-13 05:14:50.997 DEBUG neutron.agent.linux.utils [-] \nCommand: [\u0027sudo\u0027, \u0027/usr/local/bin/neutron-rootwrap\u0027, \u0027/etc/neutron/rootwrap.conf\u0027, \u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, \u002710.43.99.6\u0027]\nExit code: 0\nStdout: \nStderr:  from (pid\u003d16793) execute /opt/stack/neutron/neutron/agent/linux/utils.py:80\n2015-02-13 05:14:50.999 ERROR neutron.plugins.openvswitch.agent.ovs_neutron_agent [-] (u\u0027Tunneling cannot be enabled with invalid local_ip %s.\u0027, \u002710.43.99.6\u0027) Agent terminated!\n----------------------------------------------------------\nbelow q-agt log for valid ip 10.43.99.5\n2015-02-13 05:32:19.647 DEBUG neutron.agent.linux.utils [-] \nCommand: [\u0027sudo\u0027, \u0027/usr/local/bin/neutron-rootwrap\u0027, \u0027/etc/neutron/rootwrap.conf\u0027, \u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, \u002710.43.99.5\u0027]\nExit code: 0\nStdout: 2: eth0: \u003cBROADCAST,MULTICAST,UP,LOWER_UP\u003e mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\n    inet 10.43.99.5/24 brd 10.43.99.255 scope global eth0\n       valid_lft forever preferred_lft forever\n\nStderr:  from (pid\u003d17150) execute /opt/stack/neutron/neutron/agent/linux/utils.py:80","commit_id":"6659c43f807126635d4c653fe1544cdc96b02f3d"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"794e65ba83d26f0a05218cc616b6e9633d8048c9","unresolved":false,"context_lines":[{"line_number":1575,"context_line":"        # on more than one device (For example a physical device and a bridge"},{"line_number":1576,"context_line":"        # connected to that device will share the same MAC address and thus"},{"line_number":1577,"context_line":"        # IPv6 link local address)"},{"line_number":1578,"context_line":"        elif not utils.execute([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027,"},{"line_number":1579,"context_line":"                               kwargs[\u0027local_ip\u0027]],"},{"line_number":1580,"context_line":"                               root_helper\u003dkwargs[\u0027root_helper\u0027]):"},{"line_number":1581,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_c864d0e6","line":1578,"in_reply_to":"da86d52c_cdf4e288","updated":"2015-02-13 06:00:05.000000000","message":"Thanks for detailed explanation :)","commit_id":"6659c43f807126635d4c653fe1544cdc96b02f3d"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac9c416c446c685f1c799802a1882aa278cf28aa","unresolved":false,"context_lines":[{"line_number":1696,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled without a valid local_ip.\u0027)"},{"line_number":1697,"context_line":"            raise ValueError(msg)"},{"line_number":1698,"context_line":"        # Verify if the ip exists on the agent\u0027s host"},{"line_number":1699,"context_line":"        elif not ip_lib.ip_exists_on_host(kwargs[\u0027local_ip\u0027]):"},{"line_number":1700,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"},{"line_number":1701,"context_line":"                    \u0027local_ip %s.\u0027), kwargs[\u0027local_ip\u0027]"},{"line_number":1702,"context_line":"            raise ValueError(msg)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bab921fb_7ef8097d","line":1699,"updated":"2015-04-22 18:28:18.000000000","message":"change to ip_lib.ip_exists(...)","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"acffba971434f87483d32efcb5fe42e7aa26c771","unresolved":false,"context_lines":[{"line_number":1664,"context_line":"            raise ValueError(msg)"},{"line_number":1665,"context_line":"        # Verify if the ip exists on the agent\u0027s host"},{"line_number":1666,"context_line":"        elif not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):"},{"line_number":1667,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"},{"line_number":1668,"context_line":"                    \u0027local_ip %s.\u0027), kwargs[\u0027local_ip\u0027]"},{"line_number":1669,"context_line":"            raise ValueError(msg)"},{"line_number":1670,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_a5a0eb42","line":1667,"updated":"2015-06-19 07:04:24.000000000","message":"This message is not clear. \u0027invalid local_ip\u0027 makes it sound like the address isn\u0027t valid. 1.2.3.4 is a perfectly valid address even though it might not be on the server. Please update it to specifically say that the IP could not be found on any local interfaces. This will prevent users from wasting time worrying about formatting errors.","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"116774df55236e268fbac435bc3130aee366486d","unresolved":false,"context_lines":[{"line_number":1664,"context_line":"            raise ValueError(msg)"},{"line_number":1665,"context_line":"        # Verify if the ip exists on the agent\u0027s host"},{"line_number":1666,"context_line":"        elif not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):"},{"line_number":1667,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"},{"line_number":1668,"context_line":"                    \u0027local_ip %s.\u0027), kwargs[\u0027local_ip\u0027]"},{"line_number":1669,"context_line":"            raise ValueError(msg)"},{"line_number":1670,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_e03ca194","line":1667,"in_reply_to":"fa32b979_a5a0eb42","updated":"2015-06-19 07:19:53.000000000","message":"Thanks Kevin, I will do that","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"703cad8927309d1ec67a2b5967e194647a72ba19","unresolved":false,"context_lines":[{"line_number":1666,"context_line":"        elif not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):"},{"line_number":1667,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"},{"line_number":1668,"context_line":"                    \u0027local_ip %s.\u0027), kwargs[\u0027local_ip\u0027]"},{"line_number":1669,"context_line":"            raise ValueError(msg)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"    return kwargs"},{"line_number":1672,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_d107f9c7","line":1669,"updated":"2015-06-19 03:03:06.000000000","message":"i think this should be after prepare_xen_compute.","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"69fad619b958c2ae013fbb017f9ff3345fa495b6","unresolved":false,"context_lines":[{"line_number":1666,"context_line":"        elif not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):"},{"line_number":1667,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"},{"line_number":1668,"context_line":"                    \u0027local_ip %s.\u0027), kwargs[\u0027local_ip\u0027]"},{"line_number":1669,"context_line":"            raise ValueError(msg)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"    return kwargs"},{"line_number":1672,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_e7aee280","line":1669,"in_reply_to":"fa32b979_25705b3f","updated":"2015-07-06 03:56:45.000000000","message":"because prepare_xen_compute updates ip_lib_force_root config\nso that ip_lib executes commands on the correct node.","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"5bc27d62f4e1921c67bcb32045f389f86afa3780","unresolved":false,"context_lines":[{"line_number":1666,"context_line":"        elif not ip_lib.IPWrapper().get_device_by_ip(kwargs[\u0027local_ip\u0027]):"},{"line_number":1667,"context_line":"            msg \u003d _(\u0027Tunneling cannot be enabled with invalid \u0027"},{"line_number":1668,"context_line":"                    \u0027local_ip %s.\u0027), kwargs[\u0027local_ip\u0027]"},{"line_number":1669,"context_line":"            raise ValueError(msg)"},{"line_number":1670,"context_line":""},{"line_number":1671,"context_line":"    return kwargs"},{"line_number":1672,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_25705b3f","line":1669,"in_reply_to":"fa32b979_d107f9c7","updated":"2015-06-19 06:52:55.000000000","message":"any reason?","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"}],"neutron/tests/unit/agent/linux/test_ip_lib.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"6566e4695663cf7047258a0b127b8185bdb8904a","unresolved":false,"context_lines":[{"line_number":930,"context_line":"                                            extra_ok_codes\u003dNone,"},{"line_number":931,"context_line":"                                            run_as_root\u003dFalse)"},{"line_number":932,"context_line":""},{"line_number":933,"context_line":""},{"line_number":934,"context_line":"class TestIPExists(base.BaseTestCase):"},{"line_number":935,"context_line":"    def test_ip_exists_on_host(self):"},{"line_number":936,"context_line":"        ip \u003d \u002710.10.10.10\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"bab921fb_21c1542f","line":933,"updated":"2015-04-22 18:43:49.000000000","message":"Please remove this test and test with a functional test instead. You can look at:\n\nneutron/tests/functional/agent/linux/test_ip_lib for inspiration.\n\nA functional test would be much more effective a it would run the code under test and not fabricate an imaginary scenario and check that that scenario works. Additionally, a functional test for this kind of code tests the what and not the how. That is, you could change the implementation, not touch the test, and it would validate the change for you, whereas here any change to the implementation (But not the result) would require completely changing the test.","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"dbc1c360411de4f62f85dc581eea0198402592cd","unresolved":false,"context_lines":[{"line_number":930,"context_line":"                                            extra_ok_codes\u003dNone,"},{"line_number":931,"context_line":"                                            run_as_root\u003dFalse)"},{"line_number":932,"context_line":""},{"line_number":933,"context_line":""},{"line_number":934,"context_line":"class TestIPExists(base.BaseTestCase):"},{"line_number":935,"context_line":"    def test_ip_exists_on_host(self):"},{"line_number":936,"context_line":"        ip \u003d \u002710.10.10.10\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"bab921fb_d4f6bfd6","line":933,"in_reply_to":"bab921fb_21c1542f","updated":"2015-04-23 07:47:01.000000000","message":"sure. I will add a functional test.","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac9c416c446c685f1c799802a1882aa278cf28aa","unresolved":false,"context_lines":[{"line_number":939,"context_line":"            self.assertTrue(ip_lib.ip_exists_on_host(ip))"},{"line_number":940,"context_line":"            execute.assert_called_once_with([\u0027ip\u0027, \u0027addr\u0027, \u0027show\u0027, \u0027to\u0027, ip])"},{"line_number":941,"context_line":"            execute.return_value \u003d None"},{"line_number":942,"context_line":"            self.assertFalse(ip_lib.ip_exists_on_host(ip))"},{"line_number":943,"context_line":""},{"line_number":944,"context_line":""},{"line_number":945,"context_line":"class TestDeviceExists(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":5,"id":"bab921fb_be0b417d","line":942,"updated":"2015-04-22 18:28:18.000000000","message":"Update...\n\n+class TestIpExists(base.BaseTestCase):\n+    def test_ip_exists(self):\n+        with mock.patch.object(ip_lib.IPDevice, \u0027_execute\u0027) as _execute:\n+            _execute.return_value \u003d ADDR_SAMPLE\n+            self.assertTrue(ip_lib.ip_exists(\u0027172.16.77.240/24\u0027))\n+            _execute.assert_called_once_with([4], \u0027addr\u0027,\n+                                             (\u0027show\u0027, \u0027\u0027, \u0027to\u0027,\n+                                              \u0027172.16.77.240/24\u0027),\n+                                             log_fail_as_error\u003dFalse)\n+\n+    def test_ip_does_not_exist(self):\n+        with mock.patch.object(ip_lib.IPDevice, \u0027_execute\u0027) as _execute:\n+            _execute.return_value \u003d \u0027\u0027\n+            _execute.side_effect \u003d RuntimeError\n+            self.assertFalse(ip_lib.ip_exists(\u0027172.16.77.240/24\u0027))","commit_id":"534b3e27df6ac7c910b1d6435ee7fd4e4ec2a02c"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"0e1a52ee976bf3460587b9ff647d3977e9f353a3","unresolved":false,"context_lines":[{"line_number":963,"context_line":"                                            extra_ok_codes\u003dNone,"},{"line_number":964,"context_line":"                                            run_as_root\u003dFalse)"},{"line_number":965,"context_line":""},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"class TestIpExists(base.BaseTestCase):"},{"line_number":968,"context_line":"    def test_ip_exists(self):"},{"line_number":969,"context_line":"        with mock.patch.object(ip_lib.IPDevice, \u0027_execute\u0027) as _execute:"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa32b979_95260467","line":966,"updated":"2015-06-15 14:05:09.000000000","message":"What value do these tests provide over the functional tests? They\u0027re not more isolated in any way and they\u0027re implementation sensitive. Plus it\u0027s extra code we have to maintain.","commit_id":"c91c2b06325021912232a63096ae91259854008b"}],"neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"fe9ccf8dd1e51cd364398b6b225cdb4cbf30e202","unresolved":false,"context_lines":[{"line_number":492,"context_line":"            exec_fn.return_value \u003d False"},{"line_number":493,"context_line":"            self.assertEqual(self.agent.ip_exists_on_host(\u00271.1.1.1\u0027), False)"},{"line_number":494,"context_line":"            exec_fn.return_value \u003d True"},{"line_number":495,"context_line":"            self.assertEqual(self.agent.ip_exists_on_host(\u00271.1.1.1\u0027), True)"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def test_port_update(self):"},{"line_number":498,"context_line":"        port \u003d {\"id\": \"123\","}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_a06fe790","line":495,"updated":"2015-02-12 09:24:37.000000000","message":"this unit test is a tautology. I don\u0027t think it\u0027s actually testing anything beyond the following:\n\nif true:\n    return true\n\n\nif false:\n   return false","commit_id":"96f4f97f1b287a71cbb2b0269facf76c4b755e6d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"58de7f58d815285512ecea4313ba36e209b69e58","unresolved":false,"context_lines":[{"line_number":492,"context_line":"            exec_fn.return_value \u003d False"},{"line_number":493,"context_line":"            self.assertEqual(self.agent.ip_exists_on_host(\u00271.1.1.1\u0027), False)"},{"line_number":494,"context_line":"            exec_fn.return_value \u003d True"},{"line_number":495,"context_line":"            self.assertEqual(self.agent.ip_exists_on_host(\u00271.1.1.1\u0027), True)"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    def test_port_update(self):"},{"line_number":498,"context_line":"        port \u003d {\"id\": \"123\","}],"source_content_type":"text/x-python","patch_set":3,"id":"da86d52c_fe28a098","line":495,"in_reply_to":"da86d52c_a06fe790","updated":"2015-02-12 10:32:46.000000000","message":"Thanks Salvatore Orlando. I will modify it.","commit_id":"96f4f97f1b287a71cbb2b0269facf76c4b755e6d"}],"neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py":[{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"0e0523aec6cc83e35753bf7689cb556c1e230c55","unresolved":false,"context_lines":[{"line_number":2175,"context_line":""},{"line_number":2176,"context_line":"        ovs_neutron_agent.main({})"},{"line_number":2177,"context_line":"        mock_get_device_by_ip.assert_called_once_with(FAKE_IP1)"},{"line_number":2178,"context_line":"        self.assertEqual(agent.daemon_loop.call_count, 1)"},{"line_number":2179,"context_line":""},{"line_number":2180,"context_line":"        # verify with invalid local_ip"},{"line_number":2181,"context_line":"        mock_get_device_by_ip.reset_mock()"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a4dcd0f_3d2afe90","line":2178,"updated":"2015-08-06 09:59:52.000000000","message":"nit: self.assertEqual(expected, actual)","commit_id":"77889890a39f148a052dd2c95c9e0a4c9ee1f26f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d0486312e4af4f3ccf3d7b4422cef9d119999144","unresolved":false,"context_lines":[{"line_number":2183,"context_line":""},{"line_number":2184,"context_line":"class TestOVSNeutronAgentMain(base.BaseTestCase):"},{"line_number":2185,"context_line":""},{"line_number":2186,"context_line":"    def test_main(self):"},{"line_number":2187,"context_line":"        ovs_agent.prepare_xen_compute \u003d mock.Mock()"},{"line_number":2188,"context_line":"        mock_ovs_agent \u003d mock.patch.object("},{"line_number":2189,"context_line":"            ovs_agent, \u0027OVSNeutronAgent\u0027).start()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a4dcd0f_4c4c9476","line":2186,"updated":"2015-08-08 19:02:29.000000000","message":"Looking at the code you added, all it does is:\n\n  if some_method():\n      raise SystemExit()\n\nThat\u0027s what the test should be testing. There\u0027s no reason for so many mocks and assert_called_once_withs. You can greatly simplify all of this by encapsulating your changes to a method and call it from main, then have your test target the new method. It could become something like:\n\n  mock get_device_by_ip so that it returns a bad IP\n  assert systemexit was called","commit_id":"d9b1ae3c63f1e3f3ead8257eb9186928ef3995b1"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4fd404af820392ade55c7710df5ca3311032a982","unresolved":false,"context_lines":[{"line_number":2183,"context_line":""},{"line_number":2184,"context_line":"class TestOVSNeutronAgentMain(base.BaseTestCase):"},{"line_number":2185,"context_line":""},{"line_number":2186,"context_line":"    def test_main(self):"},{"line_number":2187,"context_line":"        ovs_agent.prepare_xen_compute \u003d mock.Mock()"},{"line_number":2188,"context_line":"        mock_ovs_agent \u003d mock.patch.object("},{"line_number":2189,"context_line":"            ovs_agent, \u0027OVSNeutronAgent\u0027).start()"}],"source_content_type":"text/x-python","patch_set":12,"id":"1a4dcd0f_8c4a9c54","line":2186,"in_reply_to":"1a4dcd0f_4c4c9476","updated":"2015-08-08 19:03:01.000000000","message":"This test is what people mean when they say that the test is \u0027at the wrong level\u0027.","commit_id":"d9b1ae3c63f1e3f3ead8257eb9186928ef3995b1"}],"neutron/tests/unit/plugins/openvswitch/agent/test_ovs_neutron_agent.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"776049b0d294d5710c151a91edc365dc67c6352c","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                              group\u003d\u0027AGENT\u0027)"},{"line_number":99,"context_line":"        with mock.patch.object(ip_lib.IPWrapper, \u0027get_device_by_ip\u0027):"},{"line_number":100,"context_line":"            self.mod_agent.create_agent_config_map(cfg.CONF)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def test_create_agent_config_map_multiple_tunnel_types(self):"},{"line_number":103,"context_line":"        cfg.CONF.set_override(\u0027local_ip\u0027, FAKE_IP1, group\u003d\u0027OVS\u0027)"},{"line_number":104,"context_line":"        cfg.CONF.set_override(\u0027tunnel_types\u0027, [p_const.TYPE_GRE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_5bc78a95","line":101,"updated":"2015-06-19 01:17:04.000000000","message":"What does this test? It seems this does nothing.","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"703cad8927309d1ec67a2b5967e194647a72ba19","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                              group\u003d\u0027AGENT\u0027)"},{"line_number":99,"context_line":"        with mock.patch.object(ip_lib.IPWrapper, \u0027get_device_by_ip\u0027):"},{"line_number":100,"context_line":"            self.mod_agent.create_agent_config_map(cfg.CONF)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def test_create_agent_config_map_multiple_tunnel_types(self):"},{"line_number":103,"context_line":"        cfg.CONF.set_override(\u0027local_ip\u0027, FAKE_IP1, group\u003d\u0027OVS\u0027)"},{"line_number":104,"context_line":"        cfg.CONF.set_override(\u0027tunnel_types\u0027, [p_const.TYPE_GRE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_f1d8fd54","line":101,"in_reply_to":"fa32b979_5bc78a95","updated":"2015-06-19 03:03:06.000000000","message":"HIrofumi, i think it tests the method doesn\u0027t raise.","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"89303ea265798959790bf5891cc42167e279d751","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                              group\u003d\u0027AGENT\u0027)"},{"line_number":99,"context_line":"        with mock.patch.object(ip_lib.IPWrapper, \u0027get_device_by_ip\u0027):"},{"line_number":100,"context_line":"            self.mod_agent.create_agent_config_map(cfg.CONF)"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def test_create_agent_config_map_multiple_tunnel_types(self):"},{"line_number":103,"context_line":"        cfg.CONF.set_override(\u0027local_ip\u0027, FAKE_IP1, group\u003d\u0027OVS\u0027)"},{"line_number":104,"context_line":"        cfg.CONF.set_override(\u0027tunnel_types\u0027, [p_const.TYPE_GRE,"}],"source_content_type":"text/x-python","patch_set":7,"id":"fa32b979_f168fdf6","line":101,"in_reply_to":"fa32b979_f1d8fd54","updated":"2015-06-19 03:35:06.000000000","message":"I got it.","commit_id":"ad3e83670aa0859c90e3690337ead1a6b99ec4eb"}]}
