)]}'
{"openstack_dashboard/dashboards/admin/networks/ports/forms.py":[{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"78db0b1bd25c2885ca9bfcb873c3d50dcb6a4480","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            if data.get(\u0027mac_state\u0027):"},{"line_number":190,"context_line":"                params[\u0027mac_learning_enabled\u0027] \u003d data[\u0027mac_state\u0027]"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            if data.get(\u0027port_security_enabled\u0027) is not None:"},{"line_number":193,"context_line":"                params[\u0027port_security_enabled\u0027] \u003d data[\u0027port_security_enabled\u0027]"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"            port \u003d api.neutron.port_create(request, **params)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_72568ad3","line":192,"updated":"2016-11-16 09:29:20.000000000","message":"\"if data.get(\u0027port_security_enabled\u0027):\"\nUse the above sentence would be consistent to the whole code style.","commit_id":"edb6ee87ff1f31706bbeab4a2783213b2ca50e31"},{"author":{"_account_id":12826,"name":"Rob Cresswell","display_name":"robcresswell","email":"robert.cresswell@outlook.com","username":"rob-cresswell"},"change_message_id":"8e4edd560ce0b2e8a72667006d54ca7b615ee00c","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            if data.get(\u0027mac_state\u0027):"},{"line_number":190,"context_line":"                params[\u0027mac_learning_enabled\u0027] \u003d data[\u0027mac_state\u0027]"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            if data.get(\u0027port_security_enabled\u0027) is not None:"},{"line_number":193,"context_line":"                params[\u0027port_security_enabled\u0027] \u003d data[\u0027port_security_enabled\u0027]"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"            port \u003d api.neutron.port_create(request, **params)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_8073cc14","line":192,"in_reply_to":"7a77a97e_72568ad3","updated":"2016-11-16 10:17:05.000000000","message":"@Han Chao: That style would change the function of the code. Port security is enabled by default, so the intent here is to pass it along if it has been set to False. If we just used .get, then the condition would eval to false and not trigger, so it would be impossible to disable port security.\n\nI think what you want is `if port_security_enabled in data` (as you\u0027ve used further on at L240) :)","commit_id":"edb6ee87ff1f31706bbeab4a2783213b2ca50e31"},{"author":{"_account_id":17172,"name":"Kenji Ishii","email":"ken-ishii@sx.jp.nec.com","username":"kenji-ishii"},"change_message_id":"9fc81cbc4f5b1c266717407cca54595febd9a803","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    help_text\u003d_(\"Enable anti-spoofing rules for the port\"),"},{"line_number":148,"context_line":"                    initial\u003dTrue,"},{"line_number":149,"context_line":"                    required\u003dFalse)"},{"line_number":150,"context_line":"        except Exception:"},{"line_number":151,"context_line":"            msg \u003d _(\"Unable to retrieve port security state\")"},{"line_number":152,"context_line":"            exceptions.handle(self.request, msg)"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a74a57a_7c9e9108","line":150,"updated":"2016-11-30 08:23:53.000000000","message":"I think it doesn\u0027t need to throw an exception. This case is just not support that extension, we just hide this field.","commit_id":"3cd6443a5c315ecacc4d92ce706fcfd8ec4c6acd"},{"author":{"_account_id":17172,"name":"Kenji Ishii","email":"ken-ishii@sx.jp.nec.com","username":"kenji-ishii"},"change_message_id":"5fde1fac10041bc3fd1949d3c020520a6324c465","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    help_text\u003d_(\"Enable anti-spoofing rules for the port\"),"},{"line_number":148,"context_line":"                    initial\u003dTrue,"},{"line_number":149,"context_line":"                    required\u003dFalse)"},{"line_number":150,"context_line":"        except Exception:"},{"line_number":151,"context_line":"            msg \u003d _(\"Unable to retrieve port security state\")"},{"line_number":152,"context_line":"            exceptions.handle(self.request, msg)"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"fa31d9ce_49080f2e","line":150,"in_reply_to":"5a74a57a_622a6880","updated":"2017-02-13 00:24:13.000000000","message":"Sorry for replying late, I understood. This code like above around L134-141. I\u0027m not sure whether to need this try-except, anyway I withdraw my vote. Thanks :)","commit_id":"3cd6443a5c315ecacc4d92ce706fcfd8ec4c6acd"},{"author":{"_account_id":18940,"name":"Gyorgy Szombathelyi","email":"gyurco@freemail.hu","username":"gyurco78"},"change_message_id":"87bb754311ee489499c7d7d091b4e0f65fe77b12","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                    help_text\u003d_(\"Enable anti-spoofing rules for the port\"),"},{"line_number":148,"context_line":"                    initial\u003dTrue,"},{"line_number":149,"context_line":"                    required\u003dFalse)"},{"line_number":150,"context_line":"        except Exception:"},{"line_number":151,"context_line":"            msg \u003d _(\"Unable to retrieve port security state\")"},{"line_number":152,"context_line":"            exceptions.handle(self.request, msg)"},{"line_number":153,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5a74a57a_622a6880","line":150,"in_reply_to":"5a74a57a_7c9e9108","updated":"2016-11-30 08:43:27.000000000","message":"The exception is thrown when the query to ask if the extension is supported or not fails.","commit_id":"3cd6443a5c315ecacc4d92ce706fcfd8ec4c6acd"}],"openstack_dashboard/dashboards/admin/networks/ports/tests.py":[{"author":{"_account_id":12826,"name":"Rob Cresswell","display_name":"robcresswell","email":"robert.cresswell@outlook.com","username":"rob-cresswell"},"change_message_id":"8e4edd560ce0b2e8a72667006d54ca7b615ee00c","unresolved":false,"context_lines":[{"line_number":299,"context_line":"            extension_kwargs[\u0027binding__vnic_type\u0027] \u003d port.binding__vnic_type"},{"line_number":300,"context_line":"        if mac_learning:"},{"line_number":301,"context_line":"            extension_kwargs[\u0027mac_learning_enabled\u0027] \u003d True"},{"line_number":302,"context_line":"        if mac_learning:"},{"line_number":303,"context_line":"            extension_kwargs[\u0027port_security_enabled\u0027] \u003d True"},{"line_number":304,"context_line":"        api.neutron.port_create(IsA(http.HttpRequest),"},{"line_number":305,"context_line":"                                tenant_id\u003dnetwork.tenant_id,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_1b149142","line":302,"range":{"start_line":302,"start_character":8,"end_line":302,"end_character":24},"updated":"2016-11-16 10:17:05.000000000","message":"Looks like some over ambitious copy past here.","commit_id":"edb6ee87ff1f31706bbeab4a2783213b2ca50e31"},{"author":{"_account_id":12826,"name":"Rob Cresswell","display_name":"robcresswell","email":"robert.cresswell@outlook.com","username":"rob-cresswell"},"change_message_id":"8e4edd560ce0b2e8a72667006d54ca7b615ee00c","unresolved":false,"context_lines":[{"line_number":410,"context_line":"            extension_kwargs[\u0027binding__vnic_type\u0027] \u003d port.binding__vnic_type"},{"line_number":411,"context_line":"        if mac_learning:"},{"line_number":412,"context_line":"            extension_kwargs[\u0027mac_learning_enabled\u0027] \u003d True"},{"line_number":413,"context_line":"        if mac_learning:"},{"line_number":414,"context_line":"            extension_kwargs[\u0027port_security_enabled\u0027] \u003d True"},{"line_number":415,"context_line":"        api.neutron.port_update(IsA(http.HttpRequest), port.id,"},{"line_number":416,"context_line":"                                name\u003dport.name,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_fba8b5dd","line":413,"range":{"start_line":413,"start_character":11,"end_line":413,"end_character":23},"updated":"2016-11-16 10:17:05.000000000","message":"same again, should be if port_security","commit_id":"edb6ee87ff1f31706bbeab4a2783213b2ca50e31"}],"openstack_dashboard/dashboards/project/networks/ports/forms.py":[{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"cd52e4e2e6d1555b6034ac13d61b57e0e4dc6f83","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                extension_kwargs[\u0027port_security_enabled\u0027] \u003d \\"},{"line_number":105,"context_line":"                    data[\u0027port_security_enabled\u0027]"},{"line_number":106,"context_line":"                if not data[\u0027port_security_enabled\u0027]:"},{"line_number":107,"context_line":"                    extension_kwargs[\u0027security_groups\u0027] \u003d []"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            port \u003d api.neutron.port_update(request,"},{"line_number":110,"context_line":"                                           data[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a77a97e_e971a145","line":107,"updated":"2016-11-17 01:38:44.000000000","message":"It looks reasonable to put the security groups empty if the port security is disabled. However, once the port security is enabled after the disable, will the security groups get updated and be back?","commit_id":"9c7c351835e6ddba6f393333597489113c3df5bb"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"01397ee19b7a72db2092b6c37ae384d9b8c05e6e","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                extension_kwargs[\u0027port_security_enabled\u0027] \u003d \\"},{"line_number":105,"context_line":"                    data[\u0027port_security_enabled\u0027]"},{"line_number":106,"context_line":"                if not data[\u0027port_security_enabled\u0027]:"},{"line_number":107,"context_line":"                    extension_kwargs[\u0027security_groups\u0027] \u003d []"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            port \u003d api.neutron.port_update(request,"},{"line_number":110,"context_line":"                                           data[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a77a97e_b5f7c557","line":107,"in_reply_to":"7a77a97e_57c303ed","updated":"2016-11-18 01:33:03.000000000","message":"Then from my point of view, I suggest remove this two lines (empty the security group). Leave this to the neutron guys and let them fix this. The security groups should not be empty, it only needs to be disabled and not be applied.","commit_id":"9c7c351835e6ddba6f393333597489113c3df5bb"},{"author":{"_account_id":18940,"name":"Gyorgy Szombathelyi","email":"gyurco@freemail.hu","username":"gyurco78"},"change_message_id":"ca065211875f899712ff32d22c818de9583b340c","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                extension_kwargs[\u0027port_security_enabled\u0027] \u003d \\"},{"line_number":105,"context_line":"                    data[\u0027port_security_enabled\u0027]"},{"line_number":106,"context_line":"                if not data[\u0027port_security_enabled\u0027]:"},{"line_number":107,"context_line":"                    extension_kwargs[\u0027security_groups\u0027] \u003d []"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            port \u003d api.neutron.port_update(request,"},{"line_number":110,"context_line":"                                           data[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a77a97e_55bf43a9","line":107,"in_reply_to":"7a77a97e_5d076f81","updated":"2016-11-18 10:04:04.000000000","message":"Because it is impossible to just disable them.","commit_id":"9c7c351835e6ddba6f393333597489113c3df5bb"},{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"5108e35303718af275103124ad1e07d697d98feb","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                extension_kwargs[\u0027port_security_enabled\u0027] \u003d \\"},{"line_number":105,"context_line":"                    data[\u0027port_security_enabled\u0027]"},{"line_number":106,"context_line":"                if not data[\u0027port_security_enabled\u0027]:"},{"line_number":107,"context_line":"                    extension_kwargs[\u0027security_groups\u0027] \u003d []"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            port \u003d api.neutron.port_update(request,"},{"line_number":110,"context_line":"                                           data[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a77a97e_5d076f81","line":107,"in_reply_to":"7a77a97e_6261e6a8","updated":"2016-11-18 08:59:26.000000000","message":"Currently, it seems there is no such API provided in Neutron. However, for this function, it removes all security groups instead of just disabling them.","commit_id":"9c7c351835e6ddba6f393333597489113c3df5bb"},{"author":{"_account_id":18940,"name":"Gyorgy Szombathelyi","email":"gyurco@freemail.hu","username":"gyurco78"},"change_message_id":"b9eca6a5d80526e9f330a12583b3b96bbf4c785b","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                extension_kwargs[\u0027port_security_enabled\u0027] \u003d \\"},{"line_number":105,"context_line":"                    data[\u0027port_security_enabled\u0027]"},{"line_number":106,"context_line":"                if not data[\u0027port_security_enabled\u0027]:"},{"line_number":107,"context_line":"                    extension_kwargs[\u0027security_groups\u0027] \u003d []"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            port \u003d api.neutron.port_update(request,"},{"line_number":110,"context_line":"                                           data[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a77a97e_6261e6a8","line":107,"in_reply_to":"7a77a97e_b5f7c557","updated":"2016-11-18 08:23:45.000000000","message":"And how can you just disable them with the Neutron API?","commit_id":"9c7c351835e6ddba6f393333597489113c3df5bb"},{"author":{"_account_id":18940,"name":"Gyorgy Szombathelyi","email":"gyurco@freemail.hu","username":"gyurco78"},"change_message_id":"0e5963c601fa33a4f26cde3dcad445d30ff59a90","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                extension_kwargs[\u0027port_security_enabled\u0027] \u003d \\"},{"line_number":105,"context_line":"                    data[\u0027port_security_enabled\u0027]"},{"line_number":106,"context_line":"                if not data[\u0027port_security_enabled\u0027]:"},{"line_number":107,"context_line":"                    extension_kwargs[\u0027security_groups\u0027] \u003d []"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"            port \u003d api.neutron.port_update(request,"},{"line_number":110,"context_line":"                                           data[\u0027port_id\u0027],"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a77a97e_57c303ed","line":107,"in_reply_to":"7a77a97e_e971a145","updated":"2016-11-17 09:09:04.000000000","message":"Of course not. The security group info is not preserved in Neutron. I don\u0027t think it can be (or should be) work-arounded in Horizon.","commit_id":"9c7c351835e6ddba6f393333597489113c3df5bb"}],"openstack_dashboard/dashboards/project/networks/ports/views.py":[{"author":{"_account_id":20128,"name":"Han Chao","email":"hanchao7@lenovo.com","username":"HanChao"},"change_message_id":"78db0b1bd25c2885ca9bfcb873c3d50dcb6a4480","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        except Exception:"},{"line_number":158,"context_line":"            # MAC Learning is not set"},{"line_number":159,"context_line":"            pass"},{"line_number":160,"context_line":"        if port.get(\u0027port_security_enabled\u0027) is not None:"},{"line_number":161,"context_line":"            initial[\u0027port_security_enabled\u0027] \u003d port[\u0027port_security_enabled\u0027]"},{"line_number":162,"context_line":"        return initial"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_72ba0a25","line":160,"updated":"2016-11-16 09:29:20.000000000","message":"\"if port.get(\u0027port_security_enabled\u0027):\"\nUse the above sentence would be consistent to the code style.","commit_id":"edb6ee87ff1f31706bbeab4a2783213b2ca50e31"},{"author":{"_account_id":12826,"name":"Rob Cresswell","display_name":"robcresswell","email":"robert.cresswell@outlook.com","username":"rob-cresswell"},"change_message_id":"8e4edd560ce0b2e8a72667006d54ca7b615ee00c","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        except Exception:"},{"line_number":158,"context_line":"            # MAC Learning is not set"},{"line_number":159,"context_line":"            pass"},{"line_number":160,"context_line":"        if port.get(\u0027port_security_enabled\u0027) is not None:"},{"line_number":161,"context_line":"            initial[\u0027port_security_enabled\u0027] \u003d port[\u0027port_security_enabled\u0027]"},{"line_number":162,"context_line":"        return initial"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a77a97e_fbf6f5f7","line":160,"in_reply_to":"7a77a97e_72ba0a25","updated":"2016-11-16 10:17:05.000000000","message":"See my previous comment; I think you want if ... in ...","commit_id":"edb6ee87ff1f31706bbeab4a2783213b2ca50e31"}]}
