)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"82a44f45bc2037c484bb22198da2d3026068ab5c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Class to represent Placement state and sync"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Represent the desired state of the Placement DB and provide a method to"},{"line_number":10,"context_line":"sync this state to Placement. This is unused as is. A later patch is"},{"line_number":11,"context_line":"the same series is going to use it. But it is broken out into its own"},{"line_number":12,"context_line":"file and patch, so the code is organized better and easier to review."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_7c089427","line":10,"range":{"start_line":10,"start_character":66,"end_line":10,"end_character":68},"updated":"2018-08-14 14:26:28.000000000","message":"in perhaps?","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"2294ab68dfd1f1b3d10ea18230f3f315bdb63208","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Class to represent Placement state and sync"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Represent the desired state of the Placement DB and provide a method to"},{"line_number":10,"context_line":"sync this state to Placement. This is unused as is. A later patch is"},{"line_number":11,"context_line":"the same series is going to use it. But it is broken out into its own"},{"line_number":12,"context_line":"file and patch, so the code is organized better and easier to review."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3f79a3b5_6e0a3ad2","line":10,"range":{"start_line":10,"start_character":66,"end_line":10,"end_character":68},"in_reply_to":"3f79a3b5_7c089427","updated":"2018-08-30 15:43:15.000000000","message":"Done","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"}],"neutron/services/placement_report/state_sync.py":[{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"9524e3ab32b4f446e99b39035f9200fab9581eaa","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        for physnet, devices in self._device_mappings.items():"},{"line_number":98,"context_line":"            for device in devices:"},{"line_number":99,"context_line":"                if device in self._rp_bandwidths:"},{"line_number":100,"context_line":"                    physnets.append(physnet)"},{"line_number":101,"context_line":"        physnet_traits \u003d [place_utils.physnet_trait(physnet)"},{"line_number":102,"context_line":"                          for physnet"},{"line_number":103,"context_line":"                          in physnets]"},{"line_number":104,"context_line":"        traits \u003d [DeferredCall(self._client.update_trait, name\u003dtrait)"},{"line_number":105,"context_line":"                  for trait"},{"line_number":106,"context_line":"                  in physnet_traits]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_d65d5947","line":103,"range":{"start_line":100,"start_character":20,"end_line":103,"end_character":38},"updated":"2018-08-14 15:07:08.000000000","message":"I would skip the extra loop like:\nif device in self._rp_bandwidths:\n   physnet_traits.append(place_utils.physnet_trait(physnet))","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"2294ab68dfd1f1b3d10ea18230f3f315bdb63208","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        for physnet, devices in self._device_mappings.items():"},{"line_number":98,"context_line":"            for device in devices:"},{"line_number":99,"context_line":"                if device in self._rp_bandwidths:"},{"line_number":100,"context_line":"                    physnets.append(physnet)"},{"line_number":101,"context_line":"        physnet_traits \u003d [place_utils.physnet_trait(physnet)"},{"line_number":102,"context_line":"                          for physnet"},{"line_number":103,"context_line":"                          in physnets]"},{"line_number":104,"context_line":"        traits \u003d [DeferredCall(self._client.update_trait, name\u003dtrait)"},{"line_number":105,"context_line":"                  for trait"},{"line_number":106,"context_line":"                  in physnet_traits]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_8a72e648","line":103,"range":{"start_line":100,"start_character":20,"end_line":103,"end_character":38},"in_reply_to":"3f79a3b5_d65d5947","updated":"2018-08-30 15:43:15.000000000","message":"I think separating the collection of physnets and converting them to traits to two steps makes the code a bit easier to read. Usually I prefer readability over micro-optimizations.","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"9524e3ab32b4f446e99b39035f9200fab9581eaa","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return rps"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def create_resource_providers(self):"},{"line_number":156,"context_line":"        agent_rp \u003d self._create_agent_rp()"},{"line_number":157,"context_line":"        # XXX(bence romsics): I don\u0027t like digging in the deferred agent"},{"line_number":158,"context_line":"        # object, but without proper Promises I don\u0027t see a significantly"},{"line_number":159,"context_line":"        # nicer solution."},{"line_number":160,"context_line":"        device_rps \u003d self._create_device_rps(agent_rp\u003dagent_rp.kwargs)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        rps \u003d []"},{"line_number":163,"context_line":"        rps.append(agent_rp)"},{"line_number":164,"context_line":"        rps.extend(device_rps)"},{"line_number":165,"context_line":"        return rps"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def update_resource_provider_traits(self):"},{"line_number":168,"context_line":"        rp_traits \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_2908f2d7","line":165,"range":{"start_line":156,"start_character":8,"end_line":165,"end_character":18},"updated":"2018-08-14 15:07:08.000000000","message":"I would simplify this:\nrps \u003d []\nrps.append(self._create_agent_rp())\nrps.extend(self._create_device_rps(agent_rp\u003dagent_rp.kwargs))\nreturn rps.\n\nIf I count well one line less :-)\nNo actually 2 lines less, so I can\u0027t count.","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"2294ab68dfd1f1b3d10ea18230f3f315bdb63208","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        return rps"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def create_resource_providers(self):"},{"line_number":156,"context_line":"        agent_rp \u003d self._create_agent_rp()"},{"line_number":157,"context_line":"        # XXX(bence romsics): I don\u0027t like digging in the deferred agent"},{"line_number":158,"context_line":"        # object, but without proper Promises I don\u0027t see a significantly"},{"line_number":159,"context_line":"        # nicer solution."},{"line_number":160,"context_line":"        device_rps \u003d self._create_device_rps(agent_rp\u003dagent_rp.kwargs)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        rps \u003d []"},{"line_number":163,"context_line":"        rps.append(agent_rp)"},{"line_number":164,"context_line":"        rps.extend(device_rps)"},{"line_number":165,"context_line":"        return rps"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def update_resource_provider_traits(self):"},{"line_number":168,"context_line":"        rp_traits \u003d []"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_cac69e4a","line":165,"range":{"start_line":156,"start_character":8,"end_line":165,"end_character":18},"in_reply_to":"3f79a3b5_2908f2d7","updated":"2018-08-30 15:43:15.000000000","message":"Does the line count matter much?","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"9524e3ab32b4f446e99b39035f9200fab9581eaa","unresolved":false,"context_lines":[{"line_number":194,"context_line":"    def update_resource_provider_inventories(self):"},{"line_number":195,"context_line":"        rp_inventories \u003d []"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        for (device, bw_values) in self._rp_bandwidths.items():"},{"line_number":198,"context_line":"            rp_uuid \u003d place_utils.device_resource_provider_uuid("},{"line_number":199,"context_line":"                namespace\u003dself._driver_uuid_namespace,"},{"line_number":200,"context_line":"                host\u003dself._agent_host,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_894906b8","line":197,"range":{"start_line":197,"start_character":12,"end_line":197,"end_character":31},"updated":"2018-08-14 15:07:08.000000000","message":"useless brackets","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"2294ab68dfd1f1b3d10ea18230f3f315bdb63208","unresolved":false,"context_lines":[{"line_number":194,"context_line":"    def update_resource_provider_inventories(self):"},{"line_number":195,"context_line":"        rp_inventories \u003d []"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        for (device, bw_values) in self._rp_bandwidths.items():"},{"line_number":198,"context_line":"            rp_uuid \u003d place_utils.device_resource_provider_uuid("},{"line_number":199,"context_line":"                namespace\u003dself._driver_uuid_namespace,"},{"line_number":200,"context_line":"                host\u003dself._agent_host,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_6ed8fa51","line":197,"range":{"start_line":197,"start_character":12,"end_line":197,"end_character":31},"in_reply_to":"3f79a3b5_894906b8","updated":"2018-08-30 15:43:15.000000000","message":"Done","commit_id":"22fc8a7653cf3bebfd7d456cc4ce9a2506376fef"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"84a9f06d0dcacd20ea1ff21748dda7e7b3149375","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":63,"context_line":"    spare the diffing logic."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":66,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":67,"context_line":"    traits."},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2e238607","line":65,"range":{"start_line":65,"start_character":73,"end_line":65,"end_character":78},"updated":"2018-08-08 22:25:49.000000000","message":"I think leaving this to admin would be difficult for them. Having an automated approach to clean this up would be nice.","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"edef1ce873146d6bb2a769802e96c7adad2e42db","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":63,"context_line":"    spare the diffing logic."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":66,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":67,"context_line":"    traits."},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_ca6f5090","line":65,"range":{"start_line":65,"start_character":73,"end_line":65,"end_character":78},"in_reply_to":"3f79a3b5_2e238607","updated":"2018-08-09 12:31:48.000000000","message":"That\u0027s how far I got in my first round of answers. Let me collect my thougths and write it up shortly why we thought leaving these to the admin can be acceptable. I\u0027ll get back to you soon.","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"82a44f45bc2037c484bb22198da2d3026068ab5c","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":63,"context_line":"    spare the diffing logic."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":66,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":67,"context_line":"    traits."},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_5690694a","line":65,"range":{"start_line":65,"start_character":73,"end_line":65,"end_character":78},"in_reply_to":"3f79a3b5_3205c011","updated":"2018-08-14 14:26:28.000000000","message":"As I see under neutron/cmd there are some scripts for admin usage, which are even set in setup.cfg to be available as console scripts.\n\nAfter checking what we should left for the admin we can there some script to make their life easier.","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"f94ff753bcd7820087c5882e935ae41ce0bdf5aa","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":63,"context_line":"    spare the diffing logic."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":66,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":67,"context_line":"    traits."},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_3205c011","line":65,"range":{"start_line":65,"start_character":73,"end_line":65,"end_character":78},"in_reply_to":"3f79a3b5_3a570e29","updated":"2018-08-14 07:15:59.000000000","message":"You\u0027re absolutely welcome to investigate if you\u0027d like to. I guess it could be a good approach to find what use cases involve cleanup like this. (There\u0027s a trivial one: hardware replacement/decomissioning.) Then we could see how much those use cases benefit from automation. I added a line to the todo list pad:\n\nhttps://etherpad.openstack.org/p/QoS_minimum_bandwidth_allocation_in_Placement_API","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"0bfb632e1ff9895f5295523aefbee892608c93a4","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":63,"context_line":"    spare the diffing logic."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":66,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":67,"context_line":"    traits."},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_3a570e29","line":65,"range":{"start_line":65,"start_character":73,"end_line":65,"end_character":78},"in_reply_to":"3f79a3b5_41eea5b4","updated":"2018-08-10 15:36:47.000000000","message":"For the traits part, it makes perfect sense to me. Leaving the traits untouched probably doesn\u0027t hurt. Optionally, we could implement an admin CLI command to garbage collect the custom traits, but it shouldn\u0027t fall into the scope of this patch.\n\nFor the auto-deletion of dangling PRs, it does sound like a non-trivial process. I am totally fine to handle it later. Perhaps, I can help to investigate on it if I get a chance.","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"22b480e04827e2f6d19f14d6ce982ef3b25246ad","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":63,"context_line":"    spare the diffing logic."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":66,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":67,"context_line":"    traits."},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_0153cd40","line":65,"range":{"start_line":65,"start_character":73,"end_line":65,"end_character":78},"in_reply_to":"3f79a3b5_41eea5b4","updated":"2018-08-10 13:37:15.000000000","message":"Or alternatively we can document that the admin is responsible to delete placement stuff representing decommissioned resources.","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"e9d0c944bbd4cc7a77ba583a75db06509d80ede5","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":63,"context_line":"    spare the diffing logic."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":66,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":67,"context_line":"    traits."},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_41eea5b4","line":65,"range":{"start_line":65,"start_character":73,"end_line":65,"end_character":78},"in_reply_to":"3f79a3b5_ca6f5090","updated":"2018-08-10 13:26:43.000000000","message":"First let me note that we do delete a few things where the relevant API methods have replace-all semantics.  That is resource_provider/trait associations and resource_provider_inventories are deleted when they are no longer reported.  So the no-delete part only applies to traits and resource_providers.  First regarding traits: we have vnic_type traits and physnet traits.  vnic_type traits represent which vnic_types are supported so they shouldn\u0027t be deleted ever.\n\nA physnet trait probably should be deleted when a physnet is totally decommissioned from a cloud, which is a very rare event.  If a dangling physnet trait is left around there\u0027s no bad consequence other than wasting a few bytes of db storage under placement.\n\nA physical interface resource_provider also should be removed when the corresponding hardware NIC is either removed or is no longer used for bandwidth-aware scheduling.  Which is probably also a rare event.  And it is a manual admin process already.  That process can easily contain deleting the dangling RP too.  If it does that saves us some work here.\n\nOn the other hand if the admin forgets to delete the dangling resource provider, then placement may return non-existent candidates.  Which would fail quite late when neutron tries to bind and the agent no longer knows that bridge or physical device.  If we want to implement auto-deletion of dangling RPs, that should be possible.  That\u0027s why we have an agent RP in the first place, so we can track which physical interface RP was created by which agent.  The logic would be like this: list all child-RPs of an agent, delete the ones no longer known.  I just looked into how we could do this in the placement API.  And was surprised to see how unfriendly is the placement API to listing the children of an RP.  There\u0027s no filter for parent_provider_uuid.  There\u0027s no subtree listing starting from an arbitrary RP.  But even with the current API we can approximate by listing all children RPs of a compute RP (via in_tree) and throwing away what does not belong to the current agent.  And/or improve the placement API too.  Then there\u0027s another problem: We cannot delete an RP if it still has allocations, but if we try to, we may produce periodic errors. I\u0027m not sure what to do with that.\n\nThen there are the agent resource providers, which also should be removed when the agent is no longer around, but today we don\u0027t even have automatic cleanup of neutron\u0027s own agent records. Since agent RPs don\u0027t have inventories leaving dangling agent RPs around should not be a problem.\n\nNow that I have written this I realized this problem is more complex than I thought. So I\u0027d suggest phasing the work. The first step could be not deleting anything as this patch does right now. But then I agree we should have deletes for at least the dangling physical interface RPs. We can add that to our to-do list and handle it in a separate patch later.\n\nWhat do you think?","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"cc0e9162662ce1015fecfa00f0136c749581acea","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            inventories \u003d {}"},{"line_number":204,"context_line":"            for direction, rp_class in ("},{"line_number":205,"context_line":"                    (\u0027egress\u0027, place_const.CLASS_NET_BW_EGRESS_KBPS),"},{"line_number":206,"context_line":"                    (\u0027ingress\u0027, place_const.CLASS_NET_BW_INGRESS_KBPS)):"},{"line_number":207,"context_line":"                if bw_values[direction] is not None:"},{"line_number":208,"context_line":"                    inventory \u003d dict(self._rp_inventory_defaults)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2bf4d8ce","line":205,"range":{"start_line":205,"start_character":43,"end_line":205,"end_character":67},"updated":"2018-08-08 21:12:59.000000000","message":"While I tested this feature, it failed by complaining that the resource class has not been created.\n\nI saw the spec said the plan is to include this resource class as standard resource class, so I guess you have a patch in placement to implement that? If yes, setting a dependency would be nice.","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"edef1ce873146d6bb2a769802e96c7adad2e42db","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            inventories \u003d {}"},{"line_number":204,"context_line":"            for direction, rp_class in ("},{"line_number":205,"context_line":"                    (\u0027egress\u0027, place_const.CLASS_NET_BW_EGRESS_KBPS),"},{"line_number":206,"context_line":"                    (\u0027ingress\u0027, place_const.CLASS_NET_BW_INGRESS_KBPS)):"},{"line_number":207,"context_line":"                if bw_values[direction] is not None:"},{"line_number":208,"context_line":"                    inventory \u003d dict(self._rp_inventory_defaults)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_cac19082","line":205,"range":{"start_line":205,"start_character":43,"end_line":205,"end_character":67},"in_reply_to":"3f79a3b5_2bf4d8ce","updated":"2018-08-09 12:31:48.000000000","message":"Thanks for catching this. This dependency was implicit in what nova branch I used in my devstack and I never noticed that the placement side is not merged yet. I\u0027m adding the depends-on to the commit message.","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"f94ff753bcd7820087c5882e935ae41ce0bdf5aa","unresolved":false,"context_lines":[{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            inventories \u003d {}"},{"line_number":204,"context_line":"            for direction, rp_class in ("},{"line_number":205,"context_line":"                    (\u0027egress\u0027, place_const.CLASS_NET_BW_EGRESS_KBPS),"},{"line_number":206,"context_line":"                    (\u0027ingress\u0027, place_const.CLASS_NET_BW_INGRESS_KBPS)):"},{"line_number":207,"context_line":"                if bw_values[direction] is not None:"},{"line_number":208,"context_line":"                    inventory \u003d dict(self._rp_inventory_defaults)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_ef8445d5","line":205,"range":{"start_line":205,"start_character":43,"end_line":205,"end_character":67},"in_reply_to":"3f79a3b5_cac19082","updated":"2018-08-14 07:15:59.000000000","message":"By the way this is the most up-to-date patch series of the nova/placement side of this feature: https://review.openstack.org/573317 (topic\u003dbp/bandwidth-resource-provider)","commit_id":"060bc6e355200490b44c95808c0f564350956ed1"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"3ae246869ba2b7d36541b379796c06d04de520ea","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        agent_rp_uuid \u003d place_utils.agent_resource_provider_uuid("},{"line_number":127,"context_line":"            namespace\u003dself._driver_uuid_namespace, host\u003dself._agent_host)"},{"line_number":128,"context_line":"        agent_rp \u003d DeferredCall("},{"line_number":129,"context_line":"            self._client.ensure_resource_provider,"},{"line_number":130,"context_line":"            resource_provider\u003d{"},{"line_number":131,"context_line":"                \u0027name\u0027: agent_rp_name,"},{"line_number":132,"context_line":"                \u0027uuid\u0027: agent_rp_uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_f7a00894","line":129,"range":{"start_line":129,"start_character":25,"end_line":129,"end_character":49},"updated":"2018-08-31 11:41:09.000000000","message":"When ensure calls create, that raises JSONDecodeError, (though the API operation succeeds) because I forgot that the response body is only available from microversion 1.20+. I need to fix this in placement client.","commit_id":"b1abef1d2afcaec29c8cbd95dd7b11f95b54b870"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"409cad7bcedbd2518defd866c2fd059635943d1c","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        agent_rp_uuid \u003d place_utils.agent_resource_provider_uuid("},{"line_number":127,"context_line":"            namespace\u003dself._driver_uuid_namespace, host\u003dself._agent_host)"},{"line_number":128,"context_line":"        agent_rp \u003d DeferredCall("},{"line_number":129,"context_line":"            self._client.ensure_resource_provider,"},{"line_number":130,"context_line":"            resource_provider\u003d{"},{"line_number":131,"context_line":"                \u0027name\u0027: agent_rp_name,"},{"line_number":132,"context_line":"                \u0027uuid\u0027: agent_rp_uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_76fc0872","line":129,"range":{"start_line":129,"start_character":25,"end_line":129,"end_character":49},"in_reply_to":"3f79a3b5_f7a00894","updated":"2018-09-26 12:17:49.000000000","message":"This was fixed by Lajos here: I71a723a95fb407a97aa6793beb965ae7be1769a7","commit_id":"b1abef1d2afcaec29c8cbd95dd7b11f95b54b870"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"196c9f2cfc55a644fc531753a8835ca2839282cb","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _create_device_rps(self, agent_rp):"},{"line_number":137,"context_line":"        rps \u003d []"},{"line_number":138,"context_line":"        for device in self._rp_bandwidths.keys():"},{"line_number":139,"context_line":"            rp_name \u003d \u0027%s:%s\u0027 % (agent_rp[\u0027resource_provider\u0027][\u0027name\u0027], device)"},{"line_number":140,"context_line":"            rp_uuid \u003d place_utils.device_resource_provider_uuid("},{"line_number":141,"context_line":"                namespace\u003dself._driver_uuid_namespace,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_c00acf1c","line":138,"range":{"start_line":138,"start_character":41,"end_line":138,"end_character":48},"updated":"2018-09-27 15:38:33.000000000","message":"small nit: not needed, by default you only iterate over the dict keys","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _create_device_rps(self, agent_rp):"},{"line_number":137,"context_line":"        rps \u003d []"},{"line_number":138,"context_line":"        for device in self._rp_bandwidths.keys():"},{"line_number":139,"context_line":"            rp_name \u003d \u0027%s:%s\u0027 % (agent_rp[\u0027resource_provider\u0027][\u0027name\u0027], device)"},{"line_number":140,"context_line":"            rp_uuid \u003d place_utils.device_resource_provider_uuid("},{"line_number":141,"context_line":"                namespace\u003dself._driver_uuid_namespace,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_229ac012","line":138,"range":{"start_line":138,"start_character":41,"end_line":138,"end_character":48},"in_reply_to":"3f79a3b5_3b372db2","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"c973a9d317aff325bcf2e7958300ceb911ad04f2","unresolved":false,"context_lines":[{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _create_device_rps(self, agent_rp):"},{"line_number":137,"context_line":"        rps \u003d []"},{"line_number":138,"context_line":"        for device in self._rp_bandwidths.keys():"},{"line_number":139,"context_line":"            rp_name \u003d \u0027%s:%s\u0027 % (agent_rp[\u0027resource_provider\u0027][\u0027name\u0027], device)"},{"line_number":140,"context_line":"            rp_uuid \u003d place_utils.device_resource_provider_uuid("},{"line_number":141,"context_line":"                namespace\u003dself._driver_uuid_namespace,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_3b372db2","line":138,"range":{"start_line":138,"start_character":41,"end_line":138,"end_character":48},"in_reply_to":"3f79a3b5_c00acf1c","updated":"2018-09-27 21:49:09.000000000","message":"+1","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"196c9f2cfc55a644fc531753a8835ca2839282cb","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        for device in self._rp_bandwidths.keys():"},{"line_number":139,"context_line":"            rp_name \u003d \u0027%s:%s\u0027 % (agent_rp[\u0027resource_provider\u0027][\u0027name\u0027], device)"},{"line_number":140,"context_line":"            rp_uuid \u003d place_utils.device_resource_provider_uuid("},{"line_number":141,"context_line":"                namespace\u003dself._driver_uuid_namespace,"},{"line_number":142,"context_line":"                host\u003dself._agent_host,"},{"line_number":143,"context_line":"                device\u003ddevice)"},{"line_number":144,"context_line":"            rps.append("}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_207383b6","line":141,"updated":"2018-09-27 15:38:33.000000000","message":"nit: these arguments are positional, thus you don\u0027t need the var name","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        for device in self._rp_bandwidths.keys():"},{"line_number":139,"context_line":"            rp_name \u003d \u0027%s:%s\u0027 % (agent_rp[\u0027resource_provider\u0027][\u0027name\u0027], device)"},{"line_number":140,"context_line":"            rp_uuid \u003d place_utils.device_resource_provider_uuid("},{"line_number":141,"context_line":"                namespace\u003dself._driver_uuid_namespace,"},{"line_number":142,"context_line":"                host\u003dself._agent_host,"},{"line_number":143,"context_line":"                device\u003ddevice)"},{"line_number":144,"context_line":"            rps.append("}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_e27128e1","line":141,"in_reply_to":"3f79a3b5_207383b6","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"196c9f2cfc55a644fc531753a8835ca2839282cb","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            rps.append("},{"line_number":145,"context_line":"                DeferredCall("},{"line_number":146,"context_line":"                    self._client.ensure_resource_provider,"},{"line_number":147,"context_line":"                    resource_provider\u003d{"},{"line_number":148,"context_line":"                        \u0027name\u0027: rp_name,"},{"line_number":149,"context_line":"                        \u0027uuid\u0027: rp_uuid,"},{"line_number":150,"context_line":"                        \u0027parent_provider_uuid\u0027: agent_rp["}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_209863ca","line":147,"range":{"start_line":147,"start_character":20,"end_line":147,"end_character":37},"updated":"2018-09-27 15:38:33.000000000","message":"ditto","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            rps.append("},{"line_number":145,"context_line":"                DeferredCall("},{"line_number":146,"context_line":"                    self._client.ensure_resource_provider,"},{"line_number":147,"context_line":"                    resource_provider\u003d{"},{"line_number":148,"context_line":"                        \u0027name\u0027: rp_name,"},{"line_number":149,"context_line":"                        \u0027uuid\u0027: rp_uuid,"},{"line_number":150,"context_line":"                        \u0027parent_provider_uuid\u0027: agent_rp["}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_dda96dde","line":147,"range":{"start_line":147,"start_character":20,"end_line":147,"end_character":37},"in_reply_to":"3f79a3b5_209863ca","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"196c9f2cfc55a644fc531753a8835ca2839282cb","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                device\u003ddevice)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            inventories \u003d {}"},{"line_number":204,"context_line":"            for direction, rp_class in ("},{"line_number":205,"context_line":"                    (\u0027egress\u0027, place_const.CLASS_NET_BW_EGRESS_KBPS),"},{"line_number":206,"context_line":"                    (\u0027ingress\u0027, place_const.CLASS_NET_BW_INGRESS_KBPS)):"},{"line_number":207,"context_line":"                if bw_values[direction] is not None:"},{"line_number":208,"context_line":"                    inventory \u003d dict(self._rp_inventory_defaults)"},{"line_number":209,"context_line":"                    inventory[\u0027total\u0027] \u003d bw_values[direction]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_fd6c5408","line":206,"range":{"start_line":204,"start_character":39,"end_line":206,"end_character":71},"updated":"2018-09-27 15:38:33.000000000","message":"small nit: egress/ingress are constants in neutron-lib\nsmall nit: maybe you can move this set to a constant in this module","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                device\u003ddevice)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            inventories \u003d {}"},{"line_number":204,"context_line":"            for direction, rp_class in ("},{"line_number":205,"context_line":"                    (\u0027egress\u0027, place_const.CLASS_NET_BW_EGRESS_KBPS),"},{"line_number":206,"context_line":"                    (\u0027ingress\u0027, place_const.CLASS_NET_BW_INGRESS_KBPS)):"},{"line_number":207,"context_line":"                if bw_values[direction] is not None:"},{"line_number":208,"context_line":"                    inventory \u003d dict(self._rp_inventory_defaults)"},{"line_number":209,"context_line":"                    inventory[\u0027total\u0027] \u003d bw_values[direction]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_f636b102","line":206,"range":{"start_line":204,"start_character":39,"end_line":206,"end_character":71},"in_reply_to":"3f79a3b5_5bff89aa","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"c973a9d317aff325bcf2e7958300ceb911ad04f2","unresolved":false,"context_lines":[{"line_number":201,"context_line":"                device\u003ddevice)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"            inventories \u003d {}"},{"line_number":204,"context_line":"            for direction, rp_class in ("},{"line_number":205,"context_line":"                    (\u0027egress\u0027, place_const.CLASS_NET_BW_EGRESS_KBPS),"},{"line_number":206,"context_line":"                    (\u0027ingress\u0027, place_const.CLASS_NET_BW_INGRESS_KBPS)):"},{"line_number":207,"context_line":"                if bw_values[direction] is not None:"},{"line_number":208,"context_line":"                    inventory \u003d dict(self._rp_inventory_defaults)"},{"line_number":209,"context_line":"                    inventory[\u0027total\u0027] \u003d bw_values[direction]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_5bff89aa","line":206,"range":{"start_line":204,"start_character":39,"end_line":206,"end_character":71},"in_reply_to":"3f79a3b5_fd6c5408","updated":"2018-09-27 21:49:09.000000000","message":"+1, but neutron is using string in several other places..","commit_id":"086cb4c1a17565ece4b63518323cac5b9c3ce18a"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    \u0027\u0027\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, fun, *args, **kwargs):"},{"line_number":30,"context_line":"        self.fun \u003d fun"},{"line_number":31,"context_line":"        self.args \u003d args"},{"line_number":32,"context_line":"        self.kwargs \u003d kwargs"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_b5924f49","line":30,"range":{"start_line":30,"start_character":7,"end_line":30,"end_character":22},"updated":"2018-09-28 23:57:37.000000000","message":"would it make sense to add a check isinstance(fun, types.FunctionType) ? and if its not raise an error or that would be done right before init where this is consumed ?","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    \u0027\u0027\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    def __init__(self, fun, *args, **kwargs):"},{"line_number":30,"context_line":"        self.fun \u003d fun"},{"line_number":31,"context_line":"        self.args \u003d args"},{"line_number":32,"context_line":"        self.kwargs \u003d kwargs"},{"line_number":33,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_e67cbc72","line":30,"range":{"start_line":30,"start_character":7,"end_line":30,"end_character":22},"in_reply_to":"3f79a3b5_b5924f49","updated":"2018-10-11 12:09:16.000000000","message":"It\u0027d make the same sense as type checking any other parameter. It\u0027s possible, but in weakly (and duck) typed languages like Pyhton we usually don\u0027t do that. I think that\u0027s part of the language being duck typed.","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            for device in devices:"},{"line_number":99,"context_line":"                if device in self._rp_bandwidths:"},{"line_number":100,"context_line":"                    physnets.append(physnet)"},{"line_number":101,"context_line":"        physnet_traits \u003d [place_utils.physnet_trait(physnet)"},{"line_number":102,"context_line":"                          for physnet"},{"line_number":103,"context_line":"                          in physnets]"},{"line_number":104,"context_line":"        traits \u003d [DeferredCall(self._client.update_trait, name\u003dtrait)"},{"line_number":105,"context_line":"                  for trait"},{"line_number":106,"context_line":"                  in physnet_traits]"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_35bf1fac","line":103,"range":{"start_line":101,"start_character":8,"end_line":103,"end_character":38},"updated":"2018-09-28 23:57:37.000000000","message":"IMO, this for loop can be avoided by having L101 indented after 100 in same for loop ?\nphysnet_traits.append(place_utils.physnet_trait(physnet))","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":98,"context_line":"            for device in devices:"},{"line_number":99,"context_line":"                if device in self._rp_bandwidths:"},{"line_number":100,"context_line":"                    physnets.append(physnet)"},{"line_number":101,"context_line":"        physnet_traits \u003d [place_utils.physnet_trait(physnet)"},{"line_number":102,"context_line":"                          for physnet"},{"line_number":103,"context_line":"                          in physnets]"},{"line_number":104,"context_line":"        traits \u003d [DeferredCall(self._client.update_trait, name\u003dtrait)"},{"line_number":105,"context_line":"                  for trait"},{"line_number":106,"context_line":"                  in physnet_traits]"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_461d70bc","line":103,"range":{"start_line":101,"start_character":8,"end_line":103,"end_character":38},"in_reply_to":"3f79a3b5_35bf1fac","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        return traits"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _update_vnic_type_traits(self):"},{"line_number":110,"context_line":"        vnic_type_traits \u003d [place_utils.vnic_type_trait(vnic_type)"},{"line_number":111,"context_line":"                            for vnic_type"},{"line_number":112,"context_line":"                            in self._supported_vnic_types]"},{"line_number":113,"context_line":"        traits \u003d [DeferredCall(self._client.update_trait, name\u003dtrait)"},{"line_number":114,"context_line":"                  for trait"},{"line_number":115,"context_line":"                  in vnic_type_traits]"},{"line_number":116,"context_line":"        return traits"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_traits(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_f576870c","line":115,"range":{"start_line":110,"start_character":8,"end_line":115,"end_character":38},"updated":"2018-09-28 23:57:37.000000000","message":"traits \u003d []\nfor vnic_type in self._supported_vnic_types:\n    vnic_type_trait \u003d place_utils.vnic_type_trait(vnic_type)\n    traits.append(DeferredCall(                \n                  self._client.update_trait,\n                  name\u003dvnic_type_trait))\n\nreturn traits\n\nsuggestion for making it simple and more readable. no need of 2 separate for loops.","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        return traits"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def _update_vnic_type_traits(self):"},{"line_number":110,"context_line":"        vnic_type_traits \u003d [place_utils.vnic_type_trait(vnic_type)"},{"line_number":111,"context_line":"                            for vnic_type"},{"line_number":112,"context_line":"                            in self._supported_vnic_types]"},{"line_number":113,"context_line":"        traits \u003d [DeferredCall(self._client.update_trait, name\u003dtrait)"},{"line_number":114,"context_line":"                  for trait"},{"line_number":115,"context_line":"                  in vnic_type_traits]"},{"line_number":116,"context_line":"        return traits"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def update_traits(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_26bdd466","line":115,"range":{"start_line":110,"start_character":8,"end_line":115,"end_character":38},"in_reply_to":"3f79a3b5_f576870c","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    easier to add a __str__ method to help logging."},{"line_number":28,"context_line":"    \u0027\u0027\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __init__(self, fun, *args, **kwargs):"},{"line_number":31,"context_line":"        self.fun \u003d fun"},{"line_number":32,"context_line":"        self.args \u003d args"},{"line_number":33,"context_line":"        self.kwargs \u003d kwargs"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_8999a26c","line":30,"updated":"2018-10-18 18:55:26.000000000","message":"Could you change \"fun\" to \"func\"?  I think the extra character would help readability.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":27,"context_line":"    easier to add a __str__ method to help logging."},{"line_number":28,"context_line":"    \u0027\u0027\u0027"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def __init__(self, fun, *args, **kwargs):"},{"line_number":31,"context_line":"        self.fun \u003d fun"},{"line_number":32,"context_line":"        self.args \u003d args"},{"line_number":33,"context_line":"        self.kwargs \u003d kwargs"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_290cd991","line":30,"in_reply_to":"3f79a3b5_8999a26c","updated":"2018-10-23 15:08:18.000000000","message":"Done","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":46,"context_line":"class PlacementState(object):"},{"line_number":47,"context_line":"    \u0027\u0027\u0027Represents the desired state of the Placement DB."},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    For one Neutron agent and the physical devices handled by it."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    In order to sync the state known to us on top of another state"},{"line_number":52,"context_line":"    known to Placement the most generic solution would entail:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_29a64eae","line":49,"updated":"2018-10-18 18:55:26.000000000","message":"nit: The conjunction \"For\" is a coordinating conjunction that is used to connect two clauses together, and so this is not a complete sentence.  I think it would be better to say \"This represents the state of one Neutron agent...\"","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":46,"context_line":"class PlacementState(object):"},{"line_number":47,"context_line":"    \u0027\u0027\u0027Represents the desired state of the Placement DB."},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    For one Neutron agent and the physical devices handled by it."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    In order to sync the state known to us on top of another state"},{"line_number":52,"context_line":"    known to Placement the most generic solution would entail:"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_69bc116b","line":49,"in_reply_to":"3f79a3b5_29a64eae","updated":"2018-10-23 15:08:18.000000000","message":"I originally meant it like this:\n\n Represents the desired state of the Placement DB...\n\n ...for one Neutron agent and the physical devices handled by it.\n\nBut various formatting checker tools (probably not even used here) trained me not to do that.\n\nBut your rephrasal is clearer so I took that.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    known to Placement the most generic solution would entail:"},{"line_number":53,"context_line":"    * Storing state as returned by \u0027show\u0027 methods."},{"line_number":54,"context_line":"    * Diffing two state objects and representing the diff results in terms of"},{"line_number":55,"context_line":"      create/update/delete methods as appropriate."},{"line_number":56,"context_line":"    * Maybe having an alternate constructor so we can express the current state"},{"line_number":57,"context_line":"      known to Placement (and queried by us via \u0027show\u0027 methods) as a"},{"line_number":58,"context_line":"      PlacementState object. That way we could diff between either two"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_49a38a9c","line":55,"updated":"2018-10-18 18:55:26.000000000","message":"Just because you are going into a lengthy discussion of how this works in this docstring (which I love BTW) it might be helpful to note which is considered the source of truth.  That is to say in situations where Neutron and Placement disagree on something which one prevails, or do we do something like take the most recently updated state?","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":52,"context_line":"    known to Placement the most generic solution would entail:"},{"line_number":53,"context_line":"    * Storing state as returned by \u0027show\u0027 methods."},{"line_number":54,"context_line":"    * Diffing two state objects and representing the diff results in terms of"},{"line_number":55,"context_line":"      create/update/delete methods as appropriate."},{"line_number":56,"context_line":"    * Maybe having an alternate constructor so we can express the current state"},{"line_number":57,"context_line":"      known to Placement (and queried by us via \u0027show\u0027 methods) as a"},{"line_number":58,"context_line":"      PlacementState object. That way we could diff between either two"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_b42b5c7a","line":55,"in_reply_to":"3f79a3b5_49a38a9c","updated":"2018-10-23 15:08:18.000000000","message":"Added a paragraph above to answer this.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    Fortunately the Placement API has update methods for many of its"},{"line_number":62,"context_line":"    resources with create-or-update-all semantics. Therefore we have a chance"},{"line_number":63,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":64,"context_line":"    spare the diffing logic."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":67,"context_line":"    that needs to be documented. For example deleting no longer used physnet"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_e9b136e5","line":64,"updated":"2018-10-18 18:55:26.000000000","message":"nit: This last here is also a sentence fragment.  Better would be \"This also avoids the diffing logic.\"","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    Fortunately the Placement API has update methods for many of its"},{"line_number":62,"context_line":"    resources with create-or-update-all semantics. Therefore we have a chance"},{"line_number":63,"context_line":"    to make this class simpler and only know about \u0027update\u0027 methods. And also"},{"line_number":64,"context_line":"    spare the diffing logic."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":67,"context_line":"    that needs to be documented. For example deleting no longer used physnet"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_f45f940d","line":64,"in_reply_to":"3f79a3b5_e9b136e5","updated":"2018-10-23 15:08:18.000000000","message":"Done","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":67,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":68,"context_line":"    traits."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    The methods below return DeferredCall objects containing a code reference"},{"line_number":71,"context_line":"    to one of the Placement client lib methods plus the arguments to be passed"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_09b7d2d9","line":68,"updated":"2018-10-18 18:55:26.000000000","message":"Is this handled in a successor patchset or should this be a #TODO?","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    By ignoring \u0027delete\u0027 here, we leave a few cleanup operations for the admin,"},{"line_number":67,"context_line":"    that needs to be documented. For example deleting no longer used physnet"},{"line_number":68,"context_line":"    traits."},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    The methods below return DeferredCall objects containing a code reference"},{"line_number":71,"context_line":"    to one of the Placement client lib methods plus the arguments to be passed"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_b4635cab","line":68,"in_reply_to":"3f79a3b5_09b7d2d9","updated":"2018-10-23 15:08:18.000000000","message":"We maintain a TODO list here:\n\nhttps://etherpad.openstack.org/p/QoS_minimum_bandwidth_allocation_in_Placement_API\n\nIt\u0027s in line 46. But I can add it here too if you prefer that.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    The methods below return DeferredCall objects containing a code reference"},{"line_number":71,"context_line":"    to one of the Placement client lib methods plus the arguments to be passed"},{"line_number":72,"context_line":"    to those methods. So you can just execute() those DeferredCalls when"},{"line_number":73,"context_line":"    appropriate."},{"line_number":74,"context_line":"    \u0027\u0027\u0027"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def __init__(self,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_a9ab3e6f","line":73,"updated":"2018-10-18 18:55:26.000000000","message":"I love this approach.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    The methods below return DeferredCall objects containing a code reference"},{"line_number":71,"context_line":"    to one of the Placement client lib methods plus the arguments to be passed"},{"line_number":72,"context_line":"    to those methods. So you can just execute() those DeferredCalls when"},{"line_number":73,"context_line":"    appropriate."},{"line_number":74,"context_line":"    \u0027\u0027\u0027"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def __init__(self,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_b4f83cc1","line":73,"in_reply_to":"3f79a3b5_a9ab3e6f","updated":"2018-10-23 15:08:18.000000000","message":"Thanks.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def create_resource_providers(self):"},{"line_number":152,"context_line":"        agent_rp \u003d self._create_agent_rp()"},{"line_number":153,"context_line":"        # XXX(bence romsics): I don\u0027t like digging in the deferred agent"},{"line_number":154,"context_line":"        # object, but without proper Promises I don\u0027t see a significantly"},{"line_number":155,"context_line":"        # nicer solution."},{"line_number":156,"context_line":"        device_rps \u003d self._create_device_rps(agent_rp\u003dagent_rp.kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_c9b0fadf","line":153,"updated":"2018-10-18 18:55:26.000000000","message":"I am not familiar with the #XXX tag; what does it mean?","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def create_resource_providers(self):"},{"line_number":152,"context_line":"        agent_rp \u003d self._create_agent_rp()"},{"line_number":153,"context_line":"        # XXX(bence romsics): I don\u0027t like digging in the deferred agent"},{"line_number":154,"context_line":"        # object, but without proper Promises I don\u0027t see a significantly"},{"line_number":155,"context_line":"        # nicer solution."},{"line_number":156,"context_line":"        device_rps \u003d self._create_device_rps(agent_rp\u003dagent_rp.kwargs)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_d478582d","line":153,"in_reply_to":"3f79a3b5_c9b0fadf","updated":"2018-10-23 15:08:18.000000000","message":"I tend to use this as kind of warning: \"watch out, this works, but it is a bit ugly\". Etimologically I guess it relates to the \"dirty\" connotation of \"XXX\".\n\nI did a quick search to see if others use it in the same sense. It seems to me there are others out there who do. Please see here:\n\nhttps://softwareengineering.stackexchange.com/questions/65467/what-does-xxx-mean-in-a-comment","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        rps.extend(device_rps)"},{"line_number":161,"context_line":"        return rps"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def update_resource_provider_traits(self):"},{"line_number":164,"context_line":"        rp_traits \u003d []"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        physnet_trait_mappings \u003d {}"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_69c5263e","line":163,"updated":"2018-10-18 18:55:26.000000000","message":"I wonder if the functions named \u0027update\u0027 are a bit of a misnomer that could cause logic errors down the road.  I expect a function that is titled \"update_thing\" to update the thing and when it returns the thing\u0027s update has been completed, or at least requires no further action from me.  But in this case - if I follow the code correctly - the update is readied and is waiting for the DeferredCall actions to be executed.  So the update has not actually occurred.\n\nPerhaps a better name would be \"deferred_update_resource_provider_traits\"?","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        rps.extend(device_rps)"},{"line_number":161,"context_line":"        return rps"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"    def update_resource_provider_traits(self):"},{"line_number":164,"context_line":"        rp_traits \u003d []"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        physnet_trait_mappings \u003d {}"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_63e173fd","line":163,"in_reply_to":"3f79a3b5_69c5263e","updated":"2018-10-23 15:08:18.000000000","message":"Done","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        return rp_traits"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    def update_resource_provider_inventories(self):"},{"line_number":191,"context_line":"        rp_inventories \u003d []"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        for device, bw_values in self._rp_bandwidths.items():"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_89c20235","line":190,"updated":"2018-10-18 18:55:26.000000000","message":"See above note about \"update\" naming.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        return rp_traits"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"    def update_resource_provider_inventories(self):"},{"line_number":191,"context_line":"        rp_inventories \u003d []"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        for device, bw_values in self._rp_bandwidths.items():"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_83dccf43","line":190,"in_reply_to":"3f79a3b5_89c20235","updated":"2018-10-23 15:08:18.000000000","message":"Done","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        return rp_inventories"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def sync(self):"},{"line_number":220,"context_line":"        state \u003d []"},{"line_number":221,"context_line":"        state +\u003d self.update_traits()"},{"line_number":222,"context_line":"        state +\u003d self.create_resource_providers()"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_29bf2eac","line":219,"updated":"2018-10-18 18:55:26.000000000","message":"See above note about \"update\" naming.  Here for example a \"sync\" method would often be expected to synchronize things, but here we schedule the things to be synchronized for later execution.  If I was to characterize the purpose of this function, I would say \"get a list of pending changes to accomplish a sync\".  Is that correct?","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        return rp_inventories"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def sync(self):"},{"line_number":220,"context_line":"        state \u003d []"},{"line_number":221,"context_line":"        state +\u003d self.update_traits()"},{"line_number":222,"context_line":"        state +\u003d self.create_resource_providers()"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_c3b3a708","line":219,"in_reply_to":"3f79a3b5_29bf2eac","updated":"2018-10-23 15:08:18.000000000","message":"Exactly.","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"fda19d8a8bb267c95d66172d76adfdd0ec1dbbd1","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2018 Ericsson"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_3abd7202","line":1,"updated":"2018-10-29 10:10:43.000000000","message":"I don\u0027t think that neutron/services is the best place for this module as it\u0027s place for service plugins.\nIMO better would be neutron.agent.common","commit_id":"27d95e5dd0fffb98dfb48385b4791c7000e8cec7"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"45764d2582c4026280333d0d9db15dcf004624e9","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2018 Ericsson"},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_86f576cb","line":1,"in_reply_to":"3f79a3b5_3abd7202","updated":"2018-11-08 15:15:56.000000000","message":"Done","commit_id":"27d95e5dd0fffb98dfb48385b4791c7000e8cec7"}],"neutron/tests/unit/agent/common/test_placement_report.py":[{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"f9e35d07812b2991cc214a4bf03fd1fe18b8e56d","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        self.client_mock.ensure_resource_provider.assert_called_with("},{"line_number":102,"context_line":"            resource_provider\u003d{"},{"line_number":103,"context_line":"                \u0027name\u0027: \u0027fakehost:fake agent type\u0027,"},{"line_number":104,"context_line":"                # uuid -v5 \u002700000000-0000-0000-0000-000000000001\u0027 \u0027fakehost\u0027"},{"line_number":105,"context_line":"                \u0027uuid\u0027: uuid.UUID(\u0027c0b4abe5-516f-54b8-b965-ff94060dcbcc\u0027),"},{"line_number":106,"context_line":"                \u0027parent_provider_uuid\u0027: self.agent_host_rp_uuid})"},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_7f1644f4","line":104,"range":{"start_line":104,"start_character":16,"end_line":104,"end_character":76},"updated":"2019-02-20 21:11:45.000000000","message":"Could we have a bit more explanation about what this mean?\n\nThis same question applied to all below.","commit_id":"7d4432254754c7e00af8293435a3df4c85c79074"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"a9ccdf4b4794f80047a8e790e0ddcde9e80536e8","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        self.client_mock.ensure_resource_provider.assert_called_with("},{"line_number":102,"context_line":"            resource_provider\u003d{"},{"line_number":103,"context_line":"                \u0027name\u0027: \u0027fakehost:fake agent type\u0027,"},{"line_number":104,"context_line":"                # uuid -v5 \u002700000000-0000-0000-0000-000000000001\u0027 \u0027fakehost\u0027"},{"line_number":105,"context_line":"                \u0027uuid\u0027: uuid.UUID(\u0027c0b4abe5-516f-54b8-b965-ff94060dcbcc\u0027),"},{"line_number":106,"context_line":"                \u0027parent_provider_uuid\u0027: self.agent_host_rp_uuid})"},{"line_number":107,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_9301976d","line":104,"range":{"start_line":104,"start_character":16,"end_line":104,"end_character":76},"in_reply_to":"9fdfeff1_7f1644f4","updated":"2019-02-26 17:05:40.000000000","message":"Done","commit_id":"7d4432254754c7e00af8293435a3df4c85c79074"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"f9e35d07812b2991cc214a4bf03fd1fe18b8e56d","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                resource_provider_uuid\u003duuid.UUID("},{"line_number":178,"context_line":"                    \u00271ea6f823-bcf2-5dc5-9bee-4ee6177a6451\u0027),"},{"line_number":179,"context_line":"                inventories\u003d{"},{"line_number":180,"context_line":"                    \u0027NET_BW_EGR_KILOBIT_PER_SEC\u0027: {"},{"line_number":181,"context_line":"                        \u0027total\u0027: 100,"},{"line_number":182,"context_line":"                        \u0027step_size\u0027: 10,"},{"line_number":183,"context_line":"                        \u0027max_unit\u0027: 50}})"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_3f92fc4c","line":180,"range":{"start_line":180,"start_character":21,"end_line":180,"end_character":47},"updated":"2019-02-20 21:11:45.000000000","message":"nit: I guess there is a constant that we can use.","commit_id":"7d4432254754c7e00af8293435a3df4c85c79074"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"a9ccdf4b4794f80047a8e790e0ddcde9e80536e8","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                resource_provider_uuid\u003duuid.UUID("},{"line_number":178,"context_line":"                    \u00271ea6f823-bcf2-5dc5-9bee-4ee6177a6451\u0027),"},{"line_number":179,"context_line":"                inventories\u003d{"},{"line_number":180,"context_line":"                    \u0027NET_BW_EGR_KILOBIT_PER_SEC\u0027: {"},{"line_number":181,"context_line":"                        \u0027total\u0027: 100,"},{"line_number":182,"context_line":"                        \u0027step_size\u0027: 10,"},{"line_number":183,"context_line":"                        \u0027max_unit\u0027: 50}})"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_7333d363","line":180,"range":{"start_line":180,"start_character":21,"end_line":180,"end_character":47},"in_reply_to":"9fdfeff1_3f92fc4c","updated":"2019-02-26 17:05:40.000000000","message":"There is (in neutron_lib.placement.constants), but in tests I intentionally avoid using them in order to\n* keep the test as self-explanatory as it can be and to\n* keep the test independent of later neutron-lib changes.","commit_id":"7d4432254754c7e00af8293435a3df4c85c79074"}],"neutron/tests/unit/services/placement_report/__init__.py":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"45764d2582c4026280333d0d9db15dcf004624e9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"3f79a3b5_46bbdee2","updated":"2018-11-08 15:15:56.000000000","message":"I should have deleted this file.","commit_id":"d40cf20c820a039ab14126ef71bc7c82cc58f739"}],"neutron/tests/unit/services/placement_report/test_state_sync.py":[{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.tests import base"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class DeferredCallTestCase(base.BaseTestCase):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def test_defer(self):"},{"line_number":26,"context_line":"        fun \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_d5b6eb89","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":26},"updated":"2018-09-28 23:57:37.000000000","message":"one test for overridden __str__ can also be added if its buidling func name correctly ?","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from neutron.tests import base"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class DeferredCallTestCase(base.BaseTestCase):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def test_defer(self):"},{"line_number":26,"context_line":"        fun \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_2c9a95c3","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":26},"in_reply_to":"3f79a3b5_d5b6eb89","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class DeferredCallTestCase(base.BaseTestCase):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def test_defer(self):"},{"line_number":26,"context_line":"        fun \u003d mock.Mock()"},{"line_number":27,"context_line":"        state_sync.DeferredCall(fun)"},{"line_number":28,"context_line":"        fun.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_b5980f1a","line":25,"range":{"start_line":25,"start_character":8,"end_line":25,"end_character":18},"updated":"2018-09-28 23:57:37.000000000","message":"\u0027test_defer_not_called\u0027 to make it name explanatory ?","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class DeferredCallTestCase(base.BaseTestCase):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def test_defer(self):"},{"line_number":26,"context_line":"        fun \u003d mock.Mock()"},{"line_number":27,"context_line":"        state_sync.DeferredCall(fun)"},{"line_number":28,"context_line":"        fun.assert_not_called()"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_ec7c9d72","line":25,"range":{"start_line":25,"start_character":8,"end_line":25,"end_character":18},"in_reply_to":"3f79a3b5_b5980f1a","updated":"2018-10-11 12:09:16.000000000","message":"Done","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def test_execute(self):"},{"line_number":31,"context_line":"        fun \u003d mock.Mock()"},{"line_number":32,"context_line":"        deferred \u003d state_sync.DeferredCall(fun, \u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":33,"context_line":"        deferred.execute()"},{"line_number":34,"context_line":"        fun.assert_called_once_with(\u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_358cffd6","line":32,"range":{"start_line":32,"start_character":48,"end_line":32,"end_character":58},"updated":"2018-09-28 23:57:37.000000000","message":"mock.ANY ?","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def test_execute(self):"},{"line_number":31,"context_line":"        fun \u003d mock.Mock()"},{"line_number":32,"context_line":"        deferred \u003d state_sync.DeferredCall(fun, \u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":33,"context_line":"        deferred.execute()"},{"line_number":34,"context_line":"        fun.assert_called_once_with(\u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_f5bbe771","line":32,"range":{"start_line":32,"start_character":66,"end_line":32,"end_character":78},"updated":"2018-09-28 23:57:37.000000000","message":"mock.ANY ?","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def test_execute(self):"},{"line_number":31,"context_line":"        fun \u003d mock.Mock()"},{"line_number":32,"context_line":"        deferred \u003d state_sync.DeferredCall(fun, \u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":33,"context_line":"        deferred.execute()"},{"line_number":34,"context_line":"        fun.assert_called_once_with(\u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_8c908951","line":32,"range":{"start_line":32,"start_character":48,"end_line":32,"end_character":58},"in_reply_to":"3f79a3b5_358cffd6","updated":"2018-10-11 12:09:16.000000000","message":"I do want to test that fun() gets called with *these* arguments. If I used mock.ANY I\u0027d lose that part of the test, wouldn\u0027t I?","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"    def test_execute(self):"},{"line_number":31,"context_line":"        fun \u003d mock.Mock()"},{"line_number":32,"context_line":"        deferred \u003d state_sync.DeferredCall(fun, \u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":33,"context_line":"        deferred.execute()"},{"line_number":34,"context_line":"        fun.assert_called_once_with(\u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_ac746538","line":32,"range":{"start_line":32,"start_character":66,"end_line":32,"end_character":78},"in_reply_to":"3f79a3b5_f5bbe771","updated":"2018-10-11 12:09:16.000000000","message":"the same","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        fun \u003d mock.Mock()"},{"line_number":32,"context_line":"        deferred \u003d state_sync.DeferredCall(fun, \u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":33,"context_line":"        deferred.execute()"},{"line_number":34,"context_line":"        fun.assert_called_once_with(\u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class PlacementStateTestCase(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_b5b1ef93","line":34,"range":{"start_line":34,"start_character":36,"end_line":34,"end_character":66},"updated":"2018-09-28 23:57:37.000000000","message":"mock.ANY, kwarg\u003dmock.ANY if you like the suggestuon at L32","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        fun \u003d mock.Mock()"},{"line_number":32,"context_line":"        deferred \u003d state_sync.DeferredCall(fun, \u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":33,"context_line":"        deferred.execute()"},{"line_number":34,"context_line":"        fun.assert_called_once_with(\u0027some arg\u0027, kwarg\u003d\u0027some kwarg\u0027)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class PlacementStateTestCase(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_cc944139","line":34,"range":{"start_line":34,"start_character":36,"end_line":34,"end_character":66},"in_reply_to":"3f79a3b5_b5b1ef93","updated":"2018-10-11 12:09:16.000000000","message":"the same","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"0198cbe2874a654f488f73d31613931b140d0e3a","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            deferred.execute()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.client_mock.update_trait.assert_called_with("},{"line_number":74,"context_line":"            name\u003d\u0027CUSTOM_PHYSNET_PHYSNET0\u0027)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def test__update_vnic_type_traits(self):"},{"line_number":77,"context_line":"        self.kwargs.update({"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_70104550","line":74,"range":{"start_line":74,"start_character":17,"end_line":74,"end_character":42},"updated":"2018-09-28 23:57:37.000000000","message":"place_utils.physnet_trait(physnet) ?","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"1c918bb869ef94e074db3baa0cc7d55fb1e8e316","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            deferred.execute()"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        self.client_mock.update_trait.assert_called_with("},{"line_number":74,"context_line":"            name\u003d\u0027CUSTOM_PHYSNET_PHYSNET0\u0027)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    def test__update_vnic_type_traits(self):"},{"line_number":77,"context_line":"        self.kwargs.update({"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_e707d616","line":74,"range":{"start_line":74,"start_character":17,"end_line":74,"end_character":42},"in_reply_to":"3f79a3b5_70104550","updated":"2018-10-11 12:09:16.000000000","message":"I don\u0027t think I should use place_utils here, because by that I would open up a chance to make a mistake in one of those utils and not catch that mistake here.","commit_id":"30735ff843ea8b9a154216fff6e574376b249e91"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"6a4b7df60d5d50b04ddbdf1affd783103f94bbbb","unresolved":false,"context_lines":[{"line_number":23,"context_line":"class DeferredCallTestCase(base.BaseTestCase):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def test_defer_not_called(self):"},{"line_number":26,"context_line":"        fun \u003d mock.Mock()"},{"line_number":27,"context_line":"        state_sync.DeferredCall(fun)"},{"line_number":28,"context_line":"        fun.assert_not_called()"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_699c465c","line":26,"updated":"2018-10-18 18:55:26.000000000","message":"See above about s/fun/func/","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"06e4f5d314272d560e2d06e3b7d2c506d3a84079","unresolved":false,"context_lines":[{"line_number":23,"context_line":"class DeferredCallTestCase(base.BaseTestCase):"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"    def test_defer_not_called(self):"},{"line_number":26,"context_line":"        fun \u003d mock.Mock()"},{"line_number":27,"context_line":"        state_sync.DeferredCall(fun)"},{"line_number":28,"context_line":"        fun.assert_not_called()"},{"line_number":29,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_433eb726","line":26,"in_reply_to":"3f79a3b5_699c465c","updated":"2018-10-23 15:08:18.000000000","message":"Done","commit_id":"aecdd821ef1a3f86a27800c14deeeed294a6549b"}]}
