)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Open vSwitch will return \u0027[]\u0027 when querying an interface\u0027s ofport"},{"line_number":10,"context_line":"when the ofport has not yet been assigned. This doesn\u0027t signal a"},{"line_number":11,"context_line":"failure, but the get_port_ofport code was treating it at as such."},{"line_number":12,"context_line":"This patch uses a decorator from python-retrying which has been"},{"line_number":13,"context_line":"added as a dependency of oslo_concurrency and therefor packaged"},{"line_number":14,"context_line":"everywhere. The call to fetch the ofport is retried until the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"3a961159_0cd568e4","line":11,"updated":"2014-12-21 06:46:59.000000000","message":"at as -\u003e as","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Open vSwitch will return \u0027[]\u0027 when querying an interface\u0027s ofport"},{"line_number":10,"context_line":"when the ofport has not yet been assigned. This doesn\u0027t signal a"},{"line_number":11,"context_line":"failure, but the get_port_ofport code was treating it at as such."},{"line_number":12,"context_line":"This patch uses a decorator from python-retrying which has been"},{"line_number":13,"context_line":"added as a dependency of oslo_concurrency and therefor packaged"},{"line_number":14,"context_line":"everywhere. The call to fetch the ofport is retried until the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"3a961159_29083d27","line":11,"in_reply_to":"3a961159_0cd568e4","updated":"2014-12-22 18:44:01.000000000","message":"Done","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":10,"context_line":"when the ofport has not yet been assigned. This doesn\u0027t signal a"},{"line_number":11,"context_line":"failure, but the get_port_ofport code was treating it at as such."},{"line_number":12,"context_line":"This patch uses a decorator from python-retrying which has been"},{"line_number":13,"context_line":"added as a dependency of oslo_concurrency and therefor packaged"},{"line_number":14,"context_line":"everywhere. The call to fetch the ofport is retried until the"},{"line_number":15,"context_line":"vsctl_timeout is reached and, on failure, INVALID_OFPORT is"},{"line_number":16,"context_line":"returned. If the call to fetch the ofport times out as part of"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"3a961159_4c0a108b","line":13,"updated":"2014-12-21 06:46:59.000000000","message":"therefor -\u003e therefore","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":10,"context_line":"when the ofport has not yet been assigned. This doesn\u0027t signal a"},{"line_number":11,"context_line":"failure, but the get_port_ofport code was treating it at as such."},{"line_number":12,"context_line":"This patch uses a decorator from python-retrying which has been"},{"line_number":13,"context_line":"added as a dependency of oslo_concurrency and therefor packaged"},{"line_number":14,"context_line":"everywhere. The call to fetch the ofport is retried until the"},{"line_number":15,"context_line":"vsctl_timeout is reached and, on failure, INVALID_OFPORT is"},{"line_number":16,"context_line":"returned. If the call to fetch the ofport times out as part of"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":32,"id":"3a961159_490bc923","line":13,"in_reply_to":"3a961159_4c0a108b","updated":"2014-12-22 18:44:01.000000000","message":"Done","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"}],"neutron/agent/linux/ovs_lib.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32061a2e4bfdb8b50923edaf2b7cfee51c16f06c","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x), tries\u003d10, delay\u003d0.01)"},{"line_number":179,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":180,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_78f02491","line":178,"updated":"2014-07-14 22:06:18.000000000","message":"Is there a reason to not just use \u0027until\u003dint\u0027?","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"11ce159719a3bf96bc3eb2d8bf4506a139b3a725","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x), tries\u003d10, delay\u003d0.01)"},{"line_number":179,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":180,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_7ea0f041","line":178,"in_reply_to":"baada198_78f02491","updated":"2014-07-15 15:06:51.000000000","message":"It used to be more complex and I shortened it, but not enough. Though there is technically a bug with just using int (or what is there now). Although ovs doesn\u0027t ever seem to use it, the schema specifies that ofport \u003e\u003d0, so if we got an ofport \u003d\u003d 0, this would fail.\n\nI\u0027ll change it to lambda x: int(x) or \u00270\u0027","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0191e3ba6ea0bc9b075cf9f7e5f13a806e31acf3","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or \u00270\u0027, tries\u003d10, delay\u003d0.01)"},{"line_number":179,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":180,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_9e1dbd13","line":178,"range":{"start_line":178,"start_character":40,"end_line":178,"end_character":53},"updated":"2014-07-15 16:44:38.000000000","message":"this condition seems strange.  what do you mean by this?","commit_id":"1042fe20096bb4cd92c792da3378b70c740e55ba"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"8d8c2672404c4b2089df7962c52e173673901473","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or \u00270\u0027, tries\u003d10, delay\u003d0.01)"},{"line_number":179,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":180,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":181,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_9e869db9","line":178,"in_reply_to":"baada198_9e1dbd13","updated":"2014-07-15 16:58:37.000000000","message":"This was a typo. :( should be int(x) or x \u003d\u003d \u00270\u0027 since ofport could be \u00270\u0027 according to the schema and bool(int(0)) \u003d\u003e False.","commit_id":"1042fe20096bb4cd92c792da3378b70c740e55ba"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"e7c3a7d02a5dec74c23139852484967570cda088","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_a11d0413","line":178,"range":{"start_line":178,"start_character":40,"end_line":178,"end_character":58},"updated":"2014-07-15 17:10:37.000000000","message":"\"int(x) or True\" would be simpler.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"8b5e6aba2b1a740bc7e34a8144aad9584c9d3659","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_6cdbe34f","line":178,"in_reply_to":"baada198_815d607c","updated":"2014-07-15 17:45:03.000000000","message":"It may be simpler, but it isn\u0027t very descriptive of what we are actually trying to allow to pass: anything int()-able and \u00270\u0027 since it is technically allowed (though unused) and bool(int(0)) -\u003e False.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7bfbce61b6c0c6a05c12028ab05b4287a21c97d7","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_815d607c","line":178,"in_reply_to":"baada198_a11d0413","updated":"2014-07-15 17:17:03.000000000","message":"That would end after the first iteration.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"e69285b28504f685b923b9922b6b1b0abc86c885","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def get_datapath_id(self):"},{"line_number":184,"context_line":"        return self.db_get_val(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_59808d49","line":181,"updated":"2014-07-16 03:44:53.000000000","message":"Isn\u0027t now the behavior changed when after retries, still can\u0027t get the port. Original code will return constants.INVALID_OFPORT while the new code raises. Wouldn\u0027t that require changes in how this method is used elsewhere (e.g. line 258 below)?","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"5157d7a4a5d7d32ae209242465e6dd28994f54b4","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def get_datapath_id(self):"},{"line_number":184,"context_line":"        return self.db_get_val(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_8a539038","line":181,"in_reply_to":"baada198_59808d49","updated":"2014-07-16 14:38:48.000000000","message":"Technically, yes. In practice, no.\n\nWhen looping ovs-vsctl add-port and ovs-vsctl get Interface ... ofport calls as fast as I can from the CLI (so no python/neutron overhead), I get the \u0027unassigned\u0027 return value less than 1% of the time and never twice in a row. Looping up to 10 times with a small delay will almost certainly catch this every time.\n\nIf, after 10 retries, the port is still unassigned something very wrong has happened. In my opinion, something wrong enough that it should raise and show a traceback in the logs and pass through to the caller of things like add_port() below.\n\nBasically a failure (something like adding a non-existing interface as a port to a bridge) and essentially a timeout (openvswitch hasn\u0027t assigned the ofport yet, but has not experienced any error) should have different results.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"9358ef4ca6298986612631336ef0eba5fb959a05","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def get_datapath_id(self):"},{"line_number":184,"context_line":"        return self.db_get_val(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_b5498c62","line":181,"in_reply_to":"baada198_8a539038","updated":"2014-07-16 17:36:21.000000000","message":"Terry, I don\u0027t buy the technically vs in practice argument. Regardless of that, you have a point regarding raising an exception rather than returning invalid port. If you choose to use raising then you have to deal with all the places that currently  expect an invalid port id. For example see add_tunnel_port below and setup_tunnel_port in the ovs agent that calls add_tunnel_port. There is code there for dealing with an invalid port id and not an exception. These should be cleaned up.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e4ac394d214f8a4643d47fb253475c911aa95d61","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    def get_datapath_id(self):"},{"line_number":184,"context_line":"        return self.db_get_val(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_2681d1fb","line":181,"in_reply_to":"baada198_b5498c62","updated":"2014-07-16 20:10:30.000000000","message":"Since the expectation is that retrying 10x will never fail to return an assigned port (which I guess is better than assuming retrying 0 times will succeed), and if any error checking is done at all by callers of add_*_port (it isn\u0027t always!) it tends to be of the log-an-error-and-exit variety, and get_port_ofport is *only* called from inside ovs_lib, I can just create a wrapper function for get_port_ofport that logs an error explaining what went wrong and return INVALID_OFPORT. I could also go ahead and call delete_port() on the port since leaving something hanging around that we expect to have failed to come into being is a bad practice.\n\nI\u0027ll also go ahead and fix all of those now-unnecessary try: int(ofport) blocks in the agent code while I\u0027m at it.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7bfbce61b6c0c6a05c12028ab05b4287a21c97d7","unresolved":false,"context_lines":[{"line_number":256,"context_line":"                              \"options:out_key\u003dflow\"])"},{"line_number":257,"context_line":"        self.run_vsctl(vsctl_command)"},{"line_number":258,"context_line":"        ofport \u003d self.get_port_ofport(port_name)"},{"line_number":259,"context_line":"        if (tunnel_type \u003d\u003d p_const.TYPE_VXLAN and"},{"line_number":260,"context_line":"                ofport \u003d\u003d constants.INVALID_OFPORT):"},{"line_number":261,"context_line":"            LOG.error(_(\u0027Unable to create VXLAN tunnel port. Please ensure \u0027"},{"line_number":262,"context_line":"                        \u0027that an openvswitch version that supports VXLAN is \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_c1903899","line":259,"updated":"2014-07-15 17:17:03.000000000","message":"Should this be removed or -1 could be value in ovsdb?","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"5f1baae3fdd549d34355c43ae7f5051e4ec6dfe8","unresolved":false,"context_lines":[{"line_number":256,"context_line":"                              \"options:out_key\u003dflow\"])"},{"line_number":257,"context_line":"        self.run_vsctl(vsctl_command)"},{"line_number":258,"context_line":"        ofport \u003d self.get_port_ofport(port_name)"},{"line_number":259,"context_line":"        if (tunnel_type \u003d\u003d p_const.TYPE_VXLAN and"},{"line_number":260,"context_line":"                ofport \u003d\u003d constants.INVALID_OFPORT):"},{"line_number":261,"context_line":"            LOG.error(_(\u0027Unable to create VXLAN tunnel port. Please ensure \u0027"},{"line_number":262,"context_line":"                        \u0027that an openvswitch version that supports VXLAN is \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_e74b8caf","line":259,"in_reply_to":"baada198_2cd1eb2f","updated":"2014-07-15 18:08:00.000000000","message":"Thanks.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"8b5e6aba2b1a740bc7e34a8144aad9584c9d3659","unresolved":false,"context_lines":[{"line_number":256,"context_line":"                              \"options:out_key\u003dflow\"])"},{"line_number":257,"context_line":"        self.run_vsctl(vsctl_command)"},{"line_number":258,"context_line":"        ofport \u003d self.get_port_ofport(port_name)"},{"line_number":259,"context_line":"        if (tunnel_type \u003d\u003d p_const.TYPE_VXLAN and"},{"line_number":260,"context_line":"                ofport \u003d\u003d constants.INVALID_OFPORT):"},{"line_number":261,"context_line":"            LOG.error(_(\u0027Unable to create VXLAN tunnel port. Please ensure \u0027"},{"line_number":262,"context_line":"                        \u0027that an openvswitch version that supports VXLAN is \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_2cd1eb2f","line":259,"in_reply_to":"baada198_c1903899","updated":"2014-07-15 17:45:03.000000000","message":"-1 is the result you get when adding the port actually fails (like if you add an interface that doesn\u0027t exist, etc.)","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"60d431a261e696f8f1d323bd1e8ea95b2f0fed2e","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            return self.get_port_ofport(port_name)"},{"line_number":186,"context_line":"        except exceptions.RetryLimitError:"},{"line_number":187,"context_line":"            LOG.error(_(\"Timed out retrieving ofport on port %(pname)s\"))"},{"line_number":188,"context_line":"            self.delete_port(port_name)"},{"line_number":189,"context_line":"        return constants.INVALID_OFPORT"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_5b068586","line":187,"updated":"2014-07-17 10:02:33.000000000","message":"Missing {\u0027pname\u0027: port_name} ?","commit_id":"174c18b69d9e4c34b1ad236dcefa303cad357efe"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e92cd5cd26183f9986c4136f55d767c6108d2dba","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        try:"},{"line_number":185,"context_line":"            return self.get_port_ofport(port_name)"},{"line_number":186,"context_line":"        except exceptions.RetryLimitError:"},{"line_number":187,"context_line":"            LOG.error(_(\"Timed out retrieving ofport on port %(pname)s\"))"},{"line_number":188,"context_line":"            self.delete_port(port_name)"},{"line_number":189,"context_line":"        return constants.INVALID_OFPORT"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_281a5ec6","line":187,"in_reply_to":"baada198_5b068586","updated":"2014-07-31 14:24:26.000000000","message":"Oops. Done.","commit_id":"174c18b69d9e4c34b1ad236dcefa303cad357efe"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"e2cabda2e83a4cb8c652cb804d31008e6912e50f","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_bf693f8e","line":178,"updated":"2014-07-31 04:56:49.000000000","message":"iirc valid openflow port number is \u003e0.","commit_id":"4fbab3787a092d119fc4ee25e3245bb549a02d5c"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6e77c8c13126812581d3a8750acc5e1ec73de5bd","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def remove_all_flows(self):"},{"line_number":176,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    @common_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027,"},{"line_number":179,"context_line":"                        tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_57e4780d","line":178,"in_reply_to":"baada198_bf693f8e","updated":"2014-07-31 14:24:03.000000000","message":"That is what you normally see, but if you look at the output of the schema:\n    \"ofport\": {\"type\": {\"key\": \"integer\", \"min\": 0}}\n\nYou can see that ofport does not have a restriction (minInteger/maxInteger), so it can technically exist. Also, an ofport can be specified with \u0027set\u0027 so I decided to be careful, just in case.","commit_id":"4fbab3787a092d119fc4ee25e3245bb549a02d5c"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2b2806f27ba10959fc61519cc07f5b07f2d5a302","unresolved":false,"context_lines":[{"line_number":176,"context_line":"    def remove_all_flows(self):"},{"line_number":177,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    @c_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027, tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_297c5971","line":179,"updated":"2014-08-13 11:20:30.000000000","message":"I know that could be rather subjective, but, delay isn\u0027t a bit short? (10ms) may be 0.1s would be better, so for 10 retries we try over a 1 second span.\n\nOr even higher, it actually may depend on how fast the ofport is going to be available, and how likely is this event to happen to need a retry.\n\nYou know the problem better, so feel free to ask for the -1 to be removed.","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"be7eaae60b440301272f79229362395617f50413","unresolved":false,"context_lines":[{"line_number":176,"context_line":"    def remove_all_flows(self):"},{"line_number":177,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    @c_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027, tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ac7a964_842ba481","line":179,"in_reply_to":"7ac7a964_7f11c3ab","updated":"2014-08-14 06:40:23.000000000","message":"ack :)","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"9f0acfd99bb4c688498e5eb8f8dd923c843a9b82","unresolved":false,"context_lines":[{"line_number":176,"context_line":"    def remove_all_flows(self):"},{"line_number":177,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"    @c_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027, tries\u003d10, delay\u003d0.01)"},{"line_number":180,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":181,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"7ac7a964_7f11c3ab","line":179,"in_reply_to":"baada198_297c5971","updated":"2014-08-13 22:56:27.000000000","message":"It actually usually takes right around that long on my machine. I may use the code that I have in the ovs_lib rewrite patch that has a timeout option and just try for the vsctl timeout instead of of based on a number of retries. But the delay of 0.01 seems to be pretty close to how long it takes to assign.","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"4789e3f65707475f7244bb98fab2ee639d4df5ca","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            return self.get_port_ofport(port_name)"},{"line_number":188,"context_line":"        except exceptions.RetryLimitError:"},{"line_number":189,"context_line":"            LOG.error(_(\"Timed out retrieving ofport on port %(pname)s\"),"},{"line_number":190,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":191,"context_line":"            self.delete_port(port_name)"},{"line_number":192,"context_line":"        return INVALID_OFPORT"}],"source_content_type":"text/x-python","patch_set":18,"id":"da9df570_0aee74b4","line":189,"updated":"2014-09-24 08:58:30.000000000","message":"nit: _LE","commit_id":"8a809d43cc933d6b73c9e3c2aed0633ab99d8536"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"d9423aeafc05d3ce1186c45560dc1c95b689e48c","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        try:"},{"line_number":187,"context_line":"            return self.get_port_ofport(port_name)"},{"line_number":188,"context_line":"        except exceptions.RetryLimitError:"},{"line_number":189,"context_line":"            LOG.error(_(\"Timed out retrieving ofport on port %(pname)s\"),"},{"line_number":190,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":191,"context_line":"            self.delete_port(port_name)"},{"line_number":192,"context_line":"        return INVALID_OFPORT"}],"source_content_type":"text/x-python","patch_set":18,"id":"da9df570_b92f5a87","line":189,"in_reply_to":"da9df570_0aee74b4","updated":"2014-09-25 16:20:27.000000000","message":"I think I\u0027d rather someone come in and change all of the logging at once in a separate patch since this file doesn\u0027t yet import any of the _L* functions.","commit_id":"8a809d43cc933d6b73c9e3c2aed0633ab99d8536"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ea2cb8ae5de113645ad57c913c2834dadd535acf","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def remove_all_flows(self):"},{"line_number":180,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    @c_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027, retries\u003d10, delay\u003d0.01)"},{"line_number":183,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":184,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_f6733613","line":182,"updated":"2014-11-08 11:23:35.000000000","message":"the following seems equivalent and clearer?\n\n  until\u003dstr.isdigit\n  # or\n  until\u003dlambda x: x.isdigit()","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4970d2d05d2aff81c3c7d4d5a060f9b4c751931c","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def remove_all_flows(self):"},{"line_number":180,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    @c_utils.retry(until\u003dlambda x: int(x) or x \u003d\u003d \u00270\u0027, retries\u003d10, delay\u003d0.01)"},{"line_number":183,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":184,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_978b4c67","line":182,"in_reply_to":"5a890539_f6733613","updated":"2014-11-13 21:28:10.000000000","message":"Done","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":10370,"name":"Romil Gupta","email":"romilgupta19@gmail.com","username":"romilg"},"change_message_id":"984cd609aef132f5b9bc82e1bfa8788d4a73b6f0","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            return self.get_port_ofport(port_name)"},{"line_number":189,"context_line":"        except exceptions.RetryLimitError:"},{"line_number":190,"context_line":"            LOG.error(_(\"Timed out retrieving ofport on port %(pname)s\"),"},{"line_number":191,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":192,"context_line":"            self.delete_port(port_name)"},{"line_number":193,"context_line":"        return INVALID_OFPORT"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_6ca5ae03","line":191,"updated":"2014-11-09 16:13:28.000000000","message":"use _LE for error log :)","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4970d2d05d2aff81c3c7d4d5a060f9b4c751931c","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            return self.get_port_ofport(port_name)"},{"line_number":189,"context_line":"        except exceptions.RetryLimitError:"},{"line_number":190,"context_line":"            LOG.error(_(\"Timed out retrieving ofport on port %(pname)s\"),"},{"line_number":191,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":192,"context_line":"            self.delete_port(port_name)"},{"line_number":193,"context_line":"        return INVALID_OFPORT"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_b7ebe811","line":191,"in_reply_to":"5a890539_6ca5ae03","updated":"2014-11-13 21:28:10.000000000","message":"Done","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e2e1a03d77eab3a915c79743291c57ea84aa7581","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def remove_all_flows(self):"},{"line_number":180,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    @c_utils.retry(until\u003dint, retries\u003d10, delay\u003d0.01)"},{"line_number":183,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":184,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_044a3527","line":182,"updated":"2014-11-19 07:27:15.000000000","message":"In my experience in 1/10 sec might not be enough to populate ofport. I would consider raising the delay to 0.03\nI know that technically this will always be more than 0.1 seconds because one has to count the time to run the method, but I would raise the delay anyway because neutron already stresses enough ovsdb-server. I\u0027m not sure if we should add conf variables for this. Probably not.","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"38ec546bd763191d092b0733433e2ba5e9eaff6d","unresolved":false,"context_lines":[{"line_number":179,"context_line":"    def remove_all_flows(self):"},{"line_number":180,"context_line":"        self.run_ofctl(\"del-flows\", [])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"    @c_utils.retry(until\u003dint, retries\u003d10, delay\u003d0.01)"},{"line_number":183,"context_line":"    def get_port_ofport(self, port_name):"},{"line_number":184,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_2cb0afdc","line":182,"in_reply_to":"5a890539_044a3527","updated":"2014-12-01 18:27:42.000000000","message":"Actually since the initial version of this patch, I\u0027ve added timeout functionality. It makes more sense to consider adding a port as a failure if it exceeds the specified ovs-vsctl timeout.\n\nSo I\u0027ll get rid of retries\u003d and use timeout\u003dcfg.CONF.ovs_vsctl_timeout. I can bump up the delay, or I could make the delay just default to exponential backoff.","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e2e1a03d77eab3a915c79743291c57ea84aa7581","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s\"),"},{"line_number":191,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":192,"context_line":"            self.delete_port(port_name)"},{"line_number":193,"context_line":"        return INVALID_OFPORT"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def get_datapath_id(self):"},{"line_number":196,"context_line":"        return self.db_get_val(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_2447311f","line":193,"updated":"2014-11-19 07:27:15.000000000","message":"We\u0027ve been using this constant for so long that I now feel it\u0027s not the case for changing it, but the fact is not that the ofport is invalid... the ofport just does not exist.","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"38ec546bd763191d092b0733433e2ba5e9eaff6d","unresolved":false,"context_lines":[{"line_number":190,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s\"),"},{"line_number":191,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":192,"context_line":"            self.delete_port(port_name)"},{"line_number":193,"context_line":"        return INVALID_OFPORT"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    def get_datapath_id(self):"},{"line_number":196,"context_line":"        return self.db_get_val(\u0027Bridge\u0027,"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_acfbbf45","line":193,"in_reply_to":"5a890539_2447311f","updated":"2014-12-01 18:27:42.000000000","message":"Well, there are cases where we actually get back a \u0027-1\u0027 where there really is a failure. The problem is that we treat a \u0027[]\u0027 the same that we do a \u0027-1\u0027. The idea of the patch is to avoid having to rewrite agent code to know the difference and just treat a timeout as a failure and clean up the port if we tell the code that it failed when it really just didn\u0027t meet our time requirements.","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e2e1a03d77eab3a915c79743291c57ea84aa7581","unresolved":false,"context_lines":[{"line_number":245,"context_line":"                ofport \u003d\u003d INVALID_OFPORT):"},{"line_number":246,"context_line":"            LOG.error(_(\u0027Unable to create VXLAN tunnel port. Please ensure \u0027"},{"line_number":247,"context_line":"                        \u0027that an openvswitch version that supports VXLAN is \u0027"},{"line_number":248,"context_line":"                        \u0027installed.\u0027))"},{"line_number":249,"context_line":"        return ofport"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def add_patch_port(self, local_name, remote_name):"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_44543dca","line":248,"updated":"2014-11-19 07:27:15.000000000","message":"If I were to do this patch, I would have probably opted for not giving _get_port_ofport the responsability for deleting a port. And I would have probably done it here. What\u0027s the reason that made you prefer doing the delete in _get_port_ofport_or_delete_port?","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0848c2197d4f4edb2fa472b918f25539e99b6aea","unresolved":false,"context_lines":[{"line_number":245,"context_line":"                ofport \u003d\u003d INVALID_OFPORT):"},{"line_number":246,"context_line":"            LOG.error(_(\u0027Unable to create VXLAN tunnel port. Please ensure \u0027"},{"line_number":247,"context_line":"                        \u0027that an openvswitch version that supports VXLAN is \u0027"},{"line_number":248,"context_line":"                        \u0027installed.\u0027))"},{"line_number":249,"context_line":"        return ofport"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def add_patch_port(self, local_name, remote_name):"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_2e0cf5eb","line":248,"in_reply_to":"5a890539_44543dca","updated":"2014-12-02 21:23:50.000000000","message":"The rationale is that you:\n\n1. have an existing public API function, get_port_ofport(), that you want to make more reliable but,\n\n2. don\u0027t want to add a new side effect to what is essentially a query function and,\n\n3.  get_port_ofport is called 3 times inside the library, but only when adding a port.\n\nSo every place that you call get_port_ofport in ovs_lib needs to clean up after itself if an ofport assignment times out. Although, now that I type all of this out, it makes more sense to solve things like:\n\n1. Create _get_port_ofport that just handles retries up to vsctl_timeout seconds and returns whatever value exists at the end of the retry period and\n\n2. Implement get_port_ofport with a try/except RetryError around a call to _get_port_ofport that returns INVALID_OFPORT on exception and\n\n3. Either add a helper like _get_port_ofport_or_delete_port or add a cleanup_on_timeout\u003dFalse argument to get_port_ofport which if set will delete the port before returning INVALID_OFPORT.\n\nThis will ensure that no users of the library have to change behavior as there will be no new possible exceptions while also making it extremely unlikely that we won\u0027t get an ofport from OVS and that if we do fail, we at least try to clean up after ourselves and users of the library can go ahead and really treat a timeout as a failure.","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"fdebaa151c9530e8d3ac844e7f96961e43ed6302","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        try:"},{"line_number":218,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":219,"context_line":"        except retrying.RetryError as e:"},{"line_number":220,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s.\"),"},{"line_number":221,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":222,"context_line":"            LOG.exception(e)"},{"line_number":223,"context_line":"            if cleanup_on_timeout:"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_0a1e9763","line":220,"updated":"2014-12-09 11:33:27.000000000","message":"i think logging exception would be enough here, no need for line 222","commit_id":"ac1c5bdc341623db43d7ab5ad96dc6860dcf41e5"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"04a21c264f306be5c9dc0fb0ca024b856ba706c4","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        try:"},{"line_number":218,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":219,"context_line":"        except retrying.RetryError as e:"},{"line_number":220,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s.\"),"},{"line_number":221,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":222,"context_line":"            LOG.exception(e)"},{"line_number":223,"context_line":"            if cleanup_on_timeout:"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_b6db13ec","line":220,"in_reply_to":"3a961159_0a1e9763","updated":"2014-12-09 23:57:19.000000000","message":"Done","commit_id":"ac1c5bdc341623db43d7ab5ad96dc6860dcf41e5"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"9eaf1058d5bba1da41b66b3309fba12548825ffd","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        try:"},{"line_number":218,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":219,"context_line":"        except retrying.RetryError as e:"},{"line_number":220,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s.\"),"},{"line_number":221,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":222,"context_line":"            LOG.exception(e)"},{"line_number":223,"context_line":"            if cleanup_on_timeout:"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_eaaa2bd1","line":220,"in_reply_to":"3a961159_0a1e9763","updated":"2014-12-09 11:37:49.000000000","message":"Good point enikanorov, still more important:\n\nWhat do you think about logging it as info?, if it\u0027s a common scenario that could happen we should not innecessarily log errors or exceptions as long as we succeed on retry. (that\u0027s eventually going to be an error on tempest).\n\nFailing after all retries would need to be logged.","commit_id":"ac1c5bdc341623db43d7ab5ad96dc6860dcf41e5"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4cd3d5ac3c2cb55105f31aa78c084a9ed631ddc3","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        try:"},{"line_number":218,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":219,"context_line":"        except retrying.RetryError as e:"},{"line_number":220,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s.\"),"},{"line_number":221,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":222,"context_line":"            LOG.exception(e)"},{"line_number":223,"context_line":"            if cleanup_on_timeout:"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_5f73f414","line":220,"in_reply_to":"3a961159_0a1e9763","updated":"2014-12-09 16:26:40.000000000","message":"I couldn\u0027t seem to get something that both flake8 would accept and that would actually print the string representation of the exception which contains the information on the number of failed attempts and what the final return value was. I\u0027ll try it again, though.","commit_id":"ac1c5bdc341623db43d7ab5ad96dc6860dcf41e5"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"04a21c264f306be5c9dc0fb0ca024b856ba706c4","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        try:"},{"line_number":218,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":219,"context_line":"        except retrying.RetryError as e:"},{"line_number":220,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s.\"),"},{"line_number":221,"context_line":"                      {\u0027pname\u0027: port_name})"},{"line_number":222,"context_line":"            LOG.exception(e)"},{"line_number":223,"context_line":"            if cleanup_on_timeout:"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a961159_96d537bb","line":220,"in_reply_to":"3a961159_eaaa2bd1","updated":"2014-12-09 23:57:19.000000000","message":"Miguel: This error is only thrown when we actually fail after all of the retrying. So probably best to leave it an Error in my opinion.","commit_id":"ac1c5bdc341623db43d7ab5ad96dc6860dcf41e5"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"783a28b8b372afb1fdbd7208b2b626b6f12d2949","unresolved":false,"context_lines":[{"line_number":48,"context_line":"def _retry_ofport(result):"},{"line_number":49,"context_line":"    \"\"\"Test for when to retry a query for an Interface\u0027s ofport\"\"\""},{"line_number":50,"context_line":"    try:"},{"line_number":51,"context_line":"        int(result)"},{"line_number":52,"context_line":"        return False"},{"line_number":53,"context_line":"    except Exception:"},{"line_number":54,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_acd60d4d","line":51,"updated":"2014-12-22 05:56:02.000000000","message":"this seems worth a comment","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":48,"context_line":"def _retry_ofport(result):"},{"line_number":49,"context_line":"    \"\"\"Test for when to retry a query for an Interface\u0027s ofport\"\"\""},{"line_number":50,"context_line":"    try:"},{"line_number":51,"context_line":"        int(result)"},{"line_number":52,"context_line":"        return False"},{"line_number":53,"context_line":"    except Exception:"},{"line_number":54,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_893e91b6","line":51,"in_reply_to":"3a961159_acd60d4d","updated":"2014-12-22 18:44:01.000000000","message":"Done","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    try:"},{"line_number":51,"context_line":"        int(result)"},{"line_number":52,"context_line":"        return False"},{"line_number":53,"context_line":"    except Exception:"},{"line_number":54,"context_line":"        return True"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_8c007867","line":53,"updated":"2014-12-21 06:46:59.000000000","message":"Please avoid using \u0027Exception\u0027 when something more specific can be expected e.g.\n\nexcept (ValueError, TypeError):\n ...\n\nAlso, this is the kind of thing that creating unit tests for is actually kinda fun. For some strange value of fun... ;)","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":50,"context_line":"    try:"},{"line_number":51,"context_line":"        int(result)"},{"line_number":52,"context_line":"        return False"},{"line_number":53,"context_line":"    except Exception:"},{"line_number":54,"context_line":"        return True"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_c9441949","line":53,"in_reply_to":"3a961159_8c007867","updated":"2014-12-22 18:44:01.000000000","message":"Done","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"783a28b8b372afb1fdbd7208b2b626b6f12d2949","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    \"\"\"Decorator for retrying when OVS has yet to assign an ofport."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    The instance\u0027s vsctl_timeout is used as the max waiting time. This relies"},{"line_number":61,"context_line":"    on the fact that class methods receive self as the first argument."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    @six.wraps(fn)"},{"line_number":64,"context_line":"    def wrapped(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_4cb6893f","line":61,"range":{"start_line":61,"start_character":21,"end_line":61,"end_character":26},"updated":"2014-12-22 05:56:02.000000000","message":"instance methods, not class methods.\nthe latter makes me think @classmethod.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    \"\"\"Decorator for retrying when OVS has yet to assign an ofport."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    The instance\u0027s vsctl_timeout is used as the max waiting time. This relies"},{"line_number":61,"context_line":"    on the fact that class methods receive self as the first argument."},{"line_number":62,"context_line":"    \"\"\""},{"line_number":63,"context_line":"    @six.wraps(fn)"},{"line_number":64,"context_line":"    def wrapped(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_8965b1e2","line":61,"in_reply_to":"3a961159_4cb6893f","updated":"2014-12-22 18:44:01.000000000","message":"Done","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6e04759936a89c81350e30694be14c9f4b198796","unresolved":false,"context_lines":[{"line_number":222,"context_line":"    def _get_port_ofport(self, port_name):"},{"line_number":223,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def get_port_ofport(self, port_name, cleanup_on_timeout\u003dFalse):"},{"line_number":226,"context_line":"        try:"},{"line_number":227,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":228,"context_line":"        except retrying.RetryError as e:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_6631b659","line":225,"updated":"2014-12-19 20:04:16.000000000","message":"why not making True the default (and only) option for cleanup_on_timeout?","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"7656ee57671de1e0dbd2a3e121ec38daa2ebe263","unresolved":false,"context_lines":[{"line_number":222,"context_line":"    def _get_port_ofport(self, port_name):"},{"line_number":223,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def get_port_ofport(self, port_name, cleanup_on_timeout\u003dFalse):"},{"line_number":226,"context_line":"        try:"},{"line_number":227,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":228,"context_line":"        except retrying.RetryError as e:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_e9dad976","line":225,"in_reply_to":"3a961159_6631b659","updated":"2014-12-19 20:17:01.000000000","message":"The reason is to preserve the default behavior of get_port_ofport() since it technically is just a query function and not related to adding a port. Having it just delete the port when used outside of an attempt at adding a port would be surprising.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":222,"context_line":"    def _get_port_ofport(self, port_name):"},{"line_number":223,"context_line":"        return self.db_get_val(\"Interface\", port_name, \"ofport\")"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"    def get_port_ofport(self, port_name, cleanup_on_timeout\u003dFalse):"},{"line_number":226,"context_line":"        try:"},{"line_number":227,"context_line":"            return self._get_port_ofport(port_name)"},{"line_number":228,"context_line":"        except retrying.RetryError as e:"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_4c7f70e0","line":225,"in_reply_to":"3a961159_e9dad976","updated":"2014-12-21 06:46:59.000000000","message":"Consider documenting these details in a docstring for the method for the benefit of future maintainers.  Unless of course you want to be on the hook for ever and ever and ever?\n\nAlso, would functional testing additions be in scope for this change, or have you added one as part of the ovslib work that you can point me to?","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"783a28b8b372afb1fdbd7208b2b626b6f12d2949","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        except retrying.RetryError as e:"},{"line_number":229,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s. \""},{"line_number":230,"context_line":"                          \"Exception: %(exception)s\"),"},{"line_number":231,"context_line":"                      {\u0027pname\u0027: port_name, \u0027exception\u0027: e})"},{"line_number":232,"context_line":"            if cleanup_on_timeout:"},{"line_number":233,"context_line":"                self.delete_port(port_name)"},{"line_number":234,"context_line":"        return INVALID_OFPORT"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_cc3ef98a","line":231,"updated":"2014-12-22 05:56:02.000000000","message":"LOG.exception ?","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        except retrying.RetryError as e:"},{"line_number":229,"context_line":"            LOG.error(_LE(\"Timed out retrieving ofport on port %(pname)s. \""},{"line_number":230,"context_line":"                          \"Exception: %(exception)s\"),"},{"line_number":231,"context_line":"                      {\u0027pname\u0027: port_name, \u0027exception\u0027: e})"},{"line_number":232,"context_line":"            if cleanup_on_timeout:"},{"line_number":233,"context_line":"                self.delete_port(port_name)"},{"line_number":234,"context_line":"        return INVALID_OFPORT"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_ec3d75de","line":231,"in_reply_to":"3a961159_cc3ef98a","updated":"2014-12-22 18:44:01.000000000","message":"Just keeping things the same as all of the other exception logging in here so far. I\u0027ll go ahead and change it.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"783a28b8b372afb1fdbd7208b2b626b6f12d2949","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                          \"Exception: %(exception)s\"),"},{"line_number":231,"context_line":"                      {\u0027pname\u0027: port_name, \u0027exception\u0027: e})"},{"line_number":232,"context_line":"            if cleanup_on_timeout:"},{"line_number":233,"context_line":"                self.delete_port(port_name)"},{"line_number":234,"context_line":"        return INVALID_OFPORT"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def get_datapath_id(self):"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_4cee89ee","line":233,"updated":"2014-12-22 05:56:02.000000000","message":"what\u0027s the rationale to remove the port only on timeout, not on -1?","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":230,"context_line":"                          \"Exception: %(exception)s\"),"},{"line_number":231,"context_line":"                      {\u0027pname\u0027: port_name, \u0027exception\u0027: e})"},{"line_number":232,"context_line":"            if cleanup_on_timeout:"},{"line_number":233,"context_line":"                self.delete_port(port_name)"},{"line_number":234,"context_line":"        return INVALID_OFPORT"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def get_datapath_id(self):"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_c7541200","line":233,"in_reply_to":"3a961159_4cee89ee","updated":"2014-12-22 18:44:01.000000000","message":"Originally, I was just thinking that we needed to clean up a port that timed out when treating it as a failure. If we do that, I suppose it makes sense to delete it if it actually fails too.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c7036ea18c2ae573695296d55edb8d518ed374b9","unresolved":false,"context_lines":[{"line_number":45,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def _retry_ofport(result):"},{"line_number":49,"context_line":"    \"\"\"Test for when to retry a query for an Interface\u0027s ofport\"\"\""},{"line_number":50,"context_line":"    # ovs-vsctl can return \u0027[]\u0027 for an ofport that has not yet been assigned"},{"line_number":51,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_b69fcc64","line":48,"updated":"2014-12-29 06:03:23.000000000","message":"I would name this function _ofport_result_pending","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0c93188ede3c32b1ccc5dfa406b7d1069b09b755","unresolved":false,"context_lines":[{"line_number":45,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def _retry_ofport(result):"},{"line_number":49,"context_line":"    \"\"\"Test for when to retry a query for an Interface\u0027s ofport\"\"\""},{"line_number":50,"context_line":"    # ovs-vsctl can return \u0027[]\u0027 for an ofport that has not yet been assigned"},{"line_number":51,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_21c2ad86","line":48,"in_reply_to":"3a961159_b69fcc64","updated":"2014-12-29 17:55:28.000000000","message":"Done","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c7036ea18c2ae573695296d55edb8d518ed374b9","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def _retry_ofport(result):"},{"line_number":49,"context_line":"    \"\"\"Test for when to retry a query for an Interface\u0027s ofport\"\"\""},{"line_number":50,"context_line":"    # ovs-vsctl can return \u0027[]\u0027 for an ofport that has not yet been assigned"},{"line_number":51,"context_line":"    try:"},{"line_number":52,"context_line":"        int(result)"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_3693dc5d","line":49,"updated":"2014-12-29 06:03:23.000000000","message":"\"Return True if the result from ovs-vsctl indicates the result is still pending.\"","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0c93188ede3c32b1ccc5dfa406b7d1069b09b755","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"def _retry_ofport(result):"},{"line_number":49,"context_line":"    \"\"\"Test for when to retry a query for an Interface\u0027s ofport\"\"\""},{"line_number":50,"context_line":"    # ovs-vsctl can return \u0027[]\u0027 for an ofport that has not yet been assigned"},{"line_number":51,"context_line":"    try:"},{"line_number":52,"context_line":"        int(result)"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_41bfb9fc","line":49,"in_reply_to":"3a961159_3693dc5d","updated":"2014-12-29 17:55:28.000000000","message":"Done","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c7036ea18c2ae573695296d55edb8d518ed374b9","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        return True"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def _ofport_retry_decorator(fn):"},{"line_number":59,"context_line":"    \"\"\"Decorator for retrying when OVS has yet to assign an ofport."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    The instance\u0027s vsctl_timeout is used as the max waiting time. This relies"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_5690684e","line":58,"updated":"2014-12-29 06:03:23.000000000","message":"I would name this _ofport_retry() or _ofport_retry_while_result_pending()","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0c93188ede3c32b1ccc5dfa406b7d1069b09b755","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        return True"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"def _ofport_retry_decorator(fn):"},{"line_number":59,"context_line":"    \"\"\"Decorator for retrying when OVS has yet to assign an ofport."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    The instance\u0027s vsctl_timeout is used as the max waiting time. This relies"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_61bcb507","line":58,"in_reply_to":"3a961159_5690684e","updated":"2014-12-29 17:55:28.000000000","message":"Done","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c7036ea18c2ae573695296d55edb8d518ed374b9","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                              \"Exception: %(exception)s\"),"},{"line_number":239,"context_line":"                          {\u0027pname\u0027: port_name, \u0027exception\u0027: e})"},{"line_number":240,"context_line":"        if ofport \u003d\u003d INVALID_OFPORT and cleanup_on_failure:"},{"line_number":241,"context_line":"            self.delete_port(port_name)"},{"line_number":242,"context_line":"        return ofport"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def get_datapath_id(self):"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_b9fdff0a","line":241,"updated":"2014-12-29 06:03:23.000000000","message":"I don\u0027t like that this is done inside get_port_ofport(). It looks like the only callers who would want to have this cleanup done (three of them, and they are all methods that try to add ports) are in this class. So rather than pollute the signature of get_port_ofport() for external callers (although there currently aren\u0027t any) with a parameter that is contradictory to a get_ operation, IMO it would be better for the three internal callers to do the failure clean up explicitly, at lines 182, 292 and 304.","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0c93188ede3c32b1ccc5dfa406b7d1069b09b755","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                              \"Exception: %(exception)s\"),"},{"line_number":239,"context_line":"                          {\u0027pname\u0027: port_name, \u0027exception\u0027: e})"},{"line_number":240,"context_line":"        if ofport \u003d\u003d INVALID_OFPORT and cleanup_on_failure:"},{"line_number":241,"context_line":"            self.delete_port(port_name)"},{"line_number":242,"context_line":"        return ofport"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def get_datapath_id(self):"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_267ac325","line":241,"in_reply_to":"3a961159_b9fdff0a","updated":"2014-12-29 17:55:28.000000000","message":"I don\u0027t particularly like duplicating the cleanup behavior in each of the add_port functions, but don\u0027t particularly like it the way it is here either.\n\nI suppose the thing I really don\u0027t like is that there are 3 add_port functions that largely duplicate each other\u0027s functionality. I\u0027d much rather see each of those functions call a single function that handles the attempted port addition, ofport check and potential cleanup, but I was trying to limit the change to just doing the retrying.\n\nI may go ahead and work up something with a unified _add_port function, though I\u0027m getting tired of working on this patch and doing any rework of it makes me a bit nervous because everyone seems to want things to be slightly different...","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"}],"neutron/common/utils.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32061a2e4bfdb8b50923edaf2b7cfee51c16f06c","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        return 1"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"def retry(until, tries, delay\u003dNone):"},{"line_number":307,"context_line":"    \"\"\"Decorator to retry a function until a condition passes."},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    :param until: When this function evaluates to True, retrying stops"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_78c2e434","line":306,"updated":"2014-07-14 22:06:18.000000000","message":"Defaulting to no delay seems a bit dangerous given that misconfiguration of this decorator has the potential to result in 100% cpu until the retry limit is hit.  I would suggests a warning at this possibility be added to the documentation, and maybe also set a tiny delay rather than none at all.","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"11ce159719a3bf96bc3eb2d8bf4506a139b3a725","unresolved":false,"context_lines":[{"line_number":303,"context_line":"        return 1"},{"line_number":304,"context_line":""},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"def retry(until, tries, delay\u003dNone):"},{"line_number":307,"context_line":"    \"\"\"Decorator to retry a function until a condition passes."},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    :param until: When this function evaluates to True, retrying stops"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_5455cbf7","line":306,"in_reply_to":"baada198_78c2e434","updated":"2014-07-15 15:06:51.000000000","message":"I\u0027m conflicted about this. I see your point, but from an API/principal of least surprise standpoint I don\u0027t like adding possible accidental delays. Didn\u0027t specify a delay? Ok, I\u0027ll delay.\n\nFor example, if @retry is used in a unit test and people use the default, all of the sudden those unit tests which are run thousands of times a day are taking orders of magnitude more time than they should.\n\nHow about a compromise? No default. Just make people think about the delay when using the function?","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2b2806f27ba10959fc61519cc07f5b07f2d5a302","unresolved":false,"context_lines":[{"line_number":352,"context_line":"                    pass"},{"line_number":353,"context_line":"                local_tries -\u003d 1"},{"line_number":354,"context_line":"                if local_tries \u003d\u003d 0:"},{"line_number":355,"context_line":"                    raise exceptions.RetryLimitError(tries\u003dtries)"},{"line_number":356,"context_line":"                if delay:"},{"line_number":357,"context_line":"                    time.sleep(delay)"},{"line_number":358,"context_line":"            return result"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_c9cd9d94","line":355,"updated":"2014-08-13 11:20:30.000000000","message":"Could it make any sense to save the exception results (if any exception happened), and provide that exception detail as a parameter of RetryLimitError exception? (and make that render providing the details of the \u0027inner\u0027 exception.\n\n\nOther option could be logging an inner exception (for example, if we provide a log_exceptions\u003dTrue in the decorator), there could be functions were we\u0027re relying on the result, but not expecting any exception to be rised in normal conditions, and that would be hidden by the decorator without logging.","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"be7eaae60b440301272f79229362395617f50413","unresolved":false,"context_lines":[{"line_number":352,"context_line":"                    pass"},{"line_number":353,"context_line":"                local_tries -\u003d 1"},{"line_number":354,"context_line":"                if local_tries \u003d\u003d 0:"},{"line_number":355,"context_line":"                    raise exceptions.RetryLimitError(tries\u003dtries)"},{"line_number":356,"context_line":"                if delay:"},{"line_number":357,"context_line":"                    time.sleep(delay)"},{"line_number":358,"context_line":"            return result"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ac7a964_c4aafcd3","line":355,"in_reply_to":"7ac7a964_1f60cf34","updated":"2014-08-14 06:40:23.000000000","message":"Yes, but what I mean, is... for example, some deeper methods could be throwing up exceptions for unexpected conditions/etc (a resource is gone, can\u0027t connect to RPC, etc...) and it would be good to yet find the reason in the logs, \n\nat least logging such exception before throwing up the RetryLimitError.\n\nI understand in your usage it\u0027s pretty clear that won\u0027t happen, but I\u0027m thinking of other people (or myself) using the retry decorator in other places, may be that could be the moment to implement such logging.. ;)","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"333a800012e42dcbb92aa82a666bf8697d1bd70e","unresolved":false,"context_lines":[{"line_number":352,"context_line":"                    pass"},{"line_number":353,"context_line":"                local_tries -\u003d 1"},{"line_number":354,"context_line":"                if local_tries \u003d\u003d 0:"},{"line_number":355,"context_line":"                    raise exceptions.RetryLimitError(tries\u003dtries)"},{"line_number":356,"context_line":"                if delay:"},{"line_number":357,"context_line":"                    time.sleep(delay)"},{"line_number":358,"context_line":"            return result"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ac7a964_bce7b73f","line":355,"in_reply_to":"7ac7a964_c4aafcd3","updated":"2014-09-23 17:05:28.000000000","message":"The only issue I have with saving the Exception from running \u0027until\u0027 and adding it to the RetryLimitError is that there could be lots of different reasons the underlying thing failed during each of the tries, and you\u0027d really only be displaying the last one via the RetryLimitError.\n\nLogging the exception as it happens resolves that issue, though theoretically could spam the bejeezus out of the log depending on the other values passed to retry--and even if you want to pass log_exceptions\u003dTrue because it would be handy to have the log, you might still need to retry fast enough to really spam the logs. I\u0027ll go ahead and add the option and just trust that whoever uses it is a responsible adult.\n\nAdding the timeout option, and then the logging option...I may end up eventually looking like: https://github.com/rholder/retrying/blob/master/retrying.py :)","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"9f0acfd99bb4c688498e5eb8f8dd923c843a9b82","unresolved":false,"context_lines":[{"line_number":352,"context_line":"                    pass"},{"line_number":353,"context_line":"                local_tries -\u003d 1"},{"line_number":354,"context_line":"                if local_tries \u003d\u003d 0:"},{"line_number":355,"context_line":"                    raise exceptions.RetryLimitError(tries\u003dtries)"},{"line_number":356,"context_line":"                if delay:"},{"line_number":357,"context_line":"                    time.sleep(delay)"},{"line_number":358,"context_line":"            return result"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ac7a964_1f60cf34","line":355,"in_reply_to":"baada198_c9cd9d94","updated":"2014-08-13 22:56:27.000000000","message":"The only exception that will be caught is the until function raising, which it is most likely designed to do as a means of forcing a retry. If the function we\u0027re wrapping, fn, throws an exception it should still pass through, right?","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"4789e3f65707475f7244bb98fab2ee639d4df5ca","unresolved":false,"context_lines":[{"line_number":365,"context_line":"    \"\"\"Decorator to retry a function until a condition passes."},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    :param until: When this function evaluates to True, retrying stops"},{"line_number":368,"context_line":"    :param tries: The maximum number of retries"},{"line_number":369,"context_line":"    :param delay: The time in seconds to wait between retries"},{"line_number":370,"context_line":"    :returns: the result of the wrapped function after until condition met"},{"line_number":371,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"da9df570_aab0088c","line":368,"updated":"2014-09-24 08:58:30.000000000","message":"nit: it\u0027s named tries but means retries - it can lead to confusion","commit_id":"8a809d43cc933d6b73c9e3c2aed0633ab99d8536"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"d9423aeafc05d3ce1186c45560dc1c95b689e48c","unresolved":false,"context_lines":[{"line_number":365,"context_line":"    \"\"\"Decorator to retry a function until a condition passes."},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    :param until: When this function evaluates to True, retrying stops"},{"line_number":368,"context_line":"    :param tries: The maximum number of retries"},{"line_number":369,"context_line":"    :param delay: The time in seconds to wait between retries"},{"line_number":370,"context_line":"    :returns: the result of the wrapped function after until condition met"},{"line_number":371,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"da9df570_f96562b5","line":368,"in_reply_to":"da9df570_aab0088c","updated":"2014-09-25 16:20:27.000000000","message":"Done","commit_id":"8a809d43cc933d6b73c9e3c2aed0633ab99d8536"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ea2cb8ae5de113645ad57c913c2834dadd535acf","unresolved":false,"context_lines":[{"line_number":382,"context_line":"        ...    return x.pop(0)"},{"line_number":383,"context_line":"        ..."},{"line_number":384,"context_line":"        \u003e\u003e\u003e do_stuff()"},{"line_number":385,"context_line":"        Traceback (most recent call last):"},{"line_number":386,"context_line":"            ..."},{"line_number":387,"context_line":"        RetryLimitError: Retry limit of 1 reached"},{"line_number":388,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_765f4673","line":385,"updated":"2014-11-08 11:23:35.000000000","message":"Is it a good idea to split the function and the result check?\n\nAn alternative would be to allow the function to raise a RetryIteration exception:\n\n  @retry(until\u003dlambda x: x is not None, retries\u003d10, delay\u003d0)\n  def do_stuff():\n     return x.pop(0)\n\nwould become:\n\n @retry(retries\u003d10, delay\u003d0)\n  def do_stuff():\n     result \u003d x.pop(0)\n     if result is None:\n        return result\n     raise RetryIteration\n\nThe alternative is more flexible as it allows to embed one or more checks in the function.","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4970d2d05d2aff81c3c7d4d5a060f9b4c751931c","unresolved":false,"context_lines":[{"line_number":382,"context_line":"        ...    return x.pop(0)"},{"line_number":383,"context_line":"        ..."},{"line_number":384,"context_line":"        \u003e\u003e\u003e do_stuff()"},{"line_number":385,"context_line":"        Traceback (most recent call last):"},{"line_number":386,"context_line":"            ..."},{"line_number":387,"context_line":"        RetryLimitError: Retry limit of 1 reached"},{"line_number":388,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_f75650cd","line":385,"in_reply_to":"5a890539_765f4673","updated":"2014-11-13 21:28:10.000000000","message":"I don\u0027t generally like the idea of a decorator that requires you to rewrite parts of the function being decorated. If you are going to hard code in when to retry, might as well just add a retry loop to the function itself, IMHO.","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ea2cb8ae5de113645ad57c913c2834dadd535acf","unresolved":false,"context_lines":[{"line_number":393,"context_line":"            local_retries \u003d retries"},{"line_number":394,"context_line":"            if timeout:"},{"line_number":395,"context_line":"                timeout_time \u003d time.time() + timeout"},{"line_number":396,"context_line":"            while True:"},{"line_number":397,"context_line":"                result \u003d fn(*args, **kwargs)"},{"line_number":398,"context_line":"                try:"},{"line_number":399,"context_line":"                    if until(result):"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_56832acc","line":396,"updated":"2014-11-08 11:23:35.000000000","message":"The while True can be replaced by a for loop which ensures non-infinite iterations even after potential future refactorings:\n\n  if timeout:\n    timeout_time \u003d time.time() + timeout\n\n  for __ in range(retries +1):\n     result \u003d fn(*args, **kwargs)\n     try:\n       if until(result):\n         return result\n     except Exception as e:\n       if log_exceptions:\n         LOG.exception(e)\n     if timeout and time.time() \u003e timeout_time:\n       raise n_exc.RetryTimeoutError(timeout\u003dtimeout)\n     if delay:\n       time.sleep(delay)\n  raise n_exc.RetryLimitError(retries\u003dretries)","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4970d2d05d2aff81c3c7d4d5a060f9b4c751931c","unresolved":false,"context_lines":[{"line_number":393,"context_line":"            local_retries \u003d retries"},{"line_number":394,"context_line":"            if timeout:"},{"line_number":395,"context_line":"                timeout_time \u003d time.time() + timeout"},{"line_number":396,"context_line":"            while True:"},{"line_number":397,"context_line":"                result \u003d fn(*args, **kwargs)"},{"line_number":398,"context_line":"                try:"},{"line_number":399,"context_line":"                    if until(result):"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_17875cd8","line":396,"in_reply_to":"5a890539_56832acc","updated":"2014-11-13 21:28:10.000000000","message":"I like how it simplifies the code (and one of my first tries did it that way), but it does keep one from actually doing a \"retry until success\" by specifying retries \u003c 0 and I was trying not to make choices for the user of the decorator. At the very least, I\u0027d need to document that for the retries argument. Thoughts?","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ea2cb8ae5de113645ad57c913c2834dadd535acf","unresolved":false,"context_lines":[{"line_number":398,"context_line":"                try:"},{"line_number":399,"context_line":"                    if until(result):"},{"line_number":400,"context_line":"                        break"},{"line_number":401,"context_line":"                except Exception as e:"},{"line_number":402,"context_line":"                    # This allows the until function raising to signal retry"},{"line_number":403,"context_line":"                    if log_exceptions:"},{"line_number":404,"context_line":"                        LOG.exception(e)"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_966cb238","line":401,"updated":"2014-11-08 11:23:35.000000000","message":"The wrapper catchs potential errors in until calls but not in fn calls  ... such behavior seems inconsistent and strongly linked to its use in ovs_lib","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"4970d2d05d2aff81c3c7d4d5a060f9b4c751931c","unresolved":false,"context_lines":[{"line_number":398,"context_line":"                try:"},{"line_number":399,"context_line":"                    if until(result):"},{"line_number":400,"context_line":"                        break"},{"line_number":401,"context_line":"                except Exception as e:"},{"line_number":402,"context_line":"                    # This allows the until function raising to signal retry"},{"line_number":403,"context_line":"                    if log_exceptions:"},{"line_number":404,"context_line":"                        LOG.exception(e)"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a890539_57256407","line":401,"in_reply_to":"5a890539_966cb238","updated":"2014-11-13 21:28:10.000000000","message":"The idea is that you can use either a False return or Exception to trigger a retry. You don\u0027t want to mess with the wrapped function\u0027s Exception handling, but it is handy to be able to use built-in functions that throw exceptions to generate a retry if you want as opposed to having to write a wrapper function that catches the exception and returns false.","commit_id":"479554ddc7ccf1676f98a6344948f0161794e7a4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e2e1a03d77eab3a915c79743291c57ea84aa7581","unresolved":false,"context_lines":[{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    :param until: When this function evaluates to True, retrying stops"},{"line_number":368,"context_line":"    :param retries: The maximum number of reretries"},{"line_number":369,"context_line":"    :param delay: The time in seconds to wait between reretries"},{"line_number":370,"context_line":"    :returns: the result of the wrapped function after until condition met"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    For example:"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_c4402d0a","line":369,"updated":"2014-11-19 07:27:15.000000000","message":"reretries or retries?","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"38ec546bd763191d092b0733433e2ba5e9eaff6d","unresolved":false,"context_lines":[{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    :param until: When this function evaluates to True, retrying stops"},{"line_number":368,"context_line":"    :param retries: The maximum number of reretries"},{"line_number":369,"context_line":"    :param delay: The time in seconds to wait between reretries"},{"line_number":370,"context_line":"    :returns: the result of the wrapped function after until condition met"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    For example:"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_cfc2bd52","line":369,"in_reply_to":"5a890539_5a224d02","updated":"2014-12-01 18:27:42.000000000","message":"API-wise, i really prefer something like:\n\n    def fun():\n        return do_stuff_that_might_fail()\n\n\n    def retry(until, retries\u003dNone, delay\u003dNone, timeout\u003dNone, log_exceptions\u003dFalse)\n\nwithout a @retry, fun will run once and return whatever. Adding:\n\n    @retry(until\u003dint)\n    def fun():\n\nwould retry indefinitely as fast as possible because no restrictions were passed in. Yes, this is often not what one would want to do, but a) it makes the API and implementation much cleaner and b) Python has a history of \"trusting the developer to do the right thing\". No private scope in classes, etc. This is what documentation is for, IMHO.\n\nThen if someone wants to add restrictions to the retying behavior, they\u0027d do\n\n    @retry(until\u003dint, retries\u003d1, delay\u003d0.1)\n\nor whatever. Each restriction being additive. It is a lot more logical to pass in restrictions as needed. Forcing people to pass arguments they don\u0027t care about because you don\u0027t trust them or having to do retries\u003d-1 to try forever and muddy up the code with the extra checks, etc. is just ugly. The code would always run once since that is what would happen without the wrapper, and retries would equal the number of additional times to run if there was a failure.\n\nThe reason it isn\u0027t currently this way is that there was some pushback for making it too easy to do an infinite loop. But frankly, if you can\u0027t trust a developer to read the very simple documentation of a wrapper before using it then you already have a problem IMHO.\n\nSo I\u0027m going to revamp this back to something that I actually like again and just see if I can convince people that I (and you, Cedric, since your previous comments expressed similar things ideas) am right. :p","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"5417714ae6a4355f6744dbc31c659c48f81f407a","unresolved":false,"context_lines":[{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    :param until: When this function evaluates to True, retrying stops"},{"line_number":368,"context_line":"    :param retries: The maximum number of reretries"},{"line_number":369,"context_line":"    :param delay: The time in seconds to wait between reretries"},{"line_number":370,"context_line":"    :returns: the result of the wrapped function after until condition met"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    For example:"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_5a224d02","line":369,"in_reply_to":"5a890539_c4402d0a","updated":"2014-11-19 13:53:16.000000000","message":"The code retries ($retries -1) times and tries $retries times.\n\nAccording to a discussion in a merged change (sorry don\u0027t remember which one), the term attempts seems better than retries.","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"e2e1a03d77eab3a915c79743291c57ea84aa7581","unresolved":false,"context_lines":[{"line_number":404,"context_line":"                        LOG.exception(e)"},{"line_number":405,"context_line":"                if timeout and time.time() \u003e timeout_time:"},{"line_number":406,"context_line":"                    raise n_exc.RetryTimeoutError(timeout\u003dtimeout)"},{"line_number":407,"context_line":"                if local_retries \u003e\u003d 0:"},{"line_number":408,"context_line":"                    local_retries -\u003d 1"},{"line_number":409,"context_line":"                    if local_retries \u003d\u003d 0:"},{"line_number":410,"context_line":"                        raise n_exc.RetryLimitError(retries\u003dretries)"}],"source_content_type":"text/x-python","patch_set":25,"id":"5a890539_e4452918","line":407,"updated":"2014-11-19 07:27:15.000000000","message":"If local_retries \u003d\u003d 0 means retry forever perhaps this is something worth stating in the docstring","commit_id":"165f2d27a5dbe191176211e7df1d8f3926d60f19"}],"neutron/plugins/ofagent/agent/ofa_neutron_agent.py":[{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"783a28b8b372afb1fdbd7208b2b626b6f12d2949","unresolved":false,"context_lines":[{"line_number":653,"context_line":"                                    self.local_ip,"},{"line_number":654,"context_line":"                                    tunnel_type,"},{"line_number":655,"context_line":"                                    self.vxlan_udp_port,"},{"line_number":656,"context_line":"                                    self.dont_fragment)"},{"line_number":657,"context_line":"        if ofport \u003d\u003d ovs_lib.INVALID_OFPORT:"},{"line_number":658,"context_line":"            LOG.error(_LE(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":659,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_ecad759c","line":656,"updated":"2014-12-22 05:56:02.000000000","message":"isn\u0027t ofport a string here?","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":653,"context_line":"                                    self.local_ip,"},{"line_number":654,"context_line":"                                    tunnel_type,"},{"line_number":655,"context_line":"                                    self.vxlan_udp_port,"},{"line_number":656,"context_line":"                                    self.dont_fragment)"},{"line_number":657,"context_line":"        if ofport \u003d\u003d ovs_lib.INVALID_OFPORT:"},{"line_number":658,"context_line":"            LOG.error(_LE(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":659,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_07b0da41","line":656,"in_reply_to":"3a961159_ecad759c","updated":"2014-12-22 18:44:01.000000000","message":"Yes, and so is ovs_lib.INVALID_OFPORT.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"03ef5ee470c11c04b17802d4ab0d60ac4e59f639","unresolved":false,"context_lines":[{"line_number":658,"context_line":"            LOG.error(_LE(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":659,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"},{"line_number":660,"context_line":"            return 0"},{"line_number":661,"context_line":""},{"line_number":662,"context_line":"        self.tun_ofports[tunnel_type][remote_ip] \u003d ofport"},{"line_number":663,"context_line":"        br.check_in_port_add_tunnel_port(tunnel_type, ofport)"},{"line_number":664,"context_line":"        return ofport"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_8a58198b","line":661,"updated":"2014-12-24 05:32:44.000000000","message":"please don\u0027t remove integer conversion.  the integer value is used below.","commit_id":"09108e05af59c9c19ea68e25516c9e94507cb375"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"ed6948b1bebccf5ec16eaaef3c447bfd72352210","unresolved":false,"context_lines":[{"line_number":658,"context_line":"            LOG.error(_LE(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":659,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"},{"line_number":660,"context_line":"            return 0"},{"line_number":661,"context_line":""},{"line_number":662,"context_line":"        self.tun_ofports[tunnel_type][remote_ip] \u003d ofport"},{"line_number":663,"context_line":"        br.check_in_port_add_tunnel_port(tunnel_type, ofport)"},{"line_number":664,"context_line":"        return ofport"}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_a5a41ba6","line":661,"in_reply_to":"3a961159_8a58198b","updated":"2014-12-24 15:38:28.000000000","message":"Oops. Good catch. As part of my ovsdb stuff, I think i\u0027m going to try to fix it so that the correct types are actually returned to begin with instead of having numbers as strings, etc.\n\nDone.","commit_id":"09108e05af59c9c19ea68e25516c9e94507cb375"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c7036ea18c2ae573695296d55edb8d518ed374b9","unresolved":false,"context_lines":[{"line_number":654,"context_line":"                                        tunnel_type,"},{"line_number":655,"context_line":"                                        self.vxlan_udp_port,"},{"line_number":656,"context_line":"                                        self.dont_fragment))"},{"line_number":657,"context_line":"        if ofport \u003d\u003d constants.OFPORT_INVALID:"},{"line_number":658,"context_line":"            LOG.error(_LE(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":659,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"},{"line_number":660,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_d6e0d8ce","line":657,"updated":"2014-12-29 06:03:23.000000000","message":"Technically, add_tunnel_port() returns ovs_lib.INVALID_OFPORT and the fact that constants.OFPORT_INVALID \u003d\u003d int(ovs_lib.INVALID_OFPORT) is not enforced, just \"intended\". I suspect the two constants should be consolidated, but I guess that is out of the scope of this patch.\n\nFor this patch I would prefer to see ofport checked against ovs_lib.INVALID_OFPORT before it is converted to int.","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0c93188ede3c32b1ccc5dfa406b7d1069b09b755","unresolved":false,"context_lines":[{"line_number":654,"context_line":"                                        tunnel_type,"},{"line_number":655,"context_line":"                                        self.vxlan_udp_port,"},{"line_number":656,"context_line":"                                        self.dont_fragment))"},{"line_number":657,"context_line":"        if ofport \u003d\u003d constants.OFPORT_INVALID:"},{"line_number":658,"context_line":"            LOG.error(_LE(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":659,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"},{"line_number":660,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":35,"id":"3a961159_61ef55ea","line":657,"in_reply_to":"3a961159_d6e0d8ce","updated":"2014-12-29 17:55:28.000000000","message":"Done","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"}],"neutron/plugins/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"60d431a261e696f8f1d323bd1e8ea95b2f0fed2e","unresolved":false,"context_lines":[{"line_number":1068,"context_line":"        if ofport \u003d\u003d constants.INVALID_OFPORT:"},{"line_number":1069,"context_line":"            LOG.error(_(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":1070,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"},{"line_number":1071,"context_line":"            return 0"},{"line_number":1072,"context_line":""},{"line_number":1073,"context_line":"        self.tun_br_ofports[tunnel_type][remote_ip] \u003d ofport"},{"line_number":1074,"context_line":"        # Add flow in default table to resubmit to the right"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_862284a1","line":1071,"updated":"2014-07-17 10:02:33.000000000","message":"This is weird. I think better would be to return constants.INVALID_OFPORT and changing condition accordingly on L347. But this change would be probably out of scope of this patch and fix could be in different patch.","commit_id":"174c18b69d9e4c34b1ad236dcefa303cad357efe"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"e92cd5cd26183f9986c4136f55d767c6108d2dba","unresolved":false,"context_lines":[{"line_number":1068,"context_line":"        if ofport \u003d\u003d constants.INVALID_OFPORT:"},{"line_number":1069,"context_line":"            LOG.error(_(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":1070,"context_line":"                      {\u0027type\u0027: tunnel_type, \u0027ip\u0027: remote_ip})"},{"line_number":1071,"context_line":"            return 0"},{"line_number":1072,"context_line":""},{"line_number":1073,"context_line":"        self.tun_br_ofports[tunnel_type][remote_ip] \u003d ofport"},{"line_number":1074,"context_line":"        # Add flow in default table to resubmit to the right"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_68b8d6c7","line":1071,"in_reply_to":"baada198_862284a1","updated":"2014-07-31 14:24:26.000000000","message":"I agree. I tried to avoid making any logic changes in the agents with this version of the patch.","commit_id":"174c18b69d9e4c34b1ad236dcefa303cad357efe"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":762,"context_line":"        if ovs_lib.INVALID_OFPORT in (self.patch_tun_ofport,"},{"line_number":763,"context_line":"                                      self.patch_int_ofport):"},{"line_number":764,"context_line":"            LOG.error(_LE(\"Failed to create OVS patch port. Cannot have \""},{"line_number":765,"context_line":"                          \"tunneling enabled on this agent, since this version\""},{"line_number":766,"context_line":"                          \" of OVS does not support tunnels or patch ports. \""},{"line_number":767,"context_line":"                          \"Agent terminated!\"))"},{"line_number":768,"context_line":"            exit(1)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_ecee5cb4","line":765,"updated":"2014-12-21 06:46:59.000000000","message":"(an exceptionally pointless nit) The convention appears to be having spaces as suffixes rather than prefixes.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":762,"context_line":"        if ovs_lib.INVALID_OFPORT in (self.patch_tun_ofport,"},{"line_number":763,"context_line":"                                      self.patch_int_ofport):"},{"line_number":764,"context_line":"            LOG.error(_LE(\"Failed to create OVS patch port. Cannot have \""},{"line_number":765,"context_line":"                          \"tunneling enabled on this agent, since this version\""},{"line_number":766,"context_line":"                          \" of OVS does not support tunnels or patch ports. \""},{"line_number":767,"context_line":"                          \"Agent terminated!\"))"},{"line_number":768,"context_line":"            exit(1)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_e98ab519","line":765,"in_reply_to":"3a961159_ecee5cb4","updated":"2014-12-22 18:44:01.000000000","message":"Done","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"0d35e7fc4758226b68776d4a3efcfddaeece406b","unresolved":false,"context_lines":[{"line_number":764,"context_line":"            LOG.error(_LE(\"Failed to create OVS patch port. Cannot have \""},{"line_number":765,"context_line":"                          \"tunneling enabled on this agent, since this \""},{"line_number":766,"context_line":"                          \"version of OVS does not support tunnels or patch \""},{"line_number":767,"context_line":"                          \"ports. Agent terminated!\"))"},{"line_number":768,"context_line":"            exit(1)"},{"line_number":769,"context_line":"        self.tun_br.remove_all_flows()"},{"line_number":770,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"3a961159_dc87605f","line":767,"updated":"2014-12-23 14:50:19.000000000","message":"This error message is interesting, because given it\u0027s almost 2015, I\u0027d be surprised if anyone anywhere was running a version of OVS which didn\u0027t support tunnels or patch ports.","commit_id":"09108e05af59c9c19ea68e25516c9e94507cb375"}],"neutron/tests/unit/agent/linux/test_ovs_lib.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32061a2e4bfdb8b50923edaf2b7cfee51c16f06c","unresolved":false,"context_lines":[{"line_number":322,"context_line":"    def _test_get_port_ofport(self, ofport, expected_result):"},{"line_number":323,"context_line":"        pname \u003d \"tap99\""},{"line_number":324,"context_line":"        self.execute.return_value \u003d ofport"},{"line_number":325,"context_line":"        try:"},{"line_number":326,"context_line":"            int(ofport)"},{"line_number":327,"context_line":"            self.assertEqual(self.br.get_port_ofport(pname), expected_result)"},{"line_number":328,"context_line":"        except (ValueError, TypeError):"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_fd58a68b","line":325,"updated":"2014-07-14 22:06:18.000000000","message":"This helper method should probably be refactored to handle the possibility of a value returned or an exception being raised (e.g. expected_result and expected_exception in the parameter list) rather than using assertRaises directly.  Otherwise an exception prevents the call assertion from being tested if RetryLimitError is raised.","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"11ce159719a3bf96bc3eb2d8bf4506a139b3a725","unresolved":false,"context_lines":[{"line_number":322,"context_line":"    def _test_get_port_ofport(self, ofport, expected_result):"},{"line_number":323,"context_line":"        pname \u003d \"tap99\""},{"line_number":324,"context_line":"        self.execute.return_value \u003d ofport"},{"line_number":325,"context_line":"        try:"},{"line_number":326,"context_line":"            int(ofport)"},{"line_number":327,"context_line":"            self.assertEqual(self.br.get_port_ofport(pname), expected_result)"},{"line_number":328,"context_line":"        except (ValueError, TypeError):"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_94b04344","line":325,"in_reply_to":"baada198_fd58a68b","updated":"2014-07-15 15:06:51.000000000","message":"Yeah, this felt ugly as I was doing it. I\u0027ll refactor it.","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2b2806f27ba10959fc61519cc07f5b07f2d5a302","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    def test_get_port_ofport_raises_on_unassigned_ofport(self):"},{"line_number":339,"context_line":"        self._test_get_port_ofport(\"[]\", None, exceptions.RetryLimitError)"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"    def test_get_port_ofport_rasies_on_empty_string(self):"},{"line_number":342,"context_line":"        self._test_get_port_ofport(\"\", None, exceptions.RetryLimitError)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"    def test_get_port_ofport_raises_on_none(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_6973b14f","line":341,"updated":"2014-08-13 11:20:30.000000000","message":"nit: rasies-\u003eraises","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"9f0acfd99bb4c688498e5eb8f8dd923c843a9b82","unresolved":false,"context_lines":[{"line_number":338,"context_line":"    def test_get_port_ofport_raises_on_unassigned_ofport(self):"},{"line_number":339,"context_line":"        self._test_get_port_ofport(\"[]\", None, exceptions.RetryLimitError)"},{"line_number":340,"context_line":""},{"line_number":341,"context_line":"    def test_get_port_ofport_rasies_on_empty_string(self):"},{"line_number":342,"context_line":"        self._test_get_port_ofport(\"\", None, exceptions.RetryLimitError)"},{"line_number":343,"context_line":""},{"line_number":344,"context_line":"    def test_get_port_ofport_raises_on_none(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7ac7a964_7f5f0373","line":341,"in_reply_to":"baada198_6973b14f","updated":"2014-08-13 22:56:27.000000000","message":"oops!","commit_id":"d99fbdc75d131fb11b90999b7f07f799b4cdc250"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":372,"context_line":"        self._set_timeout(0)  # Don\u0027t waste precious time retrying"},{"line_number":373,"context_line":"        self.execute.return_value \u003d ofport"},{"line_number":374,"context_line":"        self.assertEqual(self.br.get_port_ofport(pname), expected_result)"},{"line_number":375,"context_line":"        self.execute.assert_called_with("},{"line_number":376,"context_line":"            [\"ovs-vsctl\", self.TO, \"get\", \"Interface\", pname, \"ofport\"],"},{"line_number":377,"context_line":"            root_helper\u003dself.root_helper)"},{"line_number":378,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_2c2ce401","line":375,"updated":"2014-12-21 06:46:59.000000000","message":"(No action required) validating behavior, lovely :/  Can\u0027t wait for you to replace this crap with their functional betters.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        self._test_get_port_ofport(None, ovs_lib.INVALID_OFPORT)"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    def test_get_port_ofport_returns_invalid_for_invalid(self):"},{"line_number":389,"context_line":"        self._test_get_port_ofport(\"-1\", ovs_lib.INVALID_OFPORT)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def test_get_datapath_id(self):"},{"line_number":392,"context_line":"        datapath_id \u003d \u0027\"0000b67f4fbcc149\"\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_0c1ac8c5","line":389,"updated":"2014-12-21 06:46:59.000000000","message":"I\u0027m a bit confused as to why one arg is literal and the other a constant but they have the same value.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":386,"context_line":"        self._test_get_port_ofport(None, ovs_lib.INVALID_OFPORT)"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    def test_get_port_ofport_returns_invalid_for_invalid(self):"},{"line_number":389,"context_line":"        self._test_get_port_ofport(\"-1\", ovs_lib.INVALID_OFPORT)"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def test_get_datapath_id(self):"},{"line_number":392,"context_line":"        datapath_id \u003d \u0027\"0000b67f4fbcc149\"\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_89793131","line":389,"in_reply_to":"3a961159_0c1ac8c5","updated":"2014-12-22 18:44:01.000000000","message":"Because it made it fit on a single line? I don\u0027t know! :p Done.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"}],"neutron/tests/unit/ofagent/test_ofa_neutron_agent.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                _(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":755,"context_line":"                {\u0027type\u0027: p_const.TYPE_GRE, \u0027ip\u0027: \u0027remote_ip\u0027})"},{"line_number":756,"context_line":"            self.assertEqual(ofport, 0)"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"    def test_tunnel_sync(self):"},{"line_number":759,"context_line":"        self.agent.local_ip \u003d \u0027agent_ip\u0027"},{"line_number":760,"context_line":"        self.agent.context \u003d \u0027fake_context\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_cc236003","line":757,"updated":"2014-12-21 06:46:59.000000000","message":"As much as I appreciate your distaste for coverage for its own sake, might some state verification be in order?\n\ndef test_setup_tunnel_port_returns_zero_for_failed_port_add(self):\n  with mock.patch.object(self.agent.int_br, \u0027add_tunnel_port\u0027, return_value\u003dovs_lib.INVALID_OFPORT):\n    result \u003d self.agent.setup_tunnel_port(*args)\n  self.assertEqual(0, result) \n\nHopefully this is simple enough for you to be able to hold your nose and just do it (tm)?","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"f25d11675b383ac280a52e1978a5268c94add7e6","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                _(\"Failed to set-up %(type)s tunnel port to %(ip)s\"),"},{"line_number":755,"context_line":"                {\u0027type\u0027: p_const.TYPE_GRE, \u0027ip\u0027: \u0027remote_ip\u0027})"},{"line_number":756,"context_line":"            self.assertEqual(ofport, 0)"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"    def test_tunnel_sync(self):"},{"line_number":759,"context_line":"        self.agent.local_ip \u003d \u0027agent_ip\u0027"},{"line_number":760,"context_line":"        self.agent.context \u003d \u0027fake_context\u0027"}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_1b3d848f","line":757,"in_reply_to":"3a961159_cc236003","updated":"2014-12-22 18:44:01.000000000","message":"That\u0027s fine. I just removed the test here because it is now impossible for get_port_ofport to return something not int()-able, so mocking it to return something it can\u0027t seemed silly. I agree that your test looks like a better solution.\n\nDone.","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"}],"neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"8dc44a893fd578a4bca44344e64d2948226bfe74","unresolved":false,"context_lines":[{"line_number":1330,"context_line":"        ) as (add_tunnel_port_fn, log_error_fn):"},{"line_number":1331,"context_line":"            ofport \u003d self.agent._setup_tunnel_port("},{"line_number":1332,"context_line":"                self.agent.tun_br, \u0027gre-1\u0027, \u0027remote_ip\u0027, p_const.TYPE_GRE)"},{"line_number":1333,"context_line":"            add_tunnel_port_fn.assert_called_once_with("},{"line_number":1334,"context_line":"                \u0027gre-1\u0027, \u0027remote_ip\u0027, self.agent.local_ip, p_const.TYPE_GRE,"},{"line_number":1335,"context_line":"                self.agent.vxlan_udp_port, self.agent.dont_fragment)"},{"line_number":1336,"context_line":"            log_error_fn.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":32,"id":"3a961159_0c43a8af","line":1333,"updated":"2014-12-21 06:46:59.000000000","message":"(No action required) Ugh.  More behavior validation.  For those following along at home, please don\u0027t do this mmmkay?","commit_id":"3c238107ceaa3ea66d167ac9fbaebe82de6b51be"}],"neutron/tests/unit/test_common_utils.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"32061a2e4bfdb8b50923edaf2b7cfee51c16f06c","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        self.assertEqual(expected, output_tuple)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"class TestRetry(base.BaseTestCase):"},{"line_number":387,"context_line":"    @utils.retry(until\u003dlambda x: int(x) \u003d\u003d 1, tries\u003d3)"},{"line_number":388,"context_line":"    def _pop_vals(self, vals):"},{"line_number":389,"context_line":"        return vals.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_98989876","line":386,"updated":"2014-07-14 22:06:18.000000000","message":"Missing testing of delay?","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"11ce159719a3bf96bc3eb2d8bf4506a139b3a725","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        self.assertEqual(expected, output_tuple)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"class TestRetry(base.BaseTestCase):"},{"line_number":387,"context_line":"    @utils.retry(until\u003dlambda x: int(x) \u003d\u003d 1, tries\u003d3)"},{"line_number":388,"context_line":"    def _pop_vals(self, vals):"},{"line_number":389,"context_line":"        return vals.pop(0)"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_d4f9db4e","line":386,"in_reply_to":"baada198_98989876","updated":"2014-07-15 15:06:51.000000000","message":"It goes against my idealogical distaste for unit tests that contain any testing of implementation details with mock, but I suppose it is unlikely that someone will implement their own sleep() function. :p","commit_id":"679ed1d01be5f43c4bebf993e9a18395e4774c5e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7bfbce61b6c0c6a05c12028ab05b4287a21c97d7","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        self.assertEqual(expected, output_tuple)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"class TestRetry(base.BaseTestCase):"},{"line_number":387,"context_line":"    @utils.retry(until\u003dlambda x: int(x) \u003d\u003d 1, tries\u003d3, delay\u003d0)"},{"line_number":388,"context_line":"    def _pop_vals(self, vals):"},{"line_number":389,"context_line":"        return vals.pop(0)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_4115089a","line":386,"updated":"2014-07-15 17:17:03.000000000","message":"Test where \u0027until\u0027 raises exception should be probably added too.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"5f1baae3fdd549d34355c43ae7f5051e4ec6dfe8","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        self.assertEqual(expected, output_tuple)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"class TestRetry(base.BaseTestCase):"},{"line_number":387,"context_line":"    @utils.retry(until\u003dlambda x: int(x) \u003d\u003d 1, tries\u003d3, delay\u003d0)"},{"line_number":388,"context_line":"    def _pop_vals(self, vals):"},{"line_number":389,"context_line":"        return vals.pop(0)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_c74e88c2","line":386,"in_reply_to":"baada198_0ce0a795","updated":"2014-07-15 18:08:00.000000000","message":"Ah, I see. Sorry and thanks for explanation.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"8b5e6aba2b1a740bc7e34a8144aad9584c9d3659","unresolved":false,"context_lines":[{"line_number":383,"context_line":"        self.assertEqual(expected, output_tuple)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"class TestRetry(base.BaseTestCase):"},{"line_number":387,"context_line":"    @utils.retry(until\u003dlambda x: int(x) \u003d\u003d 1, tries\u003d3, delay\u003d0)"},{"line_number":388,"context_line":"    def _pop_vals(self, vals):"},{"line_number":389,"context_line":"        return vals.pop(0)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_0ce0a795","line":386,"in_reply_to":"baada198_4115089a","updated":"2014-07-15 17:45:03.000000000","message":"That\u0027s what test_raises_on_until_raising() does below. int(\"X\") -\u003e raise.","commit_id":"9b9c4b10342be699fb4b5fb08da6731e94e5e604"}],"requirements.txt":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"c7036ea18c2ae573695296d55edb8d518ed374b9","unresolved":false,"context_lines":[{"line_number":15,"context_line":"keystonemiddleware\u003e\u003d1.0.0"},{"line_number":16,"context_line":"netaddr\u003e\u003d0.7.12"},{"line_number":17,"context_line":"python-neutronclient\u003e\u003d2.3.6,\u003c3"},{"line_number":18,"context_line":"retrying\u003e\u003d1.2.3,!\u003d1.3.0"},{"line_number":19,"context_line":"SQLAlchemy\u003e\u003d0.9.7,\u003c\u003d0.9.99"},{"line_number":20,"context_line":"WebOb\u003e\u003d1.2.3"},{"line_number":21,"context_line":"python-keystoneclient\u003e\u003d0.11.1"}],"source_content_type":"text/plain","patch_set":35,"id":"3a961159_7618041f","line":18,"updated":"2014-12-29 06:03:23.000000000","message":"I am pretty sure you need to copy this verbatim from global-requirements, where it reads:\n\nretrying\u003e\u003d1.2.3,!\u003d1.3.0 # Apache-2.0\n\n(In other words, you need to include the licence comment.)","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"0c93188ede3c32b1ccc5dfa406b7d1069b09b755","unresolved":false,"context_lines":[{"line_number":15,"context_line":"keystonemiddleware\u003e\u003d1.0.0"},{"line_number":16,"context_line":"netaddr\u003e\u003d0.7.12"},{"line_number":17,"context_line":"python-neutronclient\u003e\u003d2.3.6,\u003c3"},{"line_number":18,"context_line":"retrying\u003e\u003d1.2.3,!\u003d1.3.0"},{"line_number":19,"context_line":"SQLAlchemy\u003e\u003d0.9.7,\u003c\u003d0.9.99"},{"line_number":20,"context_line":"WebOb\u003e\u003d1.2.3"},{"line_number":21,"context_line":"python-keystoneclient\u003e\u003d0.11.1"}],"source_content_type":"text/plain","patch_set":35,"id":"3a961159_a1e77d45","line":18,"in_reply_to":"3a961159_7618041f","updated":"2014-12-29 17:55:28.000000000","message":"Done","commit_id":"75886e085c52272619ba63ad28f92cd5e91ee45a"}]}
