)]}'
{"neutron/agent/l2/extensions/qos.py":[{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"87d363e54869333c62b5ebb221a59923e4565620","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                #           the old and new rule lists."},{"line_number":255,"context_line":"                self.qos_driver.delete(port, old_qos_policy)"},{"line_number":256,"context_line":"                self.qos_driver.update(port, qos_policy)"},{"line_number":257,"context_line":"        self.policy_map.update_policy(qos_policy)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _process_reset_port(self, port):"},{"line_number":260,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_3b8499d2","line":257,"updated":"2015-12-07 06:03:41.000000000","message":"If old and new rules are same then why we got to update?","commit_id":"01176907d50c9c3eb96566492e85245102437066"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"df18054d0fae2648e2f7348e2b9b2becb0405f03","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                #           the old and new rule lists."},{"line_number":255,"context_line":"                self.qos_driver.delete(port, old_qos_policy)"},{"line_number":256,"context_line":"                self.qos_driver.update(port, qos_policy)"},{"line_number":257,"context_line":"        self.policy_map.update_policy(qos_policy)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _process_reset_port(self, port):"},{"line_number":260,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_c177a238","line":257,"in_reply_to":"7a740942_3b8499d2","updated":"2015-12-07 07:16:40.000000000","message":"We update only the policy (which is changed, i.e. description) in the local cache, not the device configuration.","commit_id":"01176907d50c9c3eb96566492e85245102437066"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"792b48678229a428af8229927b34b802748f2fa0","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                #           the old and new rule lists."},{"line_number":255,"context_line":"                self.qos_driver.delete(port, old_qos_policy)"},{"line_number":256,"context_line":"                self.qos_driver.update(port, qos_policy)"},{"line_number":257,"context_line":"        self.policy_map.update_policy(qos_policy)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _process_reset_port(self, port):"},{"line_number":260,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_ce034641","line":257,"in_reply_to":"7a740942_c177a238","updated":"2015-12-07 11:10:09.000000000","message":"Got it! May be a word about this would be useful and avoid confusion.","commit_id":"01176907d50c9c3eb96566492e85245102437066"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"71ae618cc98aa110186fc980f40c7ea6c45d0dc6","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def delete_port(self, context, port):"},{"line_number":238,"context_line":"        self._process_reset_port(port)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _is_reflush_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_e3281b88","line":240,"updated":"2015-12-09 09:53:39.000000000","message":"suggestion: what do you think of _policy_modified_rules as a name for this function? or _needs_rules_reflush   ?\n\n:)","commit_id":"0ea10f10f9e6c7c21e1c58ec31df1470c0c8d8e4"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"a3e45bc43640fc66b6d8d1cb082dd291c10c8aa3","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def delete_port(self, context, port):"},{"line_number":238,"context_line":"        self._process_reset_port(port)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _is_reflush_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_e32edb41","line":240,"in_reply_to":"7a740942_e3281b88","updated":"2015-12-09 09:56:08.000000000","message":"You options are much better than the one I picked :-). Will update","commit_id":"0ea10f10f9e6c7c21e1c58ec31df1470c0c8d8e4"},{"author":{"_account_id":18051,"name":"David Shaughnessy","email":"david.shaughnessy@intel.com","username":"davidsha"},"change_message_id":"655f7df23a2ba68508a22d1e214a417f08786d92","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def delete_port(self, context, port):"},{"line_number":238,"context_line":"        self._process_reset_port(port)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_modified_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_69f87e4a","line":240,"updated":"2015-12-09 14:47:48.000000000","message":"\"_policy_rules_modified\"\nIf it returns a boolean then making it a statement returning true or false makes more sense to me at least.","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"64fa8ab2c1c01aa7f2def85d76d58e811737dcc5","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def delete_port(self, context, port):"},{"line_number":238,"context_line":"        self._process_reset_port(port)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_modified_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_289ef763","line":240,"updated":"2015-12-09 13:07:38.000000000","message":"how about \"\"_is_policy_changed\"","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"de597d1df781d3ec75487525f1a702d6ae2541bf","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def delete_port(self, context, port):"},{"line_number":238,"context_line":"        self._process_reset_port(port)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_modified_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_a3b20805","line":240,"in_reply_to":"7a740942_289ef763","updated":"2015-12-09 13:23:39.000000000","message":"or \"_policy_has_same_rules\"","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"c7037318a934026f22355bb17677107b3ca5561c","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def delete_port(self, context, port):"},{"line_number":238,"context_line":"        self._process_reset_port(port)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_modified_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_b0737b7f","line":240,"in_reply_to":"7a740942_69f87e4a","updated":"2015-12-13 09:56:30.000000000","message":"I prefer the later suggestion  \"_policy_rules_modified\"","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"ec255f46f785aaa97659312f20db46fd27ebec26","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def delete_port(self, context, port):"},{"line_number":238,"context_line":"        self._process_reset_port(port)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_modified_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_ce9c1860","line":240,"in_reply_to":"7a740942_a3b20805","updated":"2015-12-09 14:26:44.000000000","message":"waiting a bit to see if there are more proposals :-)","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"d4a74c28028674bd2c4faecc94b184c735d882f4","unresolved":false,"context_lines":[{"line_number":240,"context_line":"    def _policy_modified_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"},{"line_number":244,"context_line":"        return True"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    def _process_update_policy(self, qos_policy):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_5a8c627f","line":243,"updated":"2015-12-09 15:31:42.000000000","message":"instead of L242-243 you can just do \nreturn not  all(i in old_policy.rules for i in policy.rules)","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"c7037318a934026f22355bb17677107b3ca5561c","unresolved":false,"context_lines":[{"line_number":240,"context_line":"    def _policy_modified_rules(self, old_policy, policy):"},{"line_number":241,"context_line":"        if len(old_policy.rules) \u003d\u003d len(policy.rules):"},{"line_number":242,"context_line":"            if all(i in old_policy.rules for i in policy.rules):"},{"line_number":243,"context_line":"                return False"},{"line_number":244,"context_line":"        return True"},{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    def _process_update_policy(self, qos_policy):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_d0708774","line":243,"in_reply_to":"7a740942_5a8c627f","updated":"2015-12-13 09:56:30.000000000","message":"Done","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ab8ba36c2fad40d012d3a0e667b44c3cfc8c3a39","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_rules_modified(self, old_policy, policy):"},{"line_number":241,"context_line":"        return not (len(old_policy.rules) \u003d\u003d len(policy.rules) and"},{"line_number":242,"context_line":"             all(i in old_policy.rules for i in policy.rules))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a710552_c9c15e82","line":242,"updated":"2015-12-15 06:44:23.000000000","message":"all() will work towards tuple and list.The usage here is strange. all([...]) will work?","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_rules_modified(self, old_policy, policy):"},{"line_number":241,"context_line":"        return not (len(old_policy.rules) \u003d\u003d len(policy.rules) and"},{"line_number":242,"context_line":"             all(i in old_policy.rules for i in policy.rules))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_8bb49bf2","line":242,"in_reply_to":"3a7e1126_59177b51","updated":"2015-12-17 11:59:57.000000000","message":"Strictly speaking, \u0027...for a generator expression\u0027, not a list :)","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8a4b98a20ae6d1844f880f5f04df364e1b452d9d","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_rules_modified(self, old_policy, policy):"},{"line_number":241,"context_line":"        return not (len(old_policy.rules) \u003d\u003d len(policy.rules) and"},{"line_number":242,"context_line":"             all(i in old_policy.rules for i in policy.rules))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_59177b51","line":242,"in_reply_to":"5a710552_545d06e8","updated":"2015-12-17 08:41:19.000000000","message":"Of course it works, it will check \"all\" for a list of True/False :)","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"bdc2b332bb05f8d89fb8cff7553cb312015ed27e","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_rules_modified(self, old_policy, policy):"},{"line_number":241,"context_line":"        return not (len(old_policy.rules) \u003d\u003d len(policy.rules) and"},{"line_number":242,"context_line":"             all(i in old_policy.rules for i in policy.rules))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a710552_545d06e8","line":242,"in_reply_to":"5a710552_c9c15e82","updated":"2015-12-15 07:40:46.000000000","message":"Please see unit tests that should show it works","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"},{"line_number":246,"context_line":"        if old_qos_policy:"},{"line_number":247,"context_line":"            if self._policy_rules_modified(old_qos_policy, qos_policy):"},{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_abedd78c","line":246,"updated":"2015-12-17 11:59:57.000000000","message":"Looks like here you try to fix a legit bug in the code where we can try to process a policy update for a port that were not known before to have a policy assigned (it can occur when a policy update occurs right after policy is assigned to a port). Shouldn\u0027t it go into a separate patch then?","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bc15f69ffd8f1cb712b919a3af05b2d09b3fac05","unresolved":false,"context_lines":[{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"},{"line_number":246,"context_line":"        if old_qos_policy:"},{"line_number":247,"context_line":"            if self._policy_rules_modified(old_qos_policy, qos_policy):"},{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_9e7845c6","line":246,"in_reply_to":"3a7e1126_2d648d47","updated":"2015-12-17 14:47:51.000000000","message":"Aha! That\u0027s why it worked before. Indeed, then it\u0027s an integral part of the patch.","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"},{"line_number":246,"context_line":"        if old_qos_policy:"},{"line_number":247,"context_line":"            if self._policy_rules_modified(old_qos_policy, qos_policy):"},{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_2d648d47","line":246,"in_reply_to":"3a7e1126_abedd78c","updated":"2015-12-17 14:37:33.000000000","message":"I saw the patch correctness as part of the current work goal :-). I think previously it worked since original line 242 returned no ports. Not sure it requires separate patch to add the \u0027if old_policy\u0027 check for policy existence","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":15309,"name":"zhaobo","email":"bzhaojyathousandy@gmail.com","username":"ZhaoBo"},"change_message_id":"ab8ba36c2fad40d012d3a0e667b44c3cfc8c3a39","unresolved":false,"context_lines":[{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"},{"line_number":246,"context_line":"        if old_qos_policy:"},{"line_number":247,"context_line":"            if self._policy_rules_modified(old_qos_policy, qos_policy):"},{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."},{"line_number":250,"context_line":"                    #           Later, we may want to apply the difference"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a710552_8e559c1e","line":247,"updated":"2015-12-15 06:44:23.000000000","message":"Could we make these conditions into 1 line?","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"bdc2b332bb05f8d89fb8cff7553cb312015ed27e","unresolved":false,"context_lines":[{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"},{"line_number":246,"context_line":"        if old_qos_policy:"},{"line_number":247,"context_line":"            if self._policy_rules_modified(old_qos_policy, qos_policy):"},{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."},{"line_number":250,"context_line":"                    #           Later, we may want to apply the difference"}],"source_content_type":"text/x-python","patch_set":4,"id":"5a710552_94636eb1","line":247,"in_reply_to":"5a710552_8e559c1e","updated":"2015-12-15 07:40:46.000000000","message":"I do not think so, since line 254 should happen if there is policy, but no rules may be modified","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"8a4b98a20ae6d1844f880f5f04df364e1b452d9d","unresolved":false,"context_lines":[{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"},{"line_number":246,"context_line":"        if old_qos_policy:"},{"line_number":247,"context_line":"            if self._policy_rules_modified(old_qos_policy, qos_policy):"},{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."},{"line_number":250,"context_line":"                    #           Later, we may want to apply the difference"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_446eb2ca","line":247,"in_reply_to":"5a710552_94636eb1","updated":"2015-12-17 08:41:19.000000000","message":"I believe Irena is correct, you need to execute L254 conditionally on \"old_os_policy\"","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."},{"line_number":250,"context_line":"                    #           Later, we may want to apply the difference"},{"line_number":251,"context_line":"                    #           between he old and new rule lists."},{"line_number":252,"context_line":"                    self.qos_driver.delete(port, old_qos_policy)"},{"line_number":253,"context_line":"                    self.qos_driver.update(port, qos_policy)"},{"line_number":254,"context_line":"            self.policy_map.update_policy(qos_policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_2b56c729","line":251,"updated":"2015-12-17 11:59:57.000000000","message":"the","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                for port in self.policy_map.get_ports(qos_policy):"},{"line_number":249,"context_line":"                    #NOTE(QoS): for now, just reflush the rules on the port."},{"line_number":250,"context_line":"                    #           Later, we may want to apply the difference"},{"line_number":251,"context_line":"                    #           between he old and new rule lists."},{"line_number":252,"context_line":"                    self.qos_driver.delete(port, old_qos_policy)"},{"line_number":253,"context_line":"                    self.qos_driver.update(port, qos_policy)"},{"line_number":254,"context_line":"            self.policy_map.update_policy(qos_policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_53bad624","line":251,"in_reply_to":"3a7e1126_2b56c729","updated":"2015-12-17 14:37:33.000000000","message":"Done","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0ee39ea68ba26633795907f9b7f541530cd4a182","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_rules_modified(self, old_policy, policy):"},{"line_number":241,"context_line":"        return not (len(old_policy.rules) \u003d\u003d len(policy.rules) and"},{"line_number":242,"context_line":"             all(i in old_policy.rules for i in policy.rules))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_721292b6","line":242,"updated":"2015-12-23 08:26:08.000000000","message":"i prefer the all to be aligned with the first ( it helps the understanding of the code)","commit_id":"cc564193e2305e8ba3add0f8901ee5548646d3ad"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2eb51257a75054fde80aea9d56bc1076f55fee4b","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_rules_modified(self, old_policy, policy):"},{"line_number":241,"context_line":"        return not (len(old_policy.rules) \u003d\u003d len(policy.rules) and"},{"line_number":242,"context_line":"             all(i in old_policy.rules for i in policy.rules))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_72605236","line":242,"in_reply_to":"1a7b0d38_721292b6","updated":"2015-12-23 08:34:46.000000000","message":"Done","commit_id":"cc564193e2305e8ba3add0f8901ee5548646d3ad"},{"author":{"_account_id":18485,"name":"Haim Daniel","email":"hdaniel@redhat.com","username":"hdaniel"},"change_message_id":"e123db4aff1957aedaa6a17adbb399d31238151e","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _policy_rules_modified(self, old_policy, policy):"},{"line_number":241,"context_line":"        return not (len(old_policy.rules) \u003d\u003d len(policy.rules) and"},{"line_number":242,"context_line":"                    all(i in old_policy.rules for i in policy.rules))"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def _process_update_policy(self, qos_policy):"},{"line_number":245,"context_line":"        old_qos_policy \u003d self.policy_map.get_policy(qos_policy.id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a7b0d38_543ba7eb","line":242,"updated":"2015-12-23 20:40:30.000000000","message":"nit: can it be replaced with:\nset(old_policy.rules) - set(policy.rules) !\u003d set()\n\nfor slightly better readability ?","commit_id":"aee20b968a12a683b953b576b7e0090345fd3418"}],"neutron/tests/unit/agent/l2/extensions/test_qos.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"d4a74c28028674bd2c4faecc94b184c735d882f4","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        self.qos_ext.delete_port(self.context, port)"},{"line_number":201,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":202,"context_line":"        self.assertIsNone(self.qos_ext.policy_map.get_port_policy(port))"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def test__handle_notification_ignores_all_event_types_except_updated(self):"},{"line_number":205,"context_line":"        with mock.patch.object("},{"line_number":206,"context_line":"            self.qos_ext, \u0027_process_update_policy\u0027) as update_mock:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_baa9c692","line":203,"updated":"2015-12-09 15:31:42.000000000","message":"I am not sure why we have here underscore twice, looks like a mistake","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"561756bf91a7ac371fb33d4fd6af7e08df4538ec","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        self.qos_ext.delete_port(self.context, port)"},{"line_number":201,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":202,"context_line":"        self.assertIsNone(self.qos_ext.policy_map.get_port_policy(port))"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"    def test__handle_notification_ignores_all_event_types_except_updated(self):"},{"line_number":205,"context_line":"        with mock.patch.object("},{"line_number":206,"context_line":"            self.qos_ext, \u0027_process_update_policy\u0027) as update_mock:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_2946cfbf","line":203,"in_reply_to":"7a740942_baa9c692","updated":"2015-12-10 06:48:59.000000000","message":"please discard this comment.","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"d4a74c28028674bd2c4faecc94b184c735d882f4","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.qos_ext._process_update_policy(policy_obj)"},{"line_number":235,"context_line":"        self.qos_ext.qos_driver.update.assert_called_with(port2, policy_obj)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def test__process_update_policy_descr(self):"},{"line_number":238,"context_line":"        port \u003d self._create_test_port_dict(qos_policy_id\u003dTEST_POLICY.id)"},{"line_number":239,"context_line":"        self.qos_ext.policy_map.set_port_policy(port, TEST_POLICY)"},{"line_number":240,"context_line":"        self.qos_ext._policy_modified_rules \u003d mock.Mock(return_value\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_ba80e6f8","line":237,"updated":"2015-12-09 15:31:42.000000000","message":"I think  you have copy paste mistake for the tests above with the double underscore.\n\nthere are some in the tests below","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"561756bf91a7ac371fb33d4fd6af7e08df4538ec","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.qos_ext._process_update_policy(policy_obj)"},{"line_number":235,"context_line":"        self.qos_ext.qos_driver.update.assert_called_with(port2, policy_obj)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def test__process_update_policy_descr(self):"},{"line_number":238,"context_line":"        port \u003d self._create_test_port_dict(qos_policy_id\u003dTEST_POLICY.id)"},{"line_number":239,"context_line":"        self.qos_ext.policy_map.set_port_policy(port, TEST_POLICY)"},{"line_number":240,"context_line":"        self.qos_ext._policy_modified_rules \u003d mock.Mock(return_value\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_e91687a6","line":237,"in_reply_to":"7a740942_ba80e6f8","updated":"2015-12-10 06:48:59.000000000","message":"please discard this comment","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"561756bf91a7ac371fb33d4fd6af7e08df4538ec","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        self.assertFalse(self.qos_ext._policy_modified_rules(self.policy,"},{"line_number":317,"context_line":"                                                        qos_policy))"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def test__is_reflush_required_change_policy_rule(self):"},{"line_number":320,"context_line":"        self.qos_ext.policy_map.set_port_policy(self.port, self.policy)"},{"line_number":321,"context_line":"        qos_policy \u003d TEST_POLICY_DESCR"},{"line_number":322,"context_line":"        updated_rule \u003d (rule.QosBandwidthLimitRule(context\u003dNone,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_69513762","line":319,"updated":"2015-12-10 06:48:59.000000000","message":"there is inconstancy in the tests method name\ntest__is_reflush and test_is_reflush","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"c7037318a934026f22355bb17677107b3ca5561c","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        self.assertFalse(self.qos_ext._policy_modified_rules(self.policy,"},{"line_number":317,"context_line":"                                                        qos_policy))"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def test__is_reflush_required_change_policy_rule(self):"},{"line_number":320,"context_line":"        self.qos_ext.policy_map.set_port_policy(self.port, self.policy)"},{"line_number":321,"context_line":"        qos_policy \u003d TEST_POLICY_DESCR"},{"line_number":322,"context_line":"        updated_rule \u003d (rule.QosBandwidthLimitRule(context\u003dNone,"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_500b37d6","line":319,"in_reply_to":"7a740942_69513762","updated":"2015-12-13 09:56:30.000000000","message":"I will rename to reflect the checked method name","commit_id":"475e1c36ae86fc8d9928f5a4d70fc61d90b5a91e"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":33,"context_line":"TEST_POLICY \u003d policy.QosPolicy(context\u003dNone,"},{"line_number":34,"context_line":"                               name\u003d\u0027test1\u0027, id\u003d\u0027fake_policy_id\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"TEST_POLICY_DESCR \u003d policy.QosPolicy(context\u003dNone, name\u003d\u0027test1\u0027,"},{"line_number":37,"context_line":"                                     id\u003d\u0027fake_policy_id\u0027,"},{"line_number":38,"context_line":"                                     description\u003d\u0027fake_descr\u0027)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_116a1881","line":36,"updated":"2015-12-17 11:59:57.000000000","message":"nit: the thing I consistently hate in this world is code duplication. If you would move common arguments into a separate dict and then reuse it for both policy objects, I would be happy as an elephant.","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"542e9376c362257e256610d2be1975a13c9022ff","unresolved":false,"context_lines":[{"line_number":33,"context_line":"TEST_POLICY \u003d policy.QosPolicy(context\u003dNone,"},{"line_number":34,"context_line":"                               name\u003d\u0027test1\u0027, id\u003d\u0027fake_policy_id\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"TEST_POLICY_DESCR \u003d policy.QosPolicy(context\u003dNone, name\u003d\u0027test1\u0027,"},{"line_number":37,"context_line":"                                     id\u003d\u0027fake_policy_id\u0027,"},{"line_number":38,"context_line":"                                     description\u003d\u0027fake_descr\u0027)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_ebae5184","line":36,"in_reply_to":"3a7e1126_116a1881","updated":"2015-12-17 22:25:54.000000000","message":"Done","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":33,"context_line":"TEST_POLICY \u003d policy.QosPolicy(context\u003dNone,"},{"line_number":34,"context_line":"                               name\u003d\u0027test1\u0027, id\u003d\u0027fake_policy_id\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"TEST_POLICY_DESCR \u003d policy.QosPolicy(context\u003dNone, name\u003d\u0027test1\u0027,"},{"line_number":37,"context_line":"                                     id\u003d\u0027fake_policy_id\u0027,"},{"line_number":38,"context_line":"                                     description\u003d\u0027fake_descr\u0027)"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_d35806fd","line":36,"in_reply_to":"3a7e1126_116a1881","updated":"2015-12-17 14:37:33.000000000","message":"Will try to make you happy :-)","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.qos_ext._process_update_policy(policy_obj)"},{"line_number":235,"context_line":"        self.qos_ext.qos_driver.update.assert_called_with(port2, policy_obj)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def test__process_update_policy_descr(self):"},{"line_number":238,"context_line":"        port \u003d self._create_test_port_dict(qos_policy_id\u003dTEST_POLICY.id)"},{"line_number":239,"context_line":"        self.qos_ext.policy_map.set_port_policy(port, TEST_POLICY)"},{"line_number":240,"context_line":"        self.qos_ext._policy_rules_modified \u003d mock.Mock(return_value\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_b64a1a82","line":237,"updated":"2015-12-17 11:59:57.000000000","message":"I suggest test__process_update_policy_description_update_not_propagated_into_driver name","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.qos_ext._process_update_policy(policy_obj)"},{"line_number":235,"context_line":"        self.qos_ext.qos_driver.update.assert_called_with(port2, policy_obj)"},{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def test__process_update_policy_descr(self):"},{"line_number":238,"context_line":"        port \u003d self._create_test_port_dict(qos_policy_id\u003dTEST_POLICY.id)"},{"line_number":239,"context_line":"        self.qos_ext.policy_map.set_port_policy(port, TEST_POLICY)"},{"line_number":240,"context_line":"        self.qos_ext._policy_rules_modified \u003d mock.Mock(return_value\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_13068ece","line":237,"in_reply_to":"3a7e1126_b64a1a82","updated":"2015-12-17 14:37:33.000000000","message":"Done","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        self.qos_ext._policy_rules_modified \u003d mock.Mock(return_value\u003dFalse)"},{"line_number":241,"context_line":"        self.qos_ext._process_update_policy(TEST_POLICY_DESCR)"},{"line_number":242,"context_line":"        self.qos_ext._policy_rules_modified.assert_called_with(TEST_POLICY,"},{"line_number":243,"context_line":"                                                          TEST_POLICY_DESCR)"},{"line_number":244,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":245,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.update.called)"},{"line_number":246,"context_line":"        self.assertEqual(TEST_POLICY_DESCR,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_3114f442","line":243,"updated":"2015-12-17 11:59:57.000000000","message":"nit: indentation is not ideal","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":240,"context_line":"        self.qos_ext._policy_rules_modified \u003d mock.Mock(return_value\u003dFalse)"},{"line_number":241,"context_line":"        self.qos_ext._process_update_policy(TEST_POLICY_DESCR)"},{"line_number":242,"context_line":"        self.qos_ext._policy_rules_modified.assert_called_with(TEST_POLICY,"},{"line_number":243,"context_line":"                                                          TEST_POLICY_DESCR)"},{"line_number":244,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":245,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.update.called)"},{"line_number":246,"context_line":"        self.assertEqual(TEST_POLICY_DESCR,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_f312e208","line":243,"in_reply_to":"3a7e1126_3114f442","updated":"2015-12-17 14:37:33.000000000","message":"Done","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":254,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.update.called)"},{"line_number":255,"context_line":"        self.assertEqual(None, self.qos_ext.policy_map.get_policy("},{"line_number":256,"context_line":"                                                TEST_POLICY_DESCR.id))"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"    def test__process_reset_port(self):"},{"line_number":259,"context_line":"        port1 \u003d self._create_test_port_dict(qos_policy_id\u003dTEST_POLICY.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_b126a4b8","line":256,"range":{"start_line":256,"start_character":0,"end_line":256,"end_character":48},"updated":"2015-12-17 11:59:57.000000000","message":"nit: indentation is not ideal","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":254,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.update.called)"},{"line_number":255,"context_line":"        self.assertEqual(None, self.qos_ext.policy_map.get_policy("},{"line_number":256,"context_line":"                                                TEST_POLICY_DESCR.id))"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"    def test__process_reset_port(self):"},{"line_number":259,"context_line":"        port1 \u003d self._create_test_port_dict(qos_policy_id\u003dTEST_POLICY.id)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_d326c667","line":256,"range":{"start_line":256,"start_character":0,"end_line":256,"end_character":48},"in_reply_to":"3a7e1126_b126a4b8","updated":"2015-12-17 14:37:33.000000000","message":"Done","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def setUp(self):"},{"line_number":295,"context_line":"        super(QosExtensionReflushRulesTestCase, self).setUp()"},{"line_number":296,"context_line":"        self.qos_ext.initialize("},{"line_number":297,"context_line":"            self.connection, constants.EXTENSION_DRIVER_TYPE)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        self.pull_mock \u003d mock.patch.object("},{"line_number":300,"context_line":"            self.qos_ext.resource_rpc, \u0027pull\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_bc743b9c","line":297,"updated":"2015-12-17 11:59:57.000000000","message":"Seems like we load OVS driver here? Can we avoid it for the unit test? Extension has nothing to do with it.","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"542e9376c362257e256610d2be1975a13c9022ff","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def setUp(self):"},{"line_number":295,"context_line":"        super(QosExtensionReflushRulesTestCase, self).setUp()"},{"line_number":296,"context_line":"        self.qos_ext.initialize("},{"line_number":297,"context_line":"            self.connection, constants.EXTENSION_DRIVER_TYPE)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        self.pull_mock \u003d mock.patch.object("},{"line_number":300,"context_line":"            self.qos_ext.resource_rpc, \u0027pull\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_cb8cb537","line":297,"in_reply_to":"3a7e1126_b391ba54","updated":"2015-12-17 22:25:54.000000000","message":"The test needs to call the initialize method to set up the self.policy_map  I do not see a way to overcome the loading of the driver, since it is part of the initialize method. I may need to introduce changes to the qos_extension initialize method to extract driver load to separate class, so then it can be mocked. I tend to delegate it to the follow up patch. What is your take?","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def setUp(self):"},{"line_number":295,"context_line":"        super(QosExtensionReflushRulesTestCase, self).setUp()"},{"line_number":296,"context_line":"        self.qos_ext.initialize("},{"line_number":297,"context_line":"            self.connection, constants.EXTENSION_DRIVER_TYPE)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        self.pull_mock \u003d mock.patch.object("},{"line_number":300,"context_line":"            self.qos_ext.resource_rpc, \u0027pull\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_b391ba54","line":297,"in_reply_to":"3a7e1126_bc743b9c","updated":"2015-12-17 14:37:33.000000000","message":"Will check how to improve mocking","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"32fbe78dfdd16817615dde81000113f4ea7ac7c3","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def setUp(self):"},{"line_number":295,"context_line":"        super(QosExtensionReflushRulesTestCase, self).setUp()"},{"line_number":296,"context_line":"        self.qos_ext.initialize("},{"line_number":297,"context_line":"            self.connection, constants.EXTENSION_DRIVER_TYPE)"},{"line_number":298,"context_line":""},{"line_number":299,"context_line":"        self.pull_mock \u003d mock.patch.object("},{"line_number":300,"context_line":"            self.qos_ext.resource_rpc, \u0027pull\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_da4c6444","line":297,"in_reply_to":"3a7e1126_cb8cb537","updated":"2015-12-18 11:03:30.000000000","message":"I would say, a better way would be to have a fake test only driver with stub methods for those kinds of tests. Agreed it may belong to a separate patch.","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            rule.QosBandwidthLimitRule(context\u003dNone, id\u003d\u0027fake_rule_id\u0027,"},{"line_number":306,"context_line":"                                       qos_policy_id\u003dself.policy.id,"},{"line_number":307,"context_line":"                                       max_kbps\u003d100, max_burst_kbps\u003d10))"},{"line_number":308,"context_line":"        self.policy.rules \u003d [self.rule]"},{"line_number":309,"context_line":"        self.port \u003d {\u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":310,"context_line":"                     \u0027qos_policy_id\u0027: TEST_POLICY.id}"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_5c3d172a","line":308,"updated":"2015-12-17 11:59:57.000000000","message":"So you modify the object in place. Where do you restore it? Same in other places.","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"32fbe78dfdd16817615dde81000113f4ea7ac7c3","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            rule.QosBandwidthLimitRule(context\u003dNone, id\u003d\u0027fake_rule_id\u0027,"},{"line_number":306,"context_line":"                                       qos_policy_id\u003dself.policy.id,"},{"line_number":307,"context_line":"                                       max_kbps\u003d100, max_burst_kbps\u003d10))"},{"line_number":308,"context_line":"        self.policy.rules \u003d [self.rule]"},{"line_number":309,"context_line":"        self.port \u003d {\u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":310,"context_line":"                     \u0027qos_policy_id\u0027: TEST_POLICY.id}"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_5abb94e5","line":308,"in_reply_to":"3a7e1126_2b6a19b4","updated":"2015-12-18 11:03:30.000000000","message":"self.policy points to TEST_POLICY which is a global object used in multiple test cases. In this line, you modify one of its attributes, so I would expect the change be seen in next test cases using the object. Or does it work because obj_load_attr() is called when accessing the .rules field?","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"58f2eab7b549c50c79328556ccb506c460ab22d5","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            rule.QosBandwidthLimitRule(context\u003dNone, id\u003d\u0027fake_rule_id\u0027,"},{"line_number":306,"context_line":"                                       qos_policy_id\u003dself.policy.id,"},{"line_number":307,"context_line":"                                       max_kbps\u003d100, max_burst_kbps\u003d10))"},{"line_number":308,"context_line":"        self.policy.rules \u003d [self.rule]"},{"line_number":309,"context_line":"        self.port \u003d {\u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":310,"context_line":"                     \u0027qos_policy_id\u0027: TEST_POLICY.id}"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_162db594","line":308,"in_reply_to":"3a7e1126_5abb94e5","updated":"2015-12-20 10:09:01.000000000","message":"I believe it works due to obj_load_attr().","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            rule.QosBandwidthLimitRule(context\u003dNone, id\u003d\u0027fake_rule_id\u0027,"},{"line_number":306,"context_line":"                                       qos_policy_id\u003dself.policy.id,"},{"line_number":307,"context_line":"                                       max_kbps\u003d100, max_burst_kbps\u003d10))"},{"line_number":308,"context_line":"        self.policy.rules \u003d [self.rule]"},{"line_number":309,"context_line":"        self.port \u003d {\u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":310,"context_line":"                     \u0027qos_policy_id\u0027: TEST_POLICY.id}"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_f3b9827a","line":308,"in_reply_to":"3a7e1126_5c3d172a","updated":"2015-12-17 14:37:33.000000000","message":"Good catch. I think I actually do not need this in setup. Every test adjusts the rules for its needs","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"542e9376c362257e256610d2be1975a13c9022ff","unresolved":false,"context_lines":[{"line_number":305,"context_line":"            rule.QosBandwidthLimitRule(context\u003dNone, id\u003d\u0027fake_rule_id\u0027,"},{"line_number":306,"context_line":"                                       qos_policy_id\u003dself.policy.id,"},{"line_number":307,"context_line":"                                       max_kbps\u003d100, max_burst_kbps\u003d10))"},{"line_number":308,"context_line":"        self.policy.rules \u003d [self.rule]"},{"line_number":309,"context_line":"        self.port \u003d {\u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":310,"context_line":"                     \u0027qos_policy_id\u0027: TEST_POLICY.id}"},{"line_number":311,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_2b6a19b4","line":308,"in_reply_to":"3a7e1126_5c3d172a","updated":"2015-12-17 22:25:54.000000000","message":"On the second thought, this is just initial setup for each test. so this created the original policy with original rule.Each test verifies against update policy, which is another object.  I maybe miss you pint, so please elaborate.","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a6246b72838fecbbdbd3662c4ee6c67d8c500a25","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        qos_policy \u003d TEST_POLICY_DESCR"},{"line_number":315,"context_line":"        qos_policy.rules \u003d [self.rule]"},{"line_number":316,"context_line":"        self.assertFalse(self.qos_ext._policy_rules_modified(self.policy,"},{"line_number":317,"context_line":"                                                        qos_policy))"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def test_is_reflush_required_change_policy_rule(self):"},{"line_number":320,"context_line":"        self.qos_ext.policy_map.set_port_policy(self.port, self.policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_7c5a5385","line":317,"updated":"2015-12-17 11:59:57.000000000","message":"nit: indent here and below","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2ed9af86d90798d9a303c330ff1f188f67608cdc","unresolved":false,"context_lines":[{"line_number":314,"context_line":"        qos_policy \u003d TEST_POLICY_DESCR"},{"line_number":315,"context_line":"        qos_policy.rules \u003d [self.rule]"},{"line_number":316,"context_line":"        self.assertFalse(self.qos_ext._policy_rules_modified(self.policy,"},{"line_number":317,"context_line":"                                                        qos_policy))"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def test_is_reflush_required_change_policy_rule(self):"},{"line_number":320,"context_line":"        self.qos_ext.policy_map.set_port_policy(self.port, self.policy)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a7e1126_33baaac1","line":317,"in_reply_to":"3a7e1126_7c5a5385","updated":"2015-12-17 14:37:33.000000000","message":"Done","commit_id":"8f91b01b0451c3f1d4debcd8870694e165530e4f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"297e1ecbcdf0b3daa407a27946b2c473a50b7cb5","unresolved":false,"context_lines":[{"line_number":307,"context_line":"            rule.QosBandwidthLimitRule(context\u003dNone, id\u003d\u0027fake_rule_id\u0027,"},{"line_number":308,"context_line":"                                       qos_policy_id\u003dself.policy.id,"},{"line_number":309,"context_line":"                                       max_kbps\u003d100, max_burst_kbps\u003d10))"},{"line_number":310,"context_line":"        self.policy.rules \u003d [self.rule]"},{"line_number":311,"context_line":"        self.port \u003d {\u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":312,"context_line":"                     \u0027qos_policy_id\u0027: TEST_POLICY.id}"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a7e1126_57e7a6ab","line":310,"updated":"2015-12-21 09:46:07.000000000","message":"I am still uncomfortable with us relying here that the object does not cache .rules attribute. Actually, having it cached was my original plan for the object, but I never had time to look at it. So with that, once and if someone enables caching there, they will need to update the test cases, which is not ideal.","commit_id":"470ed78e0889dee5d4f6b10fa69c1c319975c05e"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"755086b7cdaf13bfcf140a73cd28c18298f4d20d","unresolved":false,"context_lines":[{"line_number":307,"context_line":"            rule.QosBandwidthLimitRule(context\u003dNone, id\u003d\u0027fake_rule_id\u0027,"},{"line_number":308,"context_line":"                                       qos_policy_id\u003dself.policy.id,"},{"line_number":309,"context_line":"                                       max_kbps\u003d100, max_burst_kbps\u003d10))"},{"line_number":310,"context_line":"        self.policy.rules \u003d [self.rule]"},{"line_number":311,"context_line":"        self.port \u003d {\u0027port_id\u0027: uuidutils.generate_uuid(),"},{"line_number":312,"context_line":"                     \u0027qos_policy_id\u0027: TEST_POLICY.id}"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"3a7e1126_1a99457c","line":310,"in_reply_to":"3a7e1126_57e7a6ab","updated":"2015-12-21 09:59:24.000000000","message":"I will rework this","commit_id":"470ed78e0889dee5d4f6b10fa69c1c319975c05e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0ee39ea68ba26633795907f9b7f541530cd4a182","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self.assertFalse(self.qos_ext._policy_rules_modified.called)"},{"line_number":255,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":256,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.update.called)"},{"line_number":257,"context_line":"        self.assertEqual(None, self.qos_ext.policy_map.get_policy("},{"line_number":258,"context_line":"            TEST_POLICY_DESCR.id))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    def test__process_reset_port(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_5288b6e7","line":257,"updated":"2015-12-23 08:26:08.000000000","message":"please use self.assertIsNone","commit_id":"cc564193e2305e8ba3add0f8901ee5548646d3ad"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"2eb51257a75054fde80aea9d56bc1076f55fee4b","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        self.assertFalse(self.qos_ext._policy_rules_modified.called)"},{"line_number":255,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.delete.called)"},{"line_number":256,"context_line":"        self.assertFalse(self.qos_ext.qos_driver.update.called)"},{"line_number":257,"context_line":"        self.assertEqual(None, self.qos_ext.policy_map.get_policy("},{"line_number":258,"context_line":"            TEST_POLICY_DESCR.id))"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"    def test__process_reset_port(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a7b0d38_525f5672","line":257,"in_reply_to":"1a7b0d38_5288b6e7","updated":"2015-12-23 08:34:46.000000000","message":"Done","commit_id":"cc564193e2305e8ba3add0f8901ee5548646d3ad"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"67d3c7d83423e7455753c174b65ae547098b2c34","unresolved":false,"context_lines":[{"line_number":313,"context_line":""},{"line_number":314,"context_line":"    def test_is_reflush_required_change_policy_descr(self):"},{"line_number":315,"context_line":"        self.qos_ext.policy_map.set_port_policy(self.port, self.policy)"},{"line_number":316,"context_line":"        qos_policy \u003d TEST_POLICY_DESCR.obj_clone()"},{"line_number":317,"context_line":"        qos_policy.rules \u003d [self.rule]"},{"line_number":318,"context_line":"        self.assertFalse(self.qos_ext._policy_rules_modified(self.policy,"},{"line_number":319,"context_line":"                                                             qos_policy))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_846ecec7","line":316,"updated":"2015-12-23 14:26:55.000000000","message":"Honestly speaking, obj_clone() is a workaround. Why don\u0027t we create an object in setUp(). I think it is a cleaner way.","commit_id":"0f5966d6d27e27925d2a5adf653ea4e5ca5b3e19"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"fef59cdc3efeb0ca63bcb74d168c727fffffc039","unresolved":false,"context_lines":[{"line_number":313,"context_line":""},{"line_number":314,"context_line":"    def test_is_reflush_required_change_policy_descr(self):"},{"line_number":315,"context_line":"        self.qos_ext.policy_map.set_port_policy(self.port, self.policy)"},{"line_number":316,"context_line":"        qos_policy \u003d TEST_POLICY_DESCR.obj_clone()"},{"line_number":317,"context_line":"        qos_policy.rules \u003d [self.rule]"},{"line_number":318,"context_line":"        self.assertFalse(self.qos_ext._policy_rules_modified(self.policy,"},{"line_number":319,"context_line":"                                                             qos_policy))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_759fca03","line":316,"in_reply_to":"1a7b0d38_75a58a02","updated":"2015-12-23 15:47:39.000000000","message":"When I wrote the last comment, I was just after checking other places in this module. What I wanted to mean is to create policy.QosPolicy in each test. If so, we don\u0027t need obj_clone or reset the object.\n\n  qos_policy \u003d policy.QosPolicy(description\u003d\u0027fake_descr\u0027,\n                                **BASE_TEST_POLICY)","commit_id":"0f5966d6d27e27925d2a5adf653ea4e5ca5b3e19"},{"author":{"_account_id":6598,"name":"Berezovsky Irena","email":"irenab.dev@gmail.com","username":"irenab"},"change_message_id":"c8c7c5b09a5b186bebc6a1566a4106f6096fea3c","unresolved":false,"context_lines":[{"line_number":313,"context_line":""},{"line_number":314,"context_line":"    def test_is_reflush_required_change_policy_descr(self):"},{"line_number":315,"context_line":"        self.qos_ext.policy_map.set_port_policy(self.port, self.policy)"},{"line_number":316,"context_line":"        qos_policy \u003d TEST_POLICY_DESCR.obj_clone()"},{"line_number":317,"context_line":"        qos_policy.rules \u003d [self.rule]"},{"line_number":318,"context_line":"        self.assertFalse(self.qos_ext._policy_rules_modified(self.policy,"},{"line_number":319,"context_line":"                                                             qos_policy))"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a7b0d38_75a58a02","line":316,"in_reply_to":"1a7b0d38_846ecec7","updated":"2015-12-23 15:31:56.000000000","message":"Actually, it was according to the comment from ihar. Since every test requires different rules to be defined, I either need current support of reset rules on every test.\ndo you prefer the later approach?","commit_id":"0f5966d6d27e27925d2a5adf653ea4e5ca5b3e19"}]}
