)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"817d1e10bf7c468f9de7965de2f55bdc40a48d42","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     gong yong sheng \u003cgong.yongsheng@99cloud.net\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-02 10:02:43 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"prohibit tenant to remove provided not shared policy"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I977feecc6cce378abc1e6092afbaf9f2681b2ec6"},{"line_number":10,"context_line":"Closes-bug: #1486607"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"da20952f_86dca647","line":7,"updated":"2015-09-02 09:45:16.000000000","message":"This isn\u0027t very clear, how about something like\n\nDo not allow tenants to detach admin enforced QoS policies from ports or networks","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"de27a144db9da14021a65d69bfab6b90d54f51fc","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     gong yong sheng \u003cgong.yongsheng@99cloud.net\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-02 10:02:43 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"prohibit tenant to remove provided not shared policy"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I977feecc6cce378abc1e6092afbaf9f2681b2ec6"},{"line_number":10,"context_line":"Closes-bug: #1486607"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"da20952f_d2bed8d3","line":7,"in_reply_to":"da20952f_86dca647","updated":"2015-09-02 11:19:19.000000000","message":"Done","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"e43a78cbb460547b5214196d5c2ee16f4755f746","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Tong Li \u003clitong01@us.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-15 11:18:15 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach admin enforced QoS policies from ports or networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"(this patch set is to help Yongsheng to address a comment regarding the commit msg)"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba15a1d1_122c2701","line":7,"updated":"2015-09-15 15:21:56.000000000","message":"The commit message line length seems too long (it should at most 72 characters)","commit_id":"9e6fcc9ea6b522f93e1234ecd0426cd88fc13c96"},{"author":{"_account_id":16237,"name":"venkatamahesh","email":"venkatamaheshkotha@gmail.com","username":"venkatamahesh"},"change_message_id":"bedd3fadcf2c81d31908795aba106052bb06e4fa","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Tong Li \u003clitong01@us.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-15 11:18:15 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach admin enforced QoS policies from ports or networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"(this patch set is to help Yongsheng to address a comment regarding the commit msg)"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba15a1d1_42564a5d","line":7,"updated":"2015-09-15 17:21:08.000000000","message":"commit title should be \u003c\u003d 50 chars","commit_id":"9e6fcc9ea6b522f93e1234ecd0426cd88fc13c96"},{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"836a924a55d066867de1fac1afa0a1a1300340ce","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Tong Li \u003clitong01@us.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-09-15 11:18:15 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach admin enforced QoS policies from ports or networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"(this patch set is to help Yongsheng to address a comment regarding the commit msg)"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba15a1d1_f2473375","line":7,"in_reply_to":"ba15a1d1_122c2701","updated":"2015-09-15 15:28:36.000000000","message":"It\u0027s desirable to make first line short(50 characters) according with Summary of Git commit message structure in [1]\n\n\n[1]: https://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"9e6fcc9ea6b522f93e1234ecd0426cd88fc13c96"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"e43a78cbb460547b5214196d5c2ee16f4755f746","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach admin enforced QoS policies from ports or networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"(this patch set is to help Yongsheng to address a comment regarding the commit msg)"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I977feecc6cce378abc1e6092afbaf9f2681b2ec6"},{"line_number":12,"context_line":"Closes-bug: #1486607"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba15a1d1_f28653da","line":9,"updated":"2015-09-15 15:21:56.000000000","message":"What does it mean? Is it a WIP change?","commit_id":"9e6fcc9ea6b522f93e1234ecd0426cd88fc13c96"},{"author":{"_account_id":2860,"name":"litong01","email":"email4tong@yahoo.com","username":"litong01"},"change_message_id":"b0d5404dc6f0b5ab5fe24826181590deb52f0c31","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach admin enforced QoS policies from ports or networks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"(this patch set is to help Yongsheng to address a comment regarding the commit msg)"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: I977feecc6cce378abc1e6092afbaf9f2681b2ec6"},{"line_number":12,"context_line":"Closes-bug: #1486607"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"ba15a1d1_972497af","line":9,"in_reply_to":"ba15a1d1_f28653da","updated":"2015-09-15 21:43:52.000000000","message":"Cedric, wanting to help out a bit. not want to take Yongsheng\u0027s credit (talked to him and he is fine that I make this change for the patch set). I will take this out. Thanks.","commit_id":"9e6fcc9ea6b522f93e1234ecd0426cd88fc13c96"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":2,"context_line":"Author:     Tong Li \u003clitong01@us.ibm.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2015-09-15 17:23:42 -0400"},{"line_number":4,"context_line":"Commit:     yong sheng gong \u003cgong.yongsheng@99cloud.net\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-10-16 03:10:33 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"3a29b11f_034e2696","line":5,"updated":"2015-10-20 08:36:21.000000000","message":"We need to correct the commit message, as we discovered, the fact is that tenants are not able to do it, but, from the API the result is OK, and it seems like if they actually could.\n\nThe api returns OK, but the policy is not actually changed.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     yong sheng gong \u003cgong.yongsheng@99cloud.net\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-10-16 03:10:33 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"3a29b11f_a3441274","line":7,"updated":"2015-10-20 08:36:21.000000000","message":"Return an error when tenants try to detach enforced QoS policies.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"},{"line_number":11,"context_line":"doing this."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"3a29b11f_43541e20","line":9,"updated":"2015-10-20 08:36:21.000000000","message":"can detach -\u003e seems like if he could detach","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"},{"line_number":11,"context_line":"doing this."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: litong01 \u003clitong01@us.ibm.com\u003e"},{"line_number":14,"context_line":"Co-Authored-By: gong yong sheng \u003cgong.yongsheng@99cloud.net\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"3a29b11f_0335c6f5","line":11,"updated":"2015-10-20 08:36:21.000000000","message":". This change will provide a meaningful error when tenant tries to do such thing.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"42e6f54f18c1e96cab37dfddbfbb7ab9df2f08d6","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Nate Johnston \u003cnate_johnston@cable.comcast.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-04-08 09:16:26 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"7a1b2928_baadad33","line":7,"updated":"2016-04-11 14:11:15.000000000","message":"I\u0027d better name it:\n\nRespond negatively to tenant detachment of enforced QoS policies\n\n(since it only seems like they were able to do it, but they are not able to do it in fact).","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"91d6cd82d17a9b14e0b62d38ae7d54e69ea65c25","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Nate Johnston \u003cnate_johnston@cable.comcast.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-04-08 09:16:26 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"5a18252c_b84bec2a","line":7,"in_reply_to":"7a1b2928_baadad33","updated":"2016-04-12 15:46:11.000000000","message":"Done","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"42e6f54f18c1e96cab37dfddbfbb7ab9df2f08d6","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"},{"line_number":11,"context_line":"doing this."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"7a1b2928_5a63b91a","line":9,"updated":"2016-04-11 14:11:15.000000000","message":"Currently the tenant seem like if it was able to detach enforced QoS policies....","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"91d6cd82d17a9b14e0b62d38ae7d54e69ea65c25","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"},{"line_number":11,"context_line":"doing this."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"5a18252c_f85564c6","line":9,"in_reply_to":"7a1b2928_5a63b91a","updated":"2016-04-12 15:46:11.000000000","message":"Done","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"42e6f54f18c1e96cab37dfddbfbb7ab9df2f08d6","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"},{"line_number":11,"context_line":"doing this."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: litong01 \u003clitong01@us.ibm.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"7a1b2928_1a82e194","line":10,"updated":"2016-04-11 14:11:15.000000000","message":"This change will fix the API response.","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"91d6cd82d17a9b14e0b62d38ae7d54e69ea65c25","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Do not allow tenants to detach enforced QoS policies"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the tenant can detach enforced QoS policies for ports"},{"line_number":10,"context_line":"or networks set by admin. This change will prevent tenant from"},{"line_number":11,"context_line":"doing this."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Co-Authored-By: litong01 \u003clitong01@us.ibm.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"5a18252c_d85228dd","line":10,"in_reply_to":"7a1b2928_1a82e194","updated":"2016-04-12 15:46:11.000000000","message":"Done","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"}],"neutron/common/exceptions.py":[{"author":{"_account_id":7715,"name":"Hirofumi Ichihara","email":"ichihara.hirofumi@gmail.com","username":"Hirofumi-Ichihara"},"change_message_id":"5a5e4f86bdd6393f5771deaa4158a4a72dc5887b","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"class PolicyProvidedError(NeutronException):"},{"line_number":137,"context_line":"    message \u003d _(\"Failed to remove provided policy\")"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"class StateInvalid(BadRequest):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_8fa4b257","line":137,"updated":"2015-08-27 14:13:47.000000000","message":"I feel strange \"PolicyProvidedError\" a little. It means that neutron failed to provide policy. How about \"PolicyRemoveError\"?","commit_id":"bf0d009ef1d47122fdfb68aaf19a81ac82d4b4c8"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"edd04a65e188825b916eac0978900e052815c64a","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"class PolicyProvidedError(NeutronException):"},{"line_number":137,"context_line":"    message \u003d _(\"Failed to remove provided policy\")"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"class StateInvalid(BadRequest):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_5d3e2fb9","line":137,"in_reply_to":"da20952f_8fa4b257","updated":"2015-08-28 05:42:50.000000000","message":"Done","commit_id":"bf0d009ef1d47122fdfb68aaf19a81ac82d4b4c8"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    message \u003d _(\"Failed to check policy %(policy)s because %(reason)s\")"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"class PolicyRemoveError(NeutronException):"},{"line_number":137,"context_line":"    message \u003d _(\"Failed to remove provided policy\")"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_3d41fba9","line":136,"updated":"2015-08-28 06:23:31.000000000","message":"I\u0027d subclass NotAuthorized that renders to a more correct HTTP response code.","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":133,"context_line":"    message \u003d _(\"Failed to check policy %(policy)s because %(reason)s\")"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"class PolicyRemoveError(NeutronException):"},{"line_number":137,"context_line":"    message \u003d _(\"Failed to remove provided policy\")"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_00836c99","line":136,"in_reply_to":"da20952f_3d41fba9","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"1251d95292dec24eb840c9075a980fb703062808","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"class PolicyRemoveError(NotAuthorized):"},{"line_number":137,"context_line":"    message \u003d _(\"Failed to remove provided policy\")"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"class StateInvalid(BadRequest):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_02d75024","line":137,"updated":"2015-09-01 14:52:21.000000000","message":"This doesn\u0027t carry any useful information. Can you add policy to the message? It aids debugging.","commit_id":"d0e3acd31d3ce794135f78844aae71493196e578"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"083d449ff4d7a99a3573ea2edd3850832858f24d","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"class PolicyRemoveError(NotAuthorized):"},{"line_number":137,"context_line":"    message \u003d _(\"Failed to remove provided policy\")"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"class StateInvalid(BadRequest):"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_38e629e9","line":137,"in_reply_to":"da20952f_02d75024","updated":"2015-09-02 01:33:13.000000000","message":"done","commit_id":"d0e3acd31d3ce794135f78844aae71493196e578"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"ab831593c2a0f32a26f89e21a922d5149e51528d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    message \u003d _(\"Failed to check policy %(policy)s because %(reason)s.\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class PolicyRemoveError(e.NotAuthorized):"},{"line_number":60,"context_line":"    message \u003d _(\"Failed to remove provided policy %(policy_id)s\")"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_f7855859","line":59,"updated":"2016-04-13 06:01:16.000000000","message":"I think PolicyRemoveAuthorizationError is more suitable.\nProbably the message should indicate the authorization error as well","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"674cd2ff50f9734d42f784d9297b0aee76962ddc","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    message \u003d _(\"Failed to check policy %(policy)s because %(reason)s.\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class PolicyRemoveError(e.NotAuthorized):"},{"line_number":60,"context_line":"    message \u003d _(\"Failed to remove provided policy %(policy_id)s\")"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_1f0626ce","line":59,"in_reply_to":"5a18252c_f7855859","updated":"2016-04-13 08:14:03.000000000","message":"+1 good suggestion.","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"7c8ea00019a8af4814c01f283aa4627191d23da9","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    message \u003d _(\"Failed to check policy %(policy)s because %(reason)s.\")"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"class PolicyRemoveError(e.NotAuthorized):"},{"line_number":60,"context_line":"    message \u003d _(\"Failed to remove provided policy %(policy_id)s\")"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_595a5a50","line":59,"in_reply_to":"5a18252c_f7855859","updated":"2016-04-13 17:42:42.000000000","message":"Done","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"}],"neutron/core_extensions/qos.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            raise n_exc.QosPolicyNotFound(policy_id\u003dpolicy_id)"},{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_80277c63","line":40,"updated":"2015-08-28 06:23:31.000000000","message":"Could we add some docstring explaining the reasoning behind it?\n\n\"\"\"Check if a policy change is allowed on a port/network.\n\nA tenant is not supposed to remove or modify a policy set\non a network or port which doesn\u0027t belong to him. Because\nthat\u0027s something admin is trying to enforce on him.\n\"\"\"","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            raise n_exc.QosPolicyNotFound(policy_id\u003dpolicy_id)"},{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_e0c0b8e2","line":40,"in_reply_to":"da20952f_80277c63","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"1251d95292dec24eb840c9075a980fb703062808","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            raise n_exc.QosPolicyNotFound(policy_id\u003dpolicy_id)"},{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_82912055","line":40,"updated":"2015-09-01 14:52:21.000000000","message":"Can you generalize the name and move it out of the class (it doesn\u0027t really require \u0027self\u0027) ?","commit_id":"d0e3acd31d3ce794135f78844aae71493196e578"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"083d449ff4d7a99a3573ea2edd3850832858f24d","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            raise n_exc.QosPolicyNotFound(policy_id\u003dpolicy_id)"},{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_5802fd70","line":40,"in_reply_to":"da20952f_82912055","updated":"2015-09-02 01:33:13.000000000","message":"I know that, but it is not required by other codes at all. To move it out of the class makes no point.","commit_id":"d0e3acd31d3ce794135f78844aae71493196e578"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6fec88eb0fd2bfcdf71745c99fc3b7c45783e8de","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            return"},{"line_number":44,"context_line":"        raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_06909694","line":41,"updated":"2015-09-02 09:41:51.000000000","message":"pedant-nit: You can save one line if you \"not\" the if statement, and put the raise inside the if.","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":11682,"name":"Ryan Moats","email":"rmoats@us.ibm.com","username":"regXboi"},"change_message_id":"817d1e10bf7c468f9de7965de2f55bdc40a48d42","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            return"},{"line_number":44,"context_line":"        raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_868106fe","line":41,"in_reply_to":"da20952f_06909694","updated":"2015-09-02 09:45:16.000000000","message":"+1 as that is slightly more readable","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"de27a144db9da14021a65d69bfab6b90d54f51fc","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            return"},{"line_number":44,"context_line":"        raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_d2781892","line":41,"in_reply_to":"da20952f_868106fe","updated":"2015-09-02 11:19:19.000000000","message":"Done","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b32084ecba99775e1035fda382999dac2472ff8b","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            raise n_exc.QosPolicyNotFound(policy_id\u003dpolicy_id)"},{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if not (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_9f50d70c","line":40,"updated":"2015-09-17 14:48:35.000000000","message":"I believe you should reuse code from _is_policy_accessible instead of copying it here. But see below.","commit_id":"41fa6517ca3646f0f89efc99a7ac2904606d68dc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7fa80aa85931ef89c07c7a6d659deef4e9e76e59","unresolved":false,"context_lines":[{"line_number":37,"context_line":"            raise n_exc.QosPolicyNotFound(policy_id\u003dpolicy_id)"},{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if not (context.is_admin or old_policy.shared or"},{"line_number":42,"context_line":"            old_policy.tenant_id \u003d\u003d context.tenant_id):"},{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a2fa921_fd490db8","line":40,"in_reply_to":"ba15a1d1_9f50d70c","updated":"2015-10-08 10:37:11.000000000","message":"Done","commit_id":"41fa6517ca3646f0f89efc99a7ac2904606d68dc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"48720c316c17e938c276ff64590939aded4b31e3","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _update_port_policy(self, context, port, port_changes):"},{"line_number":46,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_port_policy("},{"line_number":47,"context_line":"            context, port[\u0027id\u0027])"},{"line_number":48,"context_line":"        if old_policy:"},{"line_number":49,"context_line":"            self._check_policy_change_permission(context, old_policy)"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_04447eb4","line":46,"updated":"2015-09-17 14:44:05.000000000","message":"I have discovered a funny thing, this function above ^ will not return the old_policy if you don\u0027t have permissions to get it, this the detach_port in L50 will never happen.\n\n(The tenant can\u0027t really shake it off)\n\nBut, the result to the user is a normal:\n\n$ neutron port-update 0f810ef2-1b5e-4a76-996f-92133ed9e1fa --no-qos-policy\nUpdated port: 0f810ef2-1b5e-4a76-996f-92133ed9e1fa\n\n\nGiven this the bug report is partly incorrect (sorry, the result was misleading, I found all this by debugging inside the code manually).\n\nThe correct fix (to show a proper exception when trying to do such action), would be to throw an exception on the qos.policy.QosPolicy._is_policy_accessible check which you will find very similar to your check_policy_change_permission.\n\nhttps://github.com/openstack/neutron/blob/master/neutron/objects/qos/policy.py#L80\n\nWe could recapture such exception here, and may be translate into \"PolicyRemoveError\".\n\nlooping @ihar here, but I guess we may defer this to Mitaka to make sure we don\u0027t break other things by changing that behaviour.","commit_id":"41fa6517ca3646f0f89efc99a7ac2904606d68dc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b32084ecba99775e1035fda382999dac2472ff8b","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _update_port_policy(self, context, port, port_changes):"},{"line_number":46,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_port_policy("},{"line_number":47,"context_line":"            context, port[\u0027id\u0027])"},{"line_number":48,"context_line":"        if old_policy:"},{"line_number":49,"context_line":"            self._check_policy_change_permission(context, old_policy)"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_5ff23f07","line":46,"in_reply_to":"ba15a1d1_04447eb4","updated":"2015-09-17 14:48:35.000000000","message":"Agreed. We should raise an exception.","commit_id":"41fa6517ca3646f0f89efc99a7ac2904606d68dc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"7fa80aa85931ef89c07c7a6d659deef4e9e76e59","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _update_port_policy(self, context, port, port_changes):"},{"line_number":46,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_port_policy("},{"line_number":47,"context_line":"            context, port[\u0027id\u0027])"},{"line_number":48,"context_line":"        if old_policy:"},{"line_number":49,"context_line":"            self._check_policy_change_permission(context, old_policy)"}],"source_content_type":"text/x-python","patch_set":14,"id":"7a2fa921_dd4c51ca","line":46,"in_reply_to":"ba15a1d1_04447eb4","updated":"2015-10-08 10:37:11.000000000","message":"Done","commit_id":"41fa6517ca3646f0f89efc99a7ac2904606d68dc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c0c76708a4c7973b41d837f69ddda4257b2b8c94","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _update_port_policy(self, context, port, port_changes):"},{"line_number":46,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_port_policy("},{"line_number":47,"context_line":"            context, port[\u0027id\u0027])"},{"line_number":48,"context_line":"        if old_policy:"},{"line_number":49,"context_line":"            self._check_policy_change_permission(context, old_policy)"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_1a1d47bd","line":46,"in_reply_to":"ba15a1d1_5ff23f07","updated":"2015-09-21 16:26:59.000000000","message":"From API perspective, it\u0027s a bit weird though that we will raise for access denied but not for object not available. Also it\u0027s usually considered a bad habit from security perspective to distinguish between cases of a resource not available and a resource not found since the difference could be used to find a uuid of a qos policy (not sure it\u0027s of any real issue though since you cannot do much with uuid only, and brute force would be enormously hard here; just notin\u0027).","commit_id":"41fa6517ca3646f0f89efc99a7ac2904606d68dc"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"b32084ecba99775e1035fda382999dac2472ff8b","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            context, port[\u0027id\u0027])"},{"line_number":48,"context_line":"        if old_policy:"},{"line_number":49,"context_line":"            self._check_policy_change_permission(context, old_policy)"},{"line_number":50,"context_line":"            old_policy.detach_port(port[\u0027id\u0027])"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        qos_policy_id \u003d port_changes.get(qos_consts.QOS_POLICY_ID)"},{"line_number":53,"context_line":"        if qos_policy_id is not None:"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba15a1d1_dfb88f2c","line":50,"updated":"2015-09-17 14:48:35.000000000","message":"here, you should just raise PolicyNotFound/PolicyNotAvailable or smth if old_policy is None.","commit_id":"41fa6517ca3646f0f89efc99a7ac2904606d68dc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _update_port_policy(self, context, port, port_changes):"},{"line_number":46,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_port_policy("},{"line_number":47,"context_line":"            context.elevated(), port[\u0027id\u0027])"},{"line_number":48,"context_line":"        if old_policy:"},{"line_number":49,"context_line":"            self._check_policy_change_permission(context, old_policy)"},{"line_number":50,"context_line":"            old_policy.detach_port(port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a29b11f_b5c0c57d","line":47,"updated":"2015-10-20 08:36:21.000000000","message":"no, you should not ask for elevated permissions here.\n\nIf you see comments in PS15, we meant, that QoSPolicy.get_port_policy should raise an exception saying that you don\u0027t have access to such policy. \n\nYou can capture such exception here an convert to \"PolicyRemoveError\" for a more user meaningful error.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_port_policy("},{"line_number":47,"context_line":"            context.elevated(), port[\u0027id\u0027])"},{"line_number":48,"context_line":"        if old_policy:"},{"line_number":49,"context_line":"            self._check_policy_change_permission(context, old_policy)"},{"line_number":50,"context_line":"            old_policy.detach_port(port[\u0027id\u0027])"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        qos_policy_id \u003d port_changes.get(qos_consts.QOS_POLICY_ID)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a29b11f_555611d3","line":49,"updated":"2015-10-20 08:36:21.000000000","message":"You should not need to do such check here. Make sure get_port_policy raises exception instead of returning None when trying to access a policy without authorisation.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _update_network_policy(self, context, network, network_changes):"},{"line_number":59,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_network_policy("},{"line_number":60,"context_line":"            context.elevated(), network[\u0027id\u0027])"},{"line_number":61,"context_line":"        if old_policy:"},{"line_number":62,"context_line":"            self._check_policy_change_permission(context, old_policy)"},{"line_number":63,"context_line":"            old_policy.detach_network(network[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a29b11f_7551cdd7","line":60,"updated":"2015-10-20 08:36:21.000000000","message":"ditto.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_network_policy("},{"line_number":60,"context_line":"            context.elevated(), network[\u0027id\u0027])"},{"line_number":61,"context_line":"        if old_policy:"},{"line_number":62,"context_line":"            self._check_policy_change_permission(context, old_policy)"},{"line_number":63,"context_line":"            old_policy.detach_network(network[\u0027id\u0027])"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        qos_policy_id \u003d network_changes.get(qos_consts.QOS_POLICY_ID)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a29b11f_f55b9df4","line":62,"updated":"2015-10-20 08:36:21.000000000","message":"ditto.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"c12293932c560b4e58dde7d7e083bc26332fd982","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        if not policy_object.is_policy_accessible("},{"line_number":42,"context_line":"                context, old_policy):"},{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a1b2928_412625bb","line":41,"range":{"start_line":41,"start_character":29,"end_line":41,"end_character":49},"updated":"2016-04-11 16:39:11.000000000","message":"This should change to is_accessible; see other comment.","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"7c8ea00019a8af4814c01f283aa4627191d23da9","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.core_extensions import base"},{"line_number":18,"context_line":"from neutron.db import api as db_api"},{"line_number":19,"context_line":"from neutron import manager"},{"line_number":20,"context_line":"from neutron.objects import rbac_db"},{"line_number":21,"context_line":"from neutron.objects.qos import policy as policy_object"},{"line_number":22,"context_line":"from neutron.plugins.common import constants as plugin_constants"},{"line_number":23,"context_line":"from neutron.services.qos import qos_consts"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_5ef9ae7f","line":20,"range":{"start_line":20,"start_character":28,"end_line":20,"end_character":35},"updated":"2016-04-13 17:42:42.000000000","message":"This module ended up being unused.","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"3074edc4138d9c9d7401899fba2074ee94511fd9","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from neutron.core_extensions import base"},{"line_number":18,"context_line":"from neutron.db import api as db_api"},{"line_number":19,"context_line":"from neutron import manager"},{"line_number":20,"context_line":"from neutron.objects import rbac_db"},{"line_number":21,"context_line":"from neutron.objects.qos import policy as policy_object"},{"line_number":22,"context_line":"from neutron.plugins.common import constants as plugin_constants"},{"line_number":23,"context_line":"from neutron.services.qos import qos_consts"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_60dbb71b","line":20,"range":{"start_line":20,"start_character":28,"end_line":20,"end_character":35},"in_reply_to":"5a18252c_5ef9ae7f","updated":"2016-04-15 07:59:41.000000000","message":"+1","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"7c8ea00019a8af4814c01f283aa4627191d23da9","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        return obj"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":42,"context_line":"        if not policy_object.QosPolicy.is_accessible(context, old_policy):"},{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _update_port_policy(self, context, port, port_changes):"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_f97366e5","line":42,"range":{"start_line":42,"start_character":39,"end_line":42,"end_character":52},"updated":"2016-04-13 17:42:42.000000000","message":"A policy_object is considered accessible iff the user is an admin or the policy is in the same tenant as the context\u0027s tenant; in other words, is_accessible() ignores the shared property, which this method used to check.  \n\nIs the drop of the check for shared inadvertent?  \n\nFor changes in general, it would seem that all three checks should be made.  For deletes, it would seem that just the admin check should be made.  Did I get that wrong?","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"8e7ee4625e16a0ab3084fbf296806aec2960e008","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        return obj"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":42,"context_line":"        if not policy_object.QosPolicy.is_accessible(context, old_policy):"},{"line_number":43,"context_line":"            raise n_exc.PolicyRemoveError(policy_id\u003dold_policy.id)"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def _update_port_policy(self, context, port, port_changes):"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_923fa8d5","line":42,"range":{"start_line":42,"start_character":39,"end_line":42,"end_character":52},"in_reply_to":"5a18252c_f97366e5","updated":"2016-04-13 18:12:02.000000000","message":"Put another way, earlier iterations of this _check_policy_change_permissions method allowed a policy to be detached from a port if ANY of the following were true:\n\n- context is is_admin\n- the policy to be detached is shared\n- the policy\u0027s tenant is the context\u0027s tenant\n\nI guess I just wanted confirmation that this is what we want.","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"e4110e0a8914c169768fa01788661f34243a9c51","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        #"},{"line_number":48,"context_line":"        # The first and second of these three are reflected in the"},{"line_number":49,"context_line":"        # is_accessible value."},{"line_number":50,"context_line":"        if not (policy_object.QosPolicy.is_accessible(context, old_policy) or"},{"line_number":51,"context_line":"                old_policy.shared):"},{"line_number":52,"context_line":"            raise n_exc.PolicyRemoveAuthorizationError(policy_id\u003dold_policy.id)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"1a122d0e_1a213dfc","line":50,"updated":"2016-04-15 21:46:26.000000000","message":"I think is_accessible already considers .shared, the latter check is probably unneeded?","commit_id":"3a5adb80180641d2fc51afda1080295bbcb8cad7"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"9d8c673f2ef649dc5d1417a397277c99a493b4b2","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        #"},{"line_number":48,"context_line":"        # The first and second of these three are reflected in the"},{"line_number":49,"context_line":"        # is_accessible value."},{"line_number":50,"context_line":"        if not (policy_object.QosPolicy.is_accessible(context, old_policy) or"},{"line_number":51,"context_line":"                old_policy.shared):"},{"line_number":52,"context_line":"            raise n_exc.PolicyRemoveAuthorizationError(policy_id\u003dold_policy.id)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"1a122d0e_a6991471","line":50,"in_reply_to":"1a122d0e_1a213dfc","updated":"2016-04-16 02:14:57.000000000","message":"Nope--maybe is_accessible needs to be changed?\n\n        def is_accessible(cls, context, db_obj):\n            return (context.is_admin or\n                    context.tenant_id \u003d\u003d db_obj.tenant_id)","commit_id":"3a5adb80180641d2fc51afda1080295bbcb8cad7"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"3d0935b813a687d41054ad82d925d6ba5cab7e1c","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        # An existing policy can be modified only if one of the following is"},{"line_number":42,"context_line":"        # true:"},{"line_number":43,"context_line":"        #"},{"line_number":44,"context_line":"        #       the policy\u0027s tenant is the context\u0027s tenant"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_97483689","line":41,"updated":"2016-04-19 06:14:20.000000000","message":"please consider using docstring","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"fb983a4b31f7245fb8d7913e5c64e182a6a2b34b","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        # An existing policy can be modified only if one of the following is"},{"line_number":42,"context_line":"        # true:"},{"line_number":43,"context_line":"        #"},{"line_number":44,"context_line":"        #       the policy\u0027s tenant is the context\u0027s tenant"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_fa356ba8","line":41,"in_reply_to":"1a122d0e_3fa8d9da","updated":"2016-04-21 20:14:16.000000000","message":"Done","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"58c16a4fe944ec721d35873022a6399a509838ae","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        return obj"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _check_policy_change_permission(self, context, old_policy):"},{"line_number":41,"context_line":"        # An existing policy can be modified only if one of the following is"},{"line_number":42,"context_line":"        # true:"},{"line_number":43,"context_line":"        #"},{"line_number":44,"context_line":"        #       the policy\u0027s tenant is the context\u0027s tenant"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_3fa8d9da","line":41,"in_reply_to":"1a122d0e_97483689","updated":"2016-04-20 07:43:55.000000000","message":"Yes, thanks for catching this.  We\u0027ll also change the comment to reflect Ihar\u0027s point below.","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6b2fd2b1007d54c2b23519b2c9f150a89d2da30a","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        #"},{"line_number":48,"context_line":"        # The first and second of these three are reflected in the"},{"line_number":49,"context_line":"        # is_accessible value."},{"line_number":50,"context_line":"        if not (policy_object.QosPolicy.is_accessible(context, old_policy) or"},{"line_number":51,"context_line":"                old_policy.shared):"},{"line_number":52,"context_line":"            raise n_exc.PolicyRemoveAuthorizationError(policy_id\u003dold_policy.id)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_49f6f5f9","line":50,"updated":"2016-04-19 11:50:25.000000000","message":"Note that qos policy is an RBAC object, so it relies on the following implementation of is_accessible:\n\n    @classmethod\n    def is_accessible(cls, context, db_obj):\n        return (super(\n            RbacNeutronDbObjectMixin, cls).is_accessible(context, db_obj) or\n                cls.is_shared_with_tenant(context, db_obj.id,\n                                          context.tenant_id))\n\nThat\u0027s why I think .shared check is not needed.","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"58c16a4fe944ec721d35873022a6399a509838ae","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        #"},{"line_number":48,"context_line":"        # The first and second of these three are reflected in the"},{"line_number":49,"context_line":"        # is_accessible value."},{"line_number":50,"context_line":"        if not (policy_object.QosPolicy.is_accessible(context, old_policy) or"},{"line_number":51,"context_line":"                old_policy.shared):"},{"line_number":52,"context_line":"            raise n_exc.PolicyRemoveAuthorizationError(policy_id\u003dold_policy.id)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_7f953185","line":50,"in_reply_to":"1a122d0e_49f6f5f9","updated":"2016-04-20 07:43:55.000000000","message":"Ah, yes, I forgot this.  I\u0027m sorry.  We\u0027ll fix.","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"fb983a4b31f7245fb8d7913e5c64e182a6a2b34b","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        #"},{"line_number":48,"context_line":"        # The first and second of these three are reflected in the"},{"line_number":49,"context_line":"        # is_accessible value."},{"line_number":50,"context_line":"        if not (policy_object.QosPolicy.is_accessible(context, old_policy) or"},{"line_number":51,"context_line":"                old_policy.shared):"},{"line_number":52,"context_line":"            raise n_exc.PolicyRemoveAuthorizationError(policy_id\u003dold_policy.id)"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_9aba7709","line":50,"in_reply_to":"1a122d0e_7f953185","updated":"2016-04-21 20:14:16.000000000","message":"Done","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":13252,"name":"Dr. Jens Harbott","display_name":"Jens Harbott (frickler)","email":"frickler@offenerstapel.de","username":"jrosenboom"},"change_message_id":"8de116a3cb841f779018a6f01f63d30acde9267e","unresolved":false,"context_lines":[{"line_number":44,"context_line":"              the policy\u0027s tenant is the context\u0027s tenant"},{"line_number":45,"context_line":"              the policy is shared with the tenant"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        The first and second of these three are reflected in the"},{"line_number":48,"context_line":"        is_accessible value."},{"line_number":49,"context_line":"        \"\"\""},{"line_number":50,"context_line":"        if not (policy_object.QosPolicy.is_accessible(context, old_policy)):"}],"source_content_type":"text/x-python","patch_set":30,"id":"dab17558_eb7b9f79","line":47,"updated":"2016-05-13 14:13:25.000000000","message":"I\u0027m confused, I see only two options above, not three.","commit_id":"3f28a7d31c6d5c7085dcc029455559f437c98fa7"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"c87baac5ce030f357cab0ebc6b060e5403abfaa2","unresolved":false,"context_lines":[{"line_number":44,"context_line":"              the policy\u0027s tenant is the context\u0027s tenant"},{"line_number":45,"context_line":"              the policy is shared with the tenant"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        The first and second of these three are reflected in the"},{"line_number":48,"context_line":"        is_accessible value."},{"line_number":49,"context_line":"        \"\"\""},{"line_number":50,"context_line":"        if not (policy_object.QosPolicy.is_accessible(context, old_policy)):"}],"source_content_type":"text/x-python","patch_set":30,"id":"dab17558_4653c239","line":47,"in_reply_to":"dab17558_eb7b9f79","updated":"2016-05-13 15:53:26.000000000","message":"Ah, that was an artifact of when there was a third condition, which was \"the context is is_admin\" - see PS22 for example.  Fixed.","commit_id":"3f28a7d31c6d5c7085dcc029455559f437c98fa7"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"aea3f76d5a681f4e187f183d4c4002677a2e91a5","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def _update_port_policy(self, context, port, port_changes):"},{"line_number":53,"context_line":"        old_policy \u003d policy_object.QosPolicy.get_port_policy("},{"line_number":54,"context_line":"            context.elevated(), port[\u0027id\u0027])"},{"line_number":55,"context_line":"        if old_policy:"},{"line_number":56,"context_line":"            self._check_policy_change_permission(context, old_policy)"},{"line_number":57,"context_line":"            old_policy.detach_port(port[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":32,"id":"7aa08908_f0acb8ee","line":54,"updated":"2016-06-14 09:15:55.000000000","message":"no action required: this makes me think we could raise exception on get_object and capture it in other places, but would make other logics more complicated, so the total gain would be negative.","commit_id":"4ec6932c93764fd7731928f1faa24b6c88fa9493"}],"neutron/objects/qos/policy.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":24,"context_line":"from neutron.objects.qos import rule as rule_obj_impl"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def is_policy_accessible(context, db_obj):"},{"line_number":28,"context_line":"    #TODO(QoS): Look at I3426b13eede8bfa29729cf3efea3419fb91175c4 for"},{"line_number":29,"context_line":"    #           other possible solutions to this."},{"line_number":30,"context_line":"    return (context.is_admin or"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a29b11f_f5ae3d97","line":27,"updated":"2015-10-20 08:36:21.000000000","message":"Based on the previous comments, you don\u0027t need to make this function accessible from here, I\u0027d leave it where it was originally.","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6786a3861269679dd73842db56848f61a442bb68","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        admin_context \u003d context.elevated()"},{"line_number":92,"context_line":"        with db_api.autonested_transaction(admin_context.session):"},{"line_number":93,"context_line":"            policy_obj \u003d super(QosPolicy, cls).get_by_id(admin_context, id)"},{"line_number":94,"context_line":"            if (not policy_obj or"},{"line_number":95,"context_line":"                not is_policy_accessible(context, policy_obj)):"},{"line_number":96,"context_line":"                return"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3a29b11f_75eeadb5","line":94,"updated":"2015-10-20 08:36:21.000000000","message":"if not policy_obj:\n     return\n\nif not cls._is_policy_accessible(context, policy_obj):\n      raise exceptions.---------- (check what fits best, some sort of unauthorised access should be right).","commit_id":"ba00871c08993f544a310bdb2dc24ffb06037cbe"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"42e6f54f18c1e96cab37dfddbfbb7ab9df2f08d6","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def is_policy_accessible(context, db_obj):"},{"line_number":37,"context_line":"    #TODO(QoS): Look at I3426b13eede8bfa29729cf3efea3419fb91175c4 for"},{"line_number":38,"context_line":"    #           other possible solutions to this."},{"line_number":39,"context_line":"    return (context.is_admin or"},{"line_number":40,"context_line":"            db_obj.shared or"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a1b2928_403c6693","line":37,"updated":"2016-04-11 14:11:15.000000000","message":"I think you can now use the is_accessible method on the policy instead, and remove that L37 here:\n\nhttps://github.com/openstack/neutron/blob/8582373d61bc8d7ceb31a2f1d648f99e799b6270/neutron/objects/rbac_db.py#L65","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"c12293932c560b4e58dde7d7e083bc26332fd982","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"def is_policy_accessible(context, db_obj):"},{"line_number":37,"context_line":"    #TODO(QoS): Look at I3426b13eede8bfa29729cf3efea3419fb91175c4 for"},{"line_number":38,"context_line":"    #           other possible solutions to this."},{"line_number":39,"context_line":"    return (context.is_admin or"},{"line_number":40,"context_line":"            db_obj.shared or"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a1b2928_a110d94f","line":37,"in_reply_to":"7a1b2928_403c6693","updated":"2016-04-11 16:39:11.000000000","message":"That is_accessible is in RbacNeutronDbObjectMixin, which QosCoreResourceExtension does not inherit from.  How should I get access to this in QosCoreResourceExtension (in https://review.openstack.org/#/c/217092/19/neutron/core_extensions/qos.py line 36 for example)","commit_id":"2fa617913b18ea3d76fb20a2d19d10c34054f295"}],"neutron/tests/tempest/api/test_qos.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6b2fd2b1007d54c2b23519b2c9f150a89d2da30a","unresolved":false,"context_lines":[{"line_number":845,"context_line":"    def resource_setup(cls):"},{"line_number":846,"context_line":"        super(QosUnauthorizedErrorTest, cls).resource_setup()"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"    @test.attr(type\u003d\u0027smoke\u0027)"},{"line_number":849,"context_line":"    @test.idempotent_id(\u0027aa457c19-0037-4e29-85f1-fb986a64c9d0\u0027)"},{"line_number":850,"context_line":"    def test_unauthorized_method(self):"},{"line_number":851,"context_line":"        network \u003d self.create_shared_network(\u0027test network\u0027)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_2939f9a4","line":848,"updated":"2016-04-19 11:50:25.000000000","message":"Please remove smoke tag. The test is very qos specific to be smoke.","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"fb983a4b31f7245fb8d7913e5c64e182a6a2b34b","unresolved":false,"context_lines":[{"line_number":845,"context_line":"    def resource_setup(cls):"},{"line_number":846,"context_line":"        super(QosUnauthorizedErrorTest, cls).resource_setup()"},{"line_number":847,"context_line":""},{"line_number":848,"context_line":"    @test.attr(type\u003d\u0027smoke\u0027)"},{"line_number":849,"context_line":"    @test.idempotent_id(\u0027aa457c19-0037-4e29-85f1-fb986a64c9d0\u0027)"},{"line_number":850,"context_line":"    def test_unauthorized_method(self):"},{"line_number":851,"context_line":"        network \u003d self.create_shared_network(\u0027test network\u0027)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_da618faa","line":848,"in_reply_to":"1a122d0e_2939f9a4","updated":"2016-04-21 20:14:16.000000000","message":"Done","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5f3c536b5fa01f25ab1f22f8d3e6ab1dcf642222","unresolved":false,"context_lines":[{"line_number":848,"context_line":"    @test.attr(type\u003d\u0027smoke\u0027)"},{"line_number":849,"context_line":"    @test.idempotent_id(\u0027aa457c19-0037-4e29-85f1-fb986a64c9d0\u0027)"},{"line_number":850,"context_line":"    def test_unauthorized_method(self):"},{"line_number":851,"context_line":"        network \u003d self.create_shared_network(\u0027test network\u0027)"},{"line_number":852,"context_line":"        self.assertRaises("},{"line_number":853,"context_line":"            exceptions.BadRequest,"},{"line_number":854,"context_line":"            self.admin_client.update_network(network[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_aba06b44","line":851,"updated":"2016-04-19 08:11:17.000000000","message":"you need to:\n1) create a non shared network (as tenant)\n2) set a (non shared) policy (as admin), and then...","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"fb983a4b31f7245fb8d7913e5c64e182a6a2b34b","unresolved":false,"context_lines":[{"line_number":848,"context_line":"    @test.attr(type\u003d\u0027smoke\u0027)"},{"line_number":849,"context_line":"    @test.idempotent_id(\u0027aa457c19-0037-4e29-85f1-fb986a64c9d0\u0027)"},{"line_number":850,"context_line":"    def test_unauthorized_method(self):"},{"line_number":851,"context_line":"        network \u003d self.create_shared_network(\u0027test network\u0027)"},{"line_number":852,"context_line":"        self.assertRaises("},{"line_number":853,"context_line":"            exceptions.BadRequest,"},{"line_number":854,"context_line":"            self.admin_client.update_network(network[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_e44dd1c5","line":851,"in_reply_to":"1a122d0e_aba06b44","updated":"2016-04-21 20:14:16.000000000","message":"It is unknown to me how to accomplish this.  I will respin a PS to fix the other errors, but this remains unresolved.","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5f3c536b5fa01f25ab1f22f8d3e6ab1dcf642222","unresolved":false,"context_lines":[{"line_number":851,"context_line":"        network \u003d self.create_shared_network(\u0027test network\u0027)"},{"line_number":852,"context_line":"        self.assertRaises("},{"line_number":853,"context_line":"            exceptions.BadRequest,"},{"line_number":854,"context_line":"            self.admin_client.update_network(network[\u0027id\u0027],"},{"line_number":855,"context_line":"                                             qos_policy_id\u003dNone),"},{"line_number":856,"context_line":"            None, 58)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_ab6eabfe","line":854,"updated":"2016-04-19 08:11:17.000000000","message":"try to unset as tenant. (Which will raise the exception)","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"2d9e001e805fab13687c7fd7a1dce94d548f9133","unresolved":false,"context_lines":[{"line_number":851,"context_line":"        network \u003d self.create_shared_network(\u0027test network\u0027)"},{"line_number":852,"context_line":"        self.assertRaises("},{"line_number":853,"context_line":"            exceptions.BadRequest,"},{"line_number":854,"context_line":"            self.admin_client.update_network(network[\u0027id\u0027],"},{"line_number":855,"context_line":"                                             qos_policy_id\u003dNone),"},{"line_number":856,"context_line":"            None, 58)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_67bb4de6","line":854,"in_reply_to":"1a122d0e_ab6eabfe","updated":"2016-05-09 17:25:18.000000000","message":"[comment filed when PS29 was the most current]\n\nIt seems that I can not try to unset a QoS policy as a tenant.  Setting a QoS policy on a port is an admin-only action, so when I try as non-admin I get the error: \n\n    Details: {u\u0027detail\u0027: u\u0027\u0027, u\u0027message\u0027: u\u0027The resource could not be found.\u0027, u\u0027type\u0027: u\u0027HTTPNotFound\u0027}\n\nI think this effectively prevents the scenario you are worried about.  Please let me know if I have misunderstood.","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"242a4a36ed8f532a91e468e86cbec1c8fbfa7ce0","unresolved":false,"context_lines":[{"line_number":851,"context_line":"        network \u003d self.create_shared_network(\u0027test network\u0027)"},{"line_number":852,"context_line":"        self.assertRaises("},{"line_number":853,"context_line":"            exceptions.BadRequest,"},{"line_number":854,"context_line":"            self.admin_client.update_network(network[\u0027id\u0027],"},{"line_number":855,"context_line":"                                             qos_policy_id\u003dNone),"},{"line_number":856,"context_line":"            None, 58)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dab17558_09f754f6","line":854,"in_reply_to":"dab17558_67bb4de6","updated":"2016-05-12 10:41:13.000000000","message":"This actually requires different server policies, I guess we will need to check it manually.\n\nSee : http://docs.openstack.org/liberty/networking-guide/adv_config_qos.html  (Trusted tenant policy configuration)","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5f3c536b5fa01f25ab1f22f8d3e6ab1dcf642222","unresolved":false,"context_lines":[{"line_number":853,"context_line":"            exceptions.BadRequest,"},{"line_number":854,"context_line":"            self.admin_client.update_network(network[\u0027id\u0027],"},{"line_number":855,"context_line":"                                             qos_policy_id\u003dNone),"},{"line_number":856,"context_line":"            None, 58)"}],"source_content_type":"text/x-python","patch_set":25,"id":"1a122d0e_8b480f89","line":856,"updated":"2016-04-19 08:11:17.000000000","message":"and, repeat history for a port.","commit_id":"146f49f501fb6415bb2d4c3e553e901d290904c1"}],"neutron/tests/unit/core_extensions/test_qos.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared, tenant_id):"},{"line_number":116,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":117,"context_line":"            port_id \u003d mock.Mock()"},{"line_number":118,"context_line":"            qos_policy_id \u003d mock.Mock()"},{"line_number":119,"context_line":"            actual_port \u003d {\u0027id\u0027: port_id,"},{"line_number":120,"context_line":"                           qos_consts.QOS_POLICY_ID: qos_policy_id}"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_a0f720f4","line":117,"updated":"2015-08-28 06:23:31.000000000","message":"No action required:\n\nI personally don\u0027t like the mocked ids (I know is what we have in the tests now).\n\nIt\u0027s less LOCs and code to read if we just create some test id\u0027s as constants at top of the test_qos.py (I can refactor this file later).","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared, tenant_id):"},{"line_number":116,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":117,"context_line":"            port_id \u003d mock.Mock()"},{"line_number":118,"context_line":"            qos_policy_id \u003d mock.Mock()"},{"line_number":119,"context_line":"            actual_port \u003d {\u0027id\u0027: port_id,"},{"line_number":120,"context_line":"                           qos_consts.QOS_POLICY_ID: qos_policy_id}"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_a07160e2","line":117,"in_reply_to":"da20952f_a0f720f4","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def test_process_resource_port_updated_remove_own_policy(self):"},{"line_number":136,"context_line":"        self._process_port_updated_policy("},{"line_number":137,"context_line":"            self.non_admin_context, False, self.non_admin_context.tenant_id)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def test_process_resource_port_updated_admin_remove_provided_policy(self):"},{"line_number":140,"context_line":"        self._process_port_updated_policy("}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_e09f58b2","line":137,"updated":"2015-08-28 06:23:31.000000000","message":"could we be explicit about the parameter names? that will help readability.\n\n_process_port_update_policy(context\u003dself.non_admin_context, \n                                                shared\u003dFalse,\n                                                tenant_id\u003d ...)\n\n?","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def test_process_resource_port_updated_remove_own_policy(self):"},{"line_number":136,"context_line":"        self._process_port_updated_policy("},{"line_number":137,"context_line":"            self.non_admin_context, False, self.non_admin_context.tenant_id)"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def test_process_resource_port_updated_admin_remove_provided_policy(self):"},{"line_number":140,"context_line":"        self._process_port_updated_policy("}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_40b2c495","line":137,"in_reply_to":"da20952f_e09f58b2","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def test_process_fields_network_updated_remove_provided_policy(self):"},{"line_number":235,"context_line":"        self._process_network_updated_exception("},{"line_number":236,"context_line":"            self.non_admin_context, False, self.context.tenant_id)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def _process_network_updated_policy(self, context, shared, tenant_id):"},{"line_number":239,"context_line":"        with self._mock_plugin_loaded(True):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_6048282e","line":236,"updated":"2015-08-28 06:23:31.000000000","message":"ditto about parameters","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def test_process_fields_network_updated_remove_provided_policy(self):"},{"line_number":235,"context_line":"        self._process_network_updated_exception("},{"line_number":236,"context_line":"            self.non_admin_context, False, self.context.tenant_id)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    def _process_network_updated_policy(self, context, shared, tenant_id):"},{"line_number":239,"context_line":"        with self._mock_plugin_loaded(True):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_60ad8830","line":236,"in_reply_to":"da20952f_6048282e","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def test_process_fields_network_updated_remove_shared_policy(self):"},{"line_number":258,"context_line":"        self._process_network_updated_policy("},{"line_number":259,"context_line":"            self.non_admin_context, True, self.context.tenant_id)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def test_process_fields_network_updated_remove_own_policy(self):"},{"line_number":262,"context_line":"        self._process_network_updated_policy("}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_205230de","line":259,"updated":"2015-08-28 06:23:31.000000000","message":"ditto about parameters","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"    def test_process_fields_network_updated_remove_shared_policy(self):"},{"line_number":258,"context_line":"        self._process_network_updated_policy("},{"line_number":259,"context_line":"            self.non_admin_context, True, self.context.tenant_id)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def test_process_fields_network_updated_remove_own_policy(self):"},{"line_number":262,"context_line":"        self._process_network_updated_policy("}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_00accc32","line":259,"in_reply_to":"da20952f_205230de","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            self.non_admin_context, True, self.context.tenant_id)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def test_process_fields_network_updated_remove_own_policy(self):"},{"line_number":262,"context_line":"        self._process_network_updated_policy("},{"line_number":263,"context_line":"            self.non_admin_context, True, self.non_admin_context.tenant_id)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def test_process_fields_network_updated_admin_remove_provided_policy(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_8059bc00","line":262,"updated":"2015-08-28 06:23:31.000000000","message":"ditto about parameters","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":259,"context_line":"            self.non_admin_context, True, self.context.tenant_id)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"    def test_process_fields_network_updated_remove_own_policy(self):"},{"line_number":262,"context_line":"        self._process_network_updated_policy("},{"line_number":263,"context_line":"            self.non_admin_context, True, self.non_admin_context.tenant_id)"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def test_process_fields_network_updated_admin_remove_provided_policy(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_e0675823","line":262,"in_reply_to":"da20952f_8059bc00","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"de34c6a35af4c34ee6daaa2155063feeea5730f3","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def test_process_fields_network_updated_admin_remove_provided_policy(self):"},{"line_number":266,"context_line":"        self._process_network_updated_policy("},{"line_number":267,"context_line":"            self.context, True, self.non_admin_context.tenant_id)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    def test_extract_fields_plugin_not_loaded(self):"},{"line_number":270,"context_line":"        with self._mock_plugin_loaded(False):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_40740467","line":267,"updated":"2015-08-28 06:23:31.000000000","message":"ditto about parameters","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"410f7de2f8a38a04ba41b0b4d791abfe2433a1a3","unresolved":false,"context_lines":[{"line_number":264,"context_line":""},{"line_number":265,"context_line":"    def test_process_fields_network_updated_admin_remove_provided_policy(self):"},{"line_number":266,"context_line":"        self._process_network_updated_policy("},{"line_number":267,"context_line":"            self.context, True, self.non_admin_context.tenant_id)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"    def test_extract_fields_plugin_not_loaded(self):"},{"line_number":270,"context_line":"        with self._mock_plugin_loaded(False):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_806e9cff","line":267,"in_reply_to":"da20952f_40740467","updated":"2015-08-28 06:35:53.000000000","message":"Done","commit_id":"5454a2aac35b947dde83955a8ff7a00d971b8ccc"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"1251d95292dec24eb840c9075a980fb703062808","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared,"},{"line_number":116,"context_line":"                                     policy_tenant_id):"},{"line_number":117,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":118,"context_line":"            port_id \u003d mock.Mock()"},{"line_number":119,"context_line":"            qos_policy_id \u003d mock.Mock()"},{"line_number":120,"context_line":"            actual_port \u003d {\u0027id\u0027: port_id,"},{"line_number":121,"context_line":"                           qos_consts.QOS_POLICY_ID: qos_policy_id}"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_027d10e7","line":118,"updated":"2015-09-01 14:52:21.000000000","message":"What\u0027s the reason of having port_id a Mock object?","commit_id":"d0e3acd31d3ce794135f78844aae71493196e578"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"083d449ff4d7a99a3573ea2edd3850832858f24d","unresolved":false,"context_lines":[{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared,"},{"line_number":116,"context_line":"                                     policy_tenant_id):"},{"line_number":117,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":118,"context_line":"            port_id \u003d mock.Mock()"},{"line_number":119,"context_line":"            qos_policy_id \u003d mock.Mock()"},{"line_number":120,"context_line":"            actual_port \u003d {\u0027id\u0027: port_id,"},{"line_number":121,"context_line":"                           qos_consts.QOS_POLICY_ID: qos_policy_id}"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_782a61e9","line":118,"in_reply_to":"da20952f_027d10e7","updated":"2015-09-02 01:33:13.000000000","message":"nothing but one value.","commit_id":"d0e3acd31d3ce794135f78844aae71493196e578"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"47d975df877cb1af796db5e98280fb5676cbd716","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            self.assertIsNone(actual_port[\u0027qos_policy_id\u0027])"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared,"},{"line_number":116,"context_line":"                                     policy_tenant_id):"},{"line_number":117,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":118,"context_line":"            port_id \u003d mock.sentinel.port_id"},{"line_number":119,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_831c9978","line":116,"updated":"2015-09-02 09:11:35.000000000","message":"I have one general suggestion on testing approach. As I see similar pattern on code below and all code including tests must be maintained, we can simplify to:\n\n test_check_policy_change_permission_\u003cinput_permutations\u003e():\n     ...\n\nand then just verify that if we call _update_network_policy() or _update_port_policy() and we have an old policy on port/network, we check whether tenant has permission to make the change.","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6fec88eb0fd2bfcdf71745c99fc3b7c45783e8de","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            self.assertIsNone(actual_port[\u0027qos_policy_id\u0027])"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared,"},{"line_number":116,"context_line":"                                     policy_tenant_id):"},{"line_number":117,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":118,"context_line":"            port_id \u003d mock.sentinel.port_id"},{"line_number":119,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_8625865d","line":116,"in_reply_to":"da20952f_831c9978","updated":"2015-09-02 09:41:51.000000000","message":"I don\u0027t follow :)","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"018c22425d7f69b373f6dd26c95a65de92df98ff","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            self.assertIsNone(actual_port[\u0027qos_policy_id\u0027])"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared,"},{"line_number":116,"context_line":"                                     policy_tenant_id):"},{"line_number":117,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":118,"context_line":"            port_id \u003d mock.sentinel.port_id"},{"line_number":119,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_b778f6f9","line":116,"in_reply_to":"da20952f_8625865d","updated":"2015-09-02 11:00:28.000000000","message":"I\u0027m a bad explainator (and this word probably doesn\u0027t even exist :) ). So what I suggest is to cover _check_policy_change_permission() that it raises exception based on input parameters. When we have the method covered by unittest, we can just make sure we actually call it when we update network or port. Does it make more sense now?","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"e6a86cb43c7f6585fe0312175d68a76d78a91369","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            self.assertIsNone(actual_port[\u0027qos_policy_id\u0027])"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared,"},{"line_number":116,"context_line":"                                     policy_tenant_id):"},{"line_number":117,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":118,"context_line":"            port_id \u003d mock.sentinel.port_id"},{"line_number":119,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_13003f01","line":116,"in_reply_to":"da20952f_92e14001","updated":"2015-09-06 10:52:41.000000000","message":"imo, these tests are not unittests ... you should instead add unittests for _check_policy_change_permission and update/extend unittests for _update_network/port_policy","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"de27a144db9da14021a65d69bfab6b90d54f51fc","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            self.assertIsNone(actual_port[\u0027qos_policy_id\u0027])"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"    def _process_port_updated_policy(self, context, shared,"},{"line_number":116,"context_line":"                                     policy_tenant_id):"},{"line_number":117,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":118,"context_line":"            port_id \u003d mock.sentinel.port_id"},{"line_number":119,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_92e14001","line":116,"in_reply_to":"da20952f_b778f6f9","updated":"2015-09-02 11:19:19.000000000","message":"yes, I agree it is a little higer level to test, but it also has a good point to test from some meaningful level.","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"47d975df877cb1af796db5e98280fb5676cbd716","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            old_qos_policy.detach_network.assert_called_once_with(network_id)"},{"line_number":218,"context_line":"            new_qos_policy.attach_network.assert_called_once_with(network_id)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def _process_network_updated_exception(self, context, shared,"},{"line_number":221,"context_line":"                                           policy_tenant_id):"},{"line_number":222,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":223,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_23d02dc9","line":220,"updated":"2015-09-02 09:11:35.000000000","message":"Is it called just once? We might call the code directly instead of helper.","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"6fec88eb0fd2bfcdf71745c99fc3b7c45783e8de","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            old_qos_policy.detach_network.assert_called_once_with(network_id)"},{"line_number":218,"context_line":"            new_qos_policy.attach_network.assert_called_once_with(network_id)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def _process_network_updated_exception(self, context, shared,"},{"line_number":221,"context_line":"                                           policy_tenant_id):"},{"line_number":222,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":223,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_e609e2de","line":220,"in_reply_to":"da20952f_23d02dc9","updated":"2015-09-02 09:41:51.000000000","message":"Correct :)","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"de27a144db9da14021a65d69bfab6b90d54f51fc","unresolved":false,"context_lines":[{"line_number":217,"context_line":"            old_qos_policy.detach_network.assert_called_once_with(network_id)"},{"line_number":218,"context_line":"            new_qos_policy.attach_network.assert_called_once_with(network_id)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def _process_network_updated_exception(self, context, shared,"},{"line_number":221,"context_line":"                                           policy_tenant_id):"},{"line_number":222,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":223,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_52c1687f","line":220,"in_reply_to":"da20952f_23d02dc9","updated":"2015-09-02 11:19:19.000000000","message":"Done","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"47d975df877cb1af796db5e98280fb5676cbd716","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    def _process_network_updated_exception(self, context, shared,"},{"line_number":221,"context_line":"                                           policy_tenant_id):"},{"line_number":222,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":223,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"},{"line_number":224,"context_line":"            network_id \u003d mock.sentinel.net_id"},{"line_number":225,"context_line":"            actual_network \u003d {\u0027id\u0027: network_id,"},{"line_number":226,"context_line":"                              qos_consts.QOS_POLICY_ID: qos_policy_id}"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_c31cd1c3","line":223,"updated":"2015-09-02 09:11:35.000000000","message":"Cool! :)","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"47d975df877cb1af796db5e98280fb5676cbd716","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            old_qos_policy \u003d mock.MagicMock()"},{"line_number":228,"context_line":"            old_qos_policy.shared \u003d False"},{"line_number":229,"context_line":"            old_qos_policy.tenant_id \u003d policy_tenant_id"},{"line_number":230,"context_line":"            self.policy_m.get_network_policy \u003d mock.Mock("},{"line_number":231,"context_line":"                return_value\u003dold_qos_policy)"},{"line_number":232,"context_line":"            self.assertRaises(n_exc.PolicyRemoveError,"},{"line_number":233,"context_line":"                              self.core_extension.process_fields,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_4339a140","line":230,"updated":"2015-09-02 09:11:35.000000000","message":"Nit: policy_m.get_network_policy is already a mock, so you can do:\n\n self.policy_m.get_network_policy.return_value \u003d old_qos_policy","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"de27a144db9da14021a65d69bfab6b90d54f51fc","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            old_qos_policy \u003d mock.MagicMock()"},{"line_number":228,"context_line":"            old_qos_policy.shared \u003d False"},{"line_number":229,"context_line":"            old_qos_policy.tenant_id \u003d policy_tenant_id"},{"line_number":230,"context_line":"            self.policy_m.get_network_policy \u003d mock.Mock("},{"line_number":231,"context_line":"                return_value\u003dold_qos_policy)"},{"line_number":232,"context_line":"            self.assertRaises(n_exc.PolicyRemoveError,"},{"line_number":233,"context_line":"                              self.core_extension.process_fields,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_3272b47d","line":230,"in_reply_to":"da20952f_4339a140","updated":"2015-09-02 11:19:19.000000000","message":"Done","commit_id":"58f5994eb11b9f98c91a5e652e17f8ff95a5f77b"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"d668642573c8665b52af5d992af9bbf595d27d36","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            shared\u003dTrue,"},{"line_number":150,"context_line":"            policy_tenant_id\u003dself.context.tenant_id)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_process_resource_port_updated_remove_provided_policy(self):"},{"line_number":153,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":154,"context_line":"            port_id \u003d mock.sentinel.port_id"},{"line_number":155,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_3704ab48","line":152,"updated":"2015-09-15 21:39:52.000000000","message":"code duplication can be avoided by doing:\n\n self.assertRaises(\n   n_exc.PolicyRemoveError,\n   self._process_port_updated_policy,\n   context\u003dself.non_admin_context,\n   shared\u003dFalse,\n   policy_tenant_id\u003d...)","commit_id":"3c50c3d533bc9f4ddcdbaa38cd3711c26d80c065"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"a999b7c98747ae044874e596c8ee1c920ff17f07","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            shared\u003dTrue,"},{"line_number":150,"context_line":"            policy_tenant_id\u003dself.context.tenant_id)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_process_resource_port_updated_remove_provided_policy(self):"},{"line_number":153,"context_line":"        with self._mock_plugin_loaded(True):"},{"line_number":154,"context_line":"            port_id \u003d mock.sentinel.port_id"},{"line_number":155,"context_line":"            qos_policy_id \u003d mock.sentinel.policy_id"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba15a1d1_a24e3494","line":152,"in_reply_to":"ba15a1d1_3704ab48","updated":"2015-09-16 03:00:52.000000000","message":"Done","commit_id":"3c50c3d533bc9f4ddcdbaa38cd3711c26d80c065"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"3074edc4138d9c9d7401899fba2074ee94511fd9","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":19,"context_line":"from neutron import context"},{"line_number":20,"context_line":"from neutron.core_extensions import base as base_core"},{"line_number":21,"context_line":"from neutron.core_extensions import qos as qos_core"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_e0fd076f","line":18,"updated":"2016-04-15 07:59:41.000000000","message":"let\u0027s import from neutron_lib instead","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"1f74ab643985d3db00dc1cdc0732ad717be4caab","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":19,"context_line":"from neutron import context"},{"line_number":20,"context_line":"from neutron.core_extensions import base as base_core"},{"line_number":21,"context_line":"from neutron.core_extensions import qos as qos_core"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a122d0e_75485b5c","line":18,"in_reply_to":"1a122d0e_6dc1b92e","updated":"2016-04-15 13:32:41.000000000","message":"s/PolicyRenamedError/PolicyRemoveError/, yes?","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"b1300e8138e852a3d1c6c0322b69ff5362d26e7f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":19,"context_line":"from neutron import context"},{"line_number":20,"context_line":"from neutron.core_extensions import base as base_core"},{"line_number":21,"context_line":"from neutron.core_extensions import qos as qos_core"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a122d0e_d517af52","line":18,"in_reply_to":"1a122d0e_75485b5c","updated":"2016-04-15 13:48:47.000000000","message":"Yep :)  Next PS will reflect that change.  Thanks Nate.","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"06ad5d8fb381949589a2d66bbaa93b535738f43f","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from neutron.common import exceptions as n_exc"},{"line_number":19,"context_line":"from neutron import context"},{"line_number":20,"context_line":"from neutron.core_extensions import base as base_core"},{"line_number":21,"context_line":"from neutron.core_extensions import qos as qos_core"}],"source_content_type":"text/x-python","patch_set":20,"id":"1a122d0e_6dc1b92e","line":18,"in_reply_to":"5a18252c_e0fd076f","updated":"2016-04-15 11:50:24.000000000","message":"The PolicyRenamedError is defined in neutron.common.exceptions.","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"},{"author":{"_account_id":17711,"name":"Margaret Frances","email":"margaret_frances@cable.comcast.com","username":"margaret-frances"},"change_message_id":"7c8ea00019a8af4814c01f283aa4627191d23da9","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            shared\u003dTrue,"},{"line_number":150,"context_line":"            policy_tenant_id\u003dself.context.tenant_id)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_process_resource_port_updated_remove_provided_policy(self):"},{"line_number":153,"context_line":"        self.assertRaises(n_exc.PolicyRemoveError,"},{"line_number":154,"context_line":"                          self._process_port_updated_policy,"},{"line_number":155,"context_line":"                          context\u003dself.non_admin_context,"}],"source_content_type":"text/x-python","patch_set":20,"id":"5a18252c_340045aa","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":65},"updated":"2016-04-13 17:42:42.000000000","message":"The move to object.base.NeutronDbObject.is_accessible in core_extensions.qos would mean that the policy mock in this module needs to be fixed up, here and in the analogous test method for the network:\n\n    self.policy_m.is_accessible.return_value \u003d False","commit_id":"adb10565d4c5440fd8cf81d3047c52c031775f04"}]}
