)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5f5a311cdcd12f821f2d4ada0bef3e40189ae803","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d83f8897_d628cf99","updated":"2023-05-16 12:13:30.000000000","message":"maybe better to have different names for class and instance vars","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"c3fdd2ef4f84a65a61e2ce584e1ad8c7e7ba42f7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"0354e87a_aaceedb8","updated":"2023-05-17 10:43:59.000000000","message":"That\u0027s a very good catch. Thanks!\n\nOnce merged, please propose patches up to Train: https://review.opendev.org/q/I246c1f56df889bad9c7e140b56c3614124d80a19","commit_id":"a612346146db2f9e70a23af55eb7502655666940"}],"neutron/agent/linux/iptables_manager.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"5f5a311cdcd12f821f2d4ada0bef3e40189ae803","unresolved":true,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"cadc6192_d43998e6","line":308,"updated":"2023-05-16 12:13:30.000000000","message":"did you consider just rename class variable? (like `_random_fully_support`)","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"b36de84b3986c3c8e49e897e7463caea3ee5a520","unresolved":true,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"6ba3a8f1_bddf95b6","line":308,"in_reply_to":"197b1b29_2cb250d2","updated":"2023-05-16 14:46:04.000000000","message":"thanks for clarification, I didn\u0027t realise instance var is gone with this patch, makes sense to state this in the commit message. Also +1 for the comment update you mentioned","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"452d3edd3cf73c359476c8ad975cb84c6ce3597e","unresolved":true,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ec188121_c75d14eb","line":308,"in_reply_to":"2a08b174_da97874c","updated":"2023-05-16 13:36:45.000000000","message":"Hm, not sure I got it, can you please clarify what\u0027s the difference here between class and instance variable _random_fully (and why we need both)?","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":34512,"name":"Alexander Shishebarov","email":"shishebarov.a@selectel.ru","username":"ashishebarov"},"change_message_id":"292b5ccd31129fc47d3ffca1f71274c480455ee4","unresolved":false,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"312b9878_a0878e9e","line":308,"in_reply_to":"39dfedc5_a8817f84","updated":"2023-05-17 11:24:11.000000000","message":"Done","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":34512,"name":"Alexander Shishebarov","email":"shishebarov.a@selectel.ru","username":"ashishebarov"},"change_message_id":"92bc0137d71e0c99b3f9b4bf15fae124890d7d3c","unresolved":true,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"197b1b29_2cb250d2","line":308,"in_reply_to":"5bb6037e_fb5eabec","updated":"2023-05-16 14:29:52.000000000","message":"I got it.\n\nThere is confusing comment\n```\n# Flag to denote iptables supports --random-fully argument\n```\n\nMay be change it to\n\n```\n# Flag to denote iptables --random-fully is enabled.\n```","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":34512,"name":"Alexander Shishebarov","email":"shishebarov.a@selectel.ru","username":"ashishebarov"},"change_message_id":"5474d95e0a0ab77a59436b5eb75a8eb3135fb5b7","unresolved":true,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"39dfedc5_a8817f84","line":308,"in_reply_to":"6ba3a8f1_bddf95b6","updated":"2023-05-17 08:45:47.000000000","message":"Added this information to commit message.\nAlso changed the commentary of _random_fully variable.","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":34512,"name":"Alexander Shishebarov","email":"shishebarov.a@selectel.ru","username":"ashishebarov"},"change_message_id":"54c280c774bb2eab582c3897f3393b0dbd6908fc","unresolved":true,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"2a08b174_da97874c","line":308,"in_reply_to":"cadc6192_d43998e6","updated":"2023-05-16 13:11:28.000000000","message":"Actually this variable indicates that random-fully is supported by iptables and enabled or disabled in configuration of l3 agent.\nin property\n```\n  @property\n  def random_fully\n```\n\nHere\n```\n  self.__class__._random_fully \u003d random_fully_support and \\\n  cfg.CONF.AGENT.use_random_fully\n```\nThis flag _random_fully is set to True or False according to config.\n\nSo I think the flag name `_random_fully` matches what it is used for","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"},{"author":{"_account_id":34512,"name":"Alexander Shishebarov","email":"shishebarov.a@selectel.ru","username":"ashishebarov"},"change_message_id":"b39265d86ef0dc9c59cfca14cb519774b7b7ed36","unresolved":true,"context_lines":[{"line_number":305,"context_line":"    use_table_lock \u003d False"},{"line_number":306,"context_line":""},{"line_number":307,"context_line":"    # Flag to denote iptables supports --random-fully argument"},{"line_number":308,"context_line":"    _random_fully \u003d None"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"    def __init__(self, state_less\u003dFalse, use_ipv6\u003dFalse, nat\u003dTrue,"},{"line_number":311,"context_line":"                 namespace\u003dNone, binary_name\u003dbinary_name, external_lock\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5bb6037e_fb5eabec","line":308,"in_reply_to":"ec188121_c75d14eb","updated":"2023-05-16 14:24:32.000000000","message":"After this change instance variable won\u0027t be created only class variable `_random_fully ` will be used .\n\nProperty `random_fully` will check if class variable `_random_fully` was set or not.\nIf it not set property `random_fully` will check if iptables support random fully or not. Then it will check  config option `use_random_fully` and according to this information update class variable `_random_fully`\n\nThis example how it works.\nWe have next condition \niptables version 1.6.2(random-fully supported)\nin config `use_random_fully` is set to False(disabled usage of random fully in iptables configuration)\n\nExample of call `random_fully` property\n\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l3/router_info.py#L267\n\nFirst instance of IptablesMenager call it first time.\n   1) check that class variable `_random_fully` is not None, it is, go to next step.\n   3) check that iptables support. It is, because version of iptables 1.6.2\n   4) check configuration variables `use_random_fully` it is Fasle.\n   5) set class variable _random_fully to False(because in config it disabled)\n   6) and return False (instance variable does not created)\n   \nSecond instance of IptablesMenager call property `random_fully`\n   1) check that class variable `_random_fully` is not None. It is not becouse it alredy set by first instance .\n   2) Return value of `_random_fully` variable (return False).\n\nAs result we don\u0027t need every time check iptables version and configuration of l3 agent. After first call of `random_fully` property all checks are done.\nAnd no instance variable _random_fully is created only updated value of class variable `_random_fully`.\n\n\nClass variable `_random_fully` used for store result of configuration of l3 agent(option cfg.CONF.AGENT.use_random_fully).\n```\n        random_fully_support \u003d utils.is_version_greater_equal(\n            version, n_const.IPTABLES_RANDOM_FULLY_VERSION)\n\n        self.__class__._random_fully \u003d random_fully_support and \\\n            cfg.CONF.AGENT.use_random_fully\n```","commit_id":"0865890edf8d0055adef0f55ad0d276f277fe2e6"}]}
