)]}'
{"osc_placement/resources/inventory.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97819cee3bdca5e314d35f382e1ba3a4d081c672","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    \"\"\"Replaces the set of inventory records for the resource provider."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Note that this is a full replacement of the existing inventory. If you"},{"line_number":105,"context_line":"    want to retain the existing inventory and add a new resource class"},{"line_number":106,"context_line":"    inventory, you must specify all resource class inventory, old and new, or"},{"line_number":107,"context_line":"    specify the --amend option."}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_c7a5e704","line":104,"range":{"start_line":104,"start_character":4,"end_line":104,"end_character":13},"updated":"2019-08-29 13:51:23.000000000","message":"Maybe say \"Note that by default this is a full replacement\" since the sugar that is --amend is mentioned late.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6dabe0e8e760c8ea8435e5ec44a1d3f0f688a1c9","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    \"\"\"Replaces the set of inventory records for the resource provider."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Note that this is a full replacement of the existing inventory. If you"},{"line_number":105,"context_line":"    want to retain the existing inventory and add a new resource class"},{"line_number":106,"context_line":"    inventory, you must specify all resource class inventory, old and new, or"},{"line_number":107,"context_line":"    specify the --amend option."}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_341dc30e","line":104,"range":{"start_line":104,"start_character":4,"end_line":104,"end_character":13},"in_reply_to":"7faddb67_c7a5e704","updated":"2019-09-04 02:22:47.000000000","message":"Done","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97819cee3bdca5e314d35f382e1ba3a4d081c672","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            url \u003d BASE_URL.format(uuid\u003drp[\u0027uuid\u0027])"},{"line_number":179,"context_line":"            if parsed_args.amend:"},{"line_number":180,"context_line":"                # Get existing inventories"},{"line_number":181,"context_line":"                payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":182,"context_line":"                inventories.update(payload[\u0027inventories\u0027])"},{"line_number":183,"context_line":"                payload[\u0027inventories\u0027] \u003d inventories"},{"line_number":184,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_a7578bca","line":181,"updated":"2019-08-29 13:51:23.000000000","message":"I don\u0027t know if we should be paranoid here about trapping any errors if we\u0027re iterating a list of providers from an aggregate, I mean since we just got them above they should exist, but we could race...or it could be large set, e.g. let\u0027s say I have a cell of 200 providers in an aggregate that represents the cell and I want to change some allocation ratio on all of them in aggregate, I guess if you\u0027re automating things theoretically some other external process could delete one of the providers while you\u0027re iterating the list here. Not a huge deal and not something I want to block this on, but could be a follow up hardening opportunity. It would also probably be hard to test that in the functional tests without using some kind of mock.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"4925c3131fff8e57b4de8bfb3e731fc56f543b73","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            url \u003d BASE_URL.format(uuid\u003drp[\u0027uuid\u0027])"},{"line_number":179,"context_line":"            if parsed_args.amend:"},{"line_number":180,"context_line":"                # Get existing inventories"},{"line_number":181,"context_line":"                payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":182,"context_line":"                inventories.update(payload[\u0027inventories\u0027])"},{"line_number":183,"context_line":"                payload[\u0027inventories\u0027] \u003d inventories"},{"line_number":184,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_34f5c383","line":181,"in_reply_to":"7faddb67_34cb8372","updated":"2019-09-04 02:25:23.000000000","message":"As usual, I realized what you meant after I asked and re-read my own comment. You were talking about \"what if the GET fails\". I think we should do a similar \"log and continue\" thing but agreed it will be potentially complicated to test (how to make a GET fail without mocking -- probably not possible, like you said).","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6dabe0e8e760c8ea8435e5ec44a1d3f0f688a1c9","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            url \u003d BASE_URL.format(uuid\u003drp[\u0027uuid\u0027])"},{"line_number":179,"context_line":"            if parsed_args.amend:"},{"line_number":180,"context_line":"                # Get existing inventories"},{"line_number":181,"context_line":"                payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":182,"context_line":"                inventories.update(payload[\u0027inventories\u0027])"},{"line_number":183,"context_line":"                payload[\u0027inventories\u0027] \u003d inventories"},{"line_number":184,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_34cb8372","line":181,"in_reply_to":"7faddb67_a7578bca","updated":"2019-09-04 02:22:47.000000000","message":"Yeah, a race here is definitely possible. I think we\u0027re at least safe from the possibility of accidentally reverting a change made by an external call because of the resource_provider_generation (will fail with a conflict on L194) and then we\u0027ll get the aggregate \"log and continue\" handling. Same if a provider gets deleted underneath us.\n\nThat said, I can\u0027t think of what else we should do here to handle a race. What did you have in mind?","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97819cee3bdca5e314d35f382e1ba3a4d081c672","unresolved":false,"context_lines":[{"line_number":179,"context_line":"            if parsed_args.amend:"},{"line_number":180,"context_line":"                # Get existing inventories"},{"line_number":181,"context_line":"                payload \u003d http.request(\u0027GET\u0027, url).json()"},{"line_number":182,"context_line":"                inventories.update(payload[\u0027inventories\u0027])"},{"line_number":183,"context_line":"                payload[\u0027inventories\u0027] \u003d inventories"},{"line_number":184,"context_line":"            else:"},{"line_number":185,"context_line":"                payload \u003d {\u0027inventories\u0027: inventories,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_0738df9c","line":182,"range":{"start_line":182,"start_character":28,"end_line":182,"end_character":34},"updated":"2019-08-29 13:51:23.000000000","message":"This is really priming the inventories defaultdict with the existing provider inventory and then the next for loop below will overwrite the fields based on what the user provides on the command line, got it.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97819cee3bdca5e314d35f382e1ba3a4d081c672","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                payload[\u0027inventories\u0027] \u003d inventories"},{"line_number":184,"context_line":"            else:"},{"line_number":185,"context_line":"                payload \u003d {\u0027inventories\u0027: inventories,"},{"line_number":186,"context_line":"                           \u0027resource_provider_generation\u0027: rp[\u0027generation\u0027]}"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"            # Apply resource values to inventories"},{"line_number":189,"context_line":"            for r in parsed_args.resource:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_072f7f3e","line":186,"updated":"2019-08-29 13:51:23.000000000","message":"And we don\u0027t need to do this explicitly because L181 gets the payload which has the resource_provider_generation which we don\u0027t expect to change/conflict when we PUT the updates back.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"}],"osc_placement/tests/functional/test_inventory.py":[{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"271253607890e0ef13a50a4a5755d8aed6ed664e","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                      .format(nonexistent_agg), six.text_type(exc))"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def _test_with_aggregate(self, amend\u003dFalse):"},{"line_number":283,"context_line":"        # Set up some existing inventories with two resource providers"},{"line_number":284,"context_line":"        rps \u003d []"},{"line_number":285,"context_line":"        inventory2 \u003d [\u0027VCPU\u003d8\u0027,"},{"line_number":286,"context_line":"                      \u0027VCPU:max_unit\u003d4\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_35d98821","line":283,"range":{"start_line":283,"start_character":8,"end_line":283,"end_character":70},"updated":"2019-08-14 08:48:08.000000000","message":"Well, I would extract this set up part to a new func to be shared...","commit_id":"e31f9fa152ca16a527152c7f8ded57e59dac9c32"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"271253607890e0ef13a50a4a5755d8aed6ed664e","unresolved":false,"context_lines":[{"line_number":343,"context_line":"                                 {r[\u0027resource_class\u0027]: r for r in resp})"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def test_with_aggregate(self):"},{"line_number":346,"context_line":"        self._test_with_aggregate()"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"    def test_amend_with_aggregate(self):"},{"line_number":349,"context_line":"        self._test_with_aggregate(amend\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7faddb67_152d6cfc","line":346,"updated":"2019-08-14 08:48:08.000000000","message":"...and write down each test case explicitly here both in test_with_aggregate and in test_amend_with_aggregate.","commit_id":"e31f9fa152ca16a527152c7f8ded57e59dac9c32"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"18762de6b5e0d278b99748534b5648f9eb281ed6","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            agg, \u0027MEMORY_MB\u003d16\u0027, aggregate\u003dTrue)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def test_amend_multiple_classes(self):"},{"line_number":219,"context_line":"        # Also tests that amending previously nonexistent resource classes"},{"line_number":220,"context_line":"        # results in creation of inventory for them"},{"line_number":221,"context_line":"        # Create a resource provider with no inventory"},{"line_number":222,"context_line":"        rp \u003d self.resource_provider_create()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_2146077d","line":219,"range":{"start_line":219,"start_character":46,"end_line":219,"end_character":74},"updated":"2019-08-31 13:05:53.000000000","message":"nit: nonexistent resource class inventories\n\n... the resource classes of VCPU, MEMORY_MB, are DISK_GB are existent.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97819cee3bdca5e314d35f382e1ba3a4d081c672","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            agg, \u0027MEMORY_MB\u003d16\u0027, aggregate\u003dTrue)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def test_amend_multiple_classes(self):"},{"line_number":219,"context_line":"        # Also tests that amending previously nonexistent resource classes"},{"line_number":220,"context_line":"        # results in creation of inventory for them"},{"line_number":221,"context_line":"        # Create a resource provider with no inventory"},{"line_number":222,"context_line":"        rp \u003d self.resource_provider_create()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_a7da2b48","line":219,"range":{"start_line":219,"start_character":10,"end_line":219,"end_character":14},"updated":"2019-08-29 13:51:23.000000000","message":"nix this","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6dabe0e8e760c8ea8435e5ec44a1d3f0f688a1c9","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            agg, \u0027MEMORY_MB\u003d16\u0027, aggregate\u003dTrue)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def test_amend_multiple_classes(self):"},{"line_number":219,"context_line":"        # Also tests that amending previously nonexistent resource classes"},{"line_number":220,"context_line":"        # results in creation of inventory for them"},{"line_number":221,"context_line":"        # Create a resource provider with no inventory"},{"line_number":222,"context_line":"        rp \u003d self.resource_provider_create()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_547e3f1b","line":219,"range":{"start_line":219,"start_character":46,"end_line":219,"end_character":74},"in_reply_to":"7faddb67_2146077d","updated":"2019-09-04 02:22:47.000000000","message":"Ah, right, thanks. Done.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6dabe0e8e760c8ea8435e5ec44a1d3f0f688a1c9","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            agg, \u0027MEMORY_MB\u003d16\u0027, aggregate\u003dTrue)"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    def test_amend_multiple_classes(self):"},{"line_number":219,"context_line":"        # Also tests that amending previously nonexistent resource classes"},{"line_number":220,"context_line":"        # results in creation of inventory for them"},{"line_number":221,"context_line":"        # Create a resource provider with no inventory"},{"line_number":222,"context_line":"        rp \u003d self.resource_provider_create()"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_b48d3332","line":219,"range":{"start_line":219,"start_character":10,"end_line":219,"end_character":14},"in_reply_to":"7faddb67_a7da2b48","updated":"2019-09-04 02:22:47.000000000","message":"Done","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97819cee3bdca5e314d35f382e1ba3a4d081c672","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        # Also tests that amending previously nonexistent resource classes"},{"line_number":220,"context_line":"        # results in creation of inventory for them"},{"line_number":221,"context_line":"        # Create a resource provider with no inventory"},{"line_number":222,"context_line":"        rp \u003d self.resource_provider_create()"},{"line_number":223,"context_line":"        resp \u003d self.resource_inventory_set("},{"line_number":224,"context_line":"            rp[\u0027uuid\u0027],"},{"line_number":225,"context_line":"            \u0027VCPU\u003d8\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_4797b746","line":222,"range":{"start_line":222,"start_character":18,"end_line":222,"end_character":42},"updated":"2019-08-29 13:51:23.000000000","message":"Does this actually set some default inventory on the provider or is the next line\u0027s call to resource_provider_set the first thing that sets inventory? Because if so, the amend\u003dTrue on that call looks weird because it\u0027s not really amending anything, right? I would have expected something like you create a provider, set some inventory, and then only amend like the VCPU:allocation_ratio\u003d1.0 and assert all of the other previously set inventory values are unchanged.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"18762de6b5e0d278b99748534b5648f9eb281ed6","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        # Also tests that amending previously nonexistent resource classes"},{"line_number":220,"context_line":"        # results in creation of inventory for them"},{"line_number":221,"context_line":"        # Create a resource provider with no inventory"},{"line_number":222,"context_line":"        rp \u003d self.resource_provider_create()"},{"line_number":223,"context_line":"        resp \u003d self.resource_inventory_set("},{"line_number":224,"context_line":"            rp[\u0027uuid\u0027],"},{"line_number":225,"context_line":"            \u0027VCPU\u003d8\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_a1a3d742","line":222,"range":{"start_line":222,"start_character":18,"end_line":222,"end_character":42},"in_reply_to":"7faddb67_4797b746","updated":"2019-08-31 13:05:53.000000000","message":"It is good IMO to not remove the existing test to clear that it doesn\u0027t raise error to amend previously non-inventory resource class (unless the total value is missed) and that that results in creation of the inventory of that resource class,\n\nbut yeah, it is better to have one more test to amend previously existing inventory, which is properer to describe the use case of the option.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6dabe0e8e760c8ea8435e5ec44a1d3f0f688a1c9","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        # Also tests that amending previously nonexistent resource classes"},{"line_number":220,"context_line":"        # results in creation of inventory for them"},{"line_number":221,"context_line":"        # Create a resource provider with no inventory"},{"line_number":222,"context_line":"        rp \u003d self.resource_provider_create()"},{"line_number":223,"context_line":"        resp \u003d self.resource_inventory_set("},{"line_number":224,"context_line":"            rp[\u0027uuid\u0027],"},{"line_number":225,"context_line":"            \u0027VCPU\u003d8\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_14a1a795","line":222,"range":{"start_line":222,"start_character":18,"end_line":222,"end_character":42},"in_reply_to":"7faddb67_a1a3d742","updated":"2019-09-04 02:22:47.000000000","message":"Yeah, what Tetsuro said. I did this to make sure --amend will create nonexistent inventory (IIRC an earlier iteration of this patch did not do that correctly).\n\nAgreed we should test both cases but I thought I\u0027m already testing the \"amend only one field\" behavior in the test_amend_with_aggregate. I suppose maybe we also want a non-aggregate test though. I can add that.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"97819cee3bdca5e314d35f382e1ba3a4d081c672","unresolved":false,"context_lines":[{"line_number":380,"context_line":"            for rp in rps:"},{"line_number":381,"context_line":"                old_invs.append(default_inventory)"},{"line_number":382,"context_line":"        # Now, go ahead and update the allocation ratios and verify"},{"line_number":383,"context_line":"        new_resources \u003d [\u0027VCPU:allocation_ratio\u003d5.0\u0027,"},{"line_number":384,"context_line":"                         \u0027VCPU:total\u003d8\u0027,"},{"line_number":385,"context_line":"                         \u0027MEMORY_MB:allocation_ratio\u003d6.0\u0027,"},{"line_number":386,"context_line":"                         \u0027MEMORY_MB:total\u003d1024\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_47a5779e","line":383,"updated":"2019-08-29 13:51:23.000000000","message":"This isn\u0027t really testing the amend behavior as we\u0027d expect normally from a user, right? This is a full replacement because that\u0027s what the test had to do originally. Like above, I would expect something more like if amend, just update VCPU:allocation_ratio but leave the rest. Your assertion logic later on the expected inventory after calling resource_inventory_set would have to change to account for the one field you amended, but that seems pretty trivial.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6dabe0e8e760c8ea8435e5ec44a1d3f0f688a1c9","unresolved":false,"context_lines":[{"line_number":380,"context_line":"            for rp in rps:"},{"line_number":381,"context_line":"                old_invs.append(default_inventory)"},{"line_number":382,"context_line":"        # Now, go ahead and update the allocation ratios and verify"},{"line_number":383,"context_line":"        new_resources \u003d [\u0027VCPU:allocation_ratio\u003d5.0\u0027,"},{"line_number":384,"context_line":"                         \u0027VCPU:total\u003d8\u0027,"},{"line_number":385,"context_line":"                         \u0027MEMORY_MB:allocation_ratio\u003d6.0\u0027,"},{"line_number":386,"context_line":"                         \u0027MEMORY_MB:total\u003d1024\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_d4d46fec","line":383,"in_reply_to":"7faddb67_47a5779e","updated":"2019-09-04 02:22:47.000000000","message":"It is testing the amend behavior we expect, but it\u0027s not obvious because of what I later learned placement does to default most of the inventory fields. In _setup_two_resource_providers_in_aggregate, we set DISK_GB step_size and min_unit to 2, but placement would default those to 1 if it did a full replacement.\n\nBut yeah, it would be better to make this more obvious by amending only one resource class inventory field. I wrote this originally before I learned about the defaulting that placement does and I didn\u0027t think to change it.","commit_id":"d5ae9182a0a6a79d026aa1398af4ece18b4665ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8c5a2851b250ab50e7ca136c4e432871094833ee","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            \u0027DISK_GB:allocation_ratio\u003d1.5\u0027,"},{"line_number":231,"context_line":"            \u0027DISK_GB:min_unit\u003d2\u0027,"},{"line_number":232,"context_line":"            \u0027DISK_GB:step_size\u003d2\u0027,"},{"line_number":233,"context_line":"            amend\u003dTrue)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        def check(inventories):"},{"line_number":236,"context_line":"            self.assertEqual(8, inventories[\u0027VCPU\u0027][\u0027total\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_923b56c6","line":233,"range":{"start_line":233,"start_character":18,"end_line":233,"end_character":22},"updated":"2019-09-04 20:49:30.000000000","message":"Would this be the same if this were False?","commit_id":"0ce562fbb01aaafc2c305a671fbbae1afcff03ff"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9186fda2ad3d95a25945c61ae098c5d735835481","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            \u0027DISK_GB:allocation_ratio\u003d1.5\u0027,"},{"line_number":231,"context_line":"            \u0027DISK_GB:min_unit\u003d2\u0027,"},{"line_number":232,"context_line":"            \u0027DISK_GB:step_size\u003d2\u0027,"},{"line_number":233,"context_line":"            amend\u003dTrue)"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        def check(inventories):"},{"line_number":236,"context_line":"            self.assertEqual(8, inventories[\u0027VCPU\u0027][\u0027total\u0027])"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_3b135d5b","line":233,"range":{"start_line":233,"start_character":18,"end_line":233,"end_character":22},"in_reply_to":"7faddb67_923b56c6","updated":"2019-09-04 20:59:16.000000000","message":"The result would be the same but I\u0027m passing amend\u003dTrue to verify that an amend of an empty inventory results in creation of new inventory. (We already have test coverage of a full replacement working correctly to create new inventory).\n\nI had a bug in an earlier version of this patch (maybe only in a local version) where passing amend\u003dTrue when existing inventories were empty didn\u0027t work correctly. I can\u0027t remember what was wrong or how it happened though.","commit_id":"0ce562fbb01aaafc2c305a671fbbae1afcff03ff"}]}
