)]}'
{"nova/api/openstack/placement/handlers/allocation.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"3fb2cedd721f27f955ba9fbbef05749736a18ac8","unresolved":false,"context_lines":[{"line_number":246,"context_line":"                        consumer_id\u003dconsumer_uuid,"},{"line_number":247,"context_line":"                        resource_class\u003dresource_class,"},{"line_number":248,"context_line":"                        used\u003dresources[resource_class])"},{"line_number":249,"context_line":"            except exception.InvalidAllocationConstraintsViolated as exc:"},{"line_number":250,"context_line":"                raise webob.exc.HTTPBadRequest("},{"line_number":251,"context_line":"                        _(\"Invalid allocation: %(error)s\") % {\"error\": exc},"},{"line_number":252,"context_line":"                        json_formatter\u003dutil.json_error_formatter)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_8f1404f6","line":249,"updated":"2016-12-13 11:23:35.000000000","message":"This won\u0027t happen here. There\u0027s no action being called on the object, so no validation is done. This exception will only happen once _check_capacity_exceeded is called, which is within AllocationList.create_all() (below).\n\nSo this needs to be moved down there and we need to break up the generic InvalidInventory clause into its more specific subclasses so that we can choose when to 400 and when to 409 and also determine if we want the noisier LOG.exception to stay that way.\n\nSorry, this is apparently more complex than I initially thought.\n\nBTW: The reason I realized this was wrong is because I was trying to confirm if there was a specific gabbi test for this change.","commit_id":"2e6ba3734e6beaa1dbd95abe96f71419e9a5b588"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"16a6af66ea3d2a2677669be12d57c26e05492920","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    allocations \u003d objects.AllocationList(context, objects\u003dallocation_objects)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    try:"},{"line_number":253,"context_line":"        try:"},{"line_number":254,"context_line":"            allocations.create_all()"},{"line_number":255,"context_line":"        except exception.InvalidAllocationConstraintsViolated as exc:"},{"line_number":256,"context_line":"            raise webob.exc.HTTPBadRequest("}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5201f7_c078352e","line":253,"updated":"2017-01-04 15:43:37.000000000","message":"Why is there another try block. There\u0027s just the one call here, so this doesn\u0027t need to be nested does it?","commit_id":"585545f85b05fd0b405fcdacd196893cf5653c11"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"ad257d5960eb5667a8ad68eecfe9a5ee18630ccf","unresolved":false,"context_lines":[{"line_number":250,"context_line":"    allocations \u003d objects.AllocationList(context, objects\u003dallocation_objects)"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"    try:"},{"line_number":253,"context_line":"        try:"},{"line_number":254,"context_line":"            allocations.create_all()"},{"line_number":255,"context_line":"        except exception.InvalidAllocationConstraintsViolated as exc:"},{"line_number":256,"context_line":"            raise webob.exc.HTTPBadRequest("}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5201f7_76f74ff5","line":253,"in_reply_to":"ba5201f7_c078352e","updated":"2017-01-04 16:20:06.000000000","message":"Not sure why it was written like this - blame the holiday memory loss effect. I\u0027ll re-write to clean this up.","commit_id":"585545f85b05fd0b405fcdacd196893cf5653c11"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d68a40b9c27df147804fbda55ed837a90e9b1f46","unresolved":false,"context_lines":[{"line_number":765,"context_line":"        if \u0027id\u0027 in self:"},{"line_number":766,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":767,"context_line":"                                              reason\u003d\u0027already created\u0027)"},{"line_number":768,"context_line":"        if not self.used:"},{"line_number":769,"context_line":"            # Don\u0027t allow allocations of zero resources used."},{"line_number":770,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":771,"context_line":"                    reason\u003d\u0027allocations of 0 resources used not allowed\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_8169a0fb","line":768,"updated":"2016-12-06 10:48:41.000000000","message":"If \u0027used\u0027 has not been set when the object is initialized, or set_obj_defaults has not been called, then this conditional will cause a:\n\n    NotImplementedError: Cannot load \u0027used\u0027 in the base class\n\nso:\n\n    if not \u0027used\u0027 in self or not self.used\n\nmight be the more friendly way to go. We\u0027ll get an error either way, but with the change above it\u0027ll be a bit more informative.","commit_id":"6f15fffe5120a7288ea59f381653f81fad9bf05a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e8d987576888d2e355af9c3d50e7d10ce2fd2968","unresolved":false,"context_lines":[{"line_number":765,"context_line":"        if \u0027id\u0027 in self:"},{"line_number":766,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":767,"context_line":"                                              reason\u003d\u0027already created\u0027)"},{"line_number":768,"context_line":"        if not self.used:"},{"line_number":769,"context_line":"            # Don\u0027t allow allocations of zero resources used."},{"line_number":770,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":771,"context_line":"                    reason\u003d\u0027allocations of 0 resources used not allowed\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_85c99bae","line":768,"in_reply_to":"3a71b18c_8169a0fb","updated":"2016-12-06 16:47:02.000000000","message":"I tried what you suggested, but when I wrote a test for the change, it was impossible to create an Allocation without specifying the \u0027used\u0027 value. If you look at https://github.com/openstack/nova/blob/master/nova/objects/resource_provider.py#L587-L589, it tries to set all the fields defined for the class, and since \u0027used\u0027 is defined for Allocation, you\u0027ll get a KeyError on L589. So I don\u0027t see how you could create an Allocation object with an undefined \u0027used\u0027.","commit_id":"6f15fffe5120a7288ea59f381653f81fad9bf05a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3bf811d9513d92859043b8e7e0d9b54b9e555cde","unresolved":false,"context_lines":[{"line_number":850,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":851,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":852,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"},{"line_number":853,"context_line":"        \u0027used\u0027: fields.IntegerField(),"},{"line_number":854,"context_line":"    }"},{"line_number":855,"context_line":""},{"line_number":856,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a71b18c_8aa2cdfa","line":853,"updated":"2016-12-10 21:35:55.000000000","message":"Couldn\u0027t we just make \u0027used\u0027 a PositiveIntegerField(nullable\u003dFalse) and rely on o.vo internals for that field type?","commit_id":"048f77dd42b6351762ef8754504d45b68a864dc0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d5fc3515881d4fc61b42c4a2c3ccdae54da1d603","unresolved":false,"context_lines":[{"line_number":850,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":851,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":852,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"},{"line_number":853,"context_line":"        \u0027used\u0027: fields.IntegerField(nullable\u003dFalse),"},{"line_number":854,"context_line":"    }"},{"line_number":855,"context_line":""},{"line_number":856,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da4df55a_b45e33e7","line":853,"updated":"2016-12-23 15:53:57.000000000","message":"This does nothing. The default is False:\n\nhttps://github.com/openstack/oslo.versionedobjects/blob/master/oslo_versionedobjects/fields.py#L139","commit_id":"f61a059499beea15d35eb2b7209846c5d6b57522"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e795ec2827a5aeee2fedf70f82ab6ae19121b12f","unresolved":false,"context_lines":[{"line_number":850,"context_line":"        \u0027resource_provider\u0027: fields.ObjectField(\u0027ResourceProvider\u0027),"},{"line_number":851,"context_line":"        \u0027consumer_id\u0027: fields.UUIDField(),"},{"line_number":852,"context_line":"        \u0027resource_class\u0027: fields.ResourceClassField(),"},{"line_number":853,"context_line":"        \u0027used\u0027: fields.IntegerField(nullable\u003dFalse),"},{"line_number":854,"context_line":"    }"},{"line_number":855,"context_line":""},{"line_number":856,"context_line":"    def obj_make_compatible(self, primitive, target_version):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5201f7_5d6d3597","line":853,"in_reply_to":"da4df55a_b45e33e7","updated":"2017-01-03 18:26:04.000000000","message":"Done","commit_id":"f61a059499beea15d35eb2b7209846c5d6b57522"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"16a6af66ea3d2a2677669be12d57c26e05492920","unresolved":false,"context_lines":[{"line_number":892,"context_line":"            # Used is required before calling create()"},{"line_number":893,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":894,"context_line":"                    reason\u003d\u0027no value for the \"used\" amount specified\u0027)"},{"line_number":895,"context_line":"        if not self.used:"},{"line_number":896,"context_line":"            # If the \u0027used\u0027 value is specified, don\u0027t allow allocations of zero"},{"line_number":897,"context_line":"            # resources used."},{"line_number":898,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba5201f7_004b1db1","line":895,"updated":"2017-01-04 15:43:37.000000000","message":"Since the used field is an integer, having an empty string is a separate error so I think it would be usefully more explicit if this was \u0027if self.used \u003c\u003d 0:\u0027","commit_id":"585545f85b05fd0b405fcdacd196893cf5653c11"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"161fc3b7d42589d328ab85868967b63585a9f52e","unresolved":false,"context_lines":[{"line_number":884,"context_line":"        if not result:"},{"line_number":885,"context_line":"            raise exception.NotFound()"},{"line_number":886,"context_line":""},{"line_number":887,"context_line":"    def create(self):"},{"line_number":888,"context_line":"        if \u0027id\u0027 in self:"},{"line_number":889,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":890,"context_line":"                                              reason\u003d\u0027already created\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_74fca072","line":887,"range":{"start_line":887,"start_character":8,"end_line":887,"end_character":14},"updated":"2017-01-04 19:39:20.000000000","message":"I\u0027m actually doubly confused - nothing actually calls this today, right? The REST API calls AllocationList.create_all(), which is why you\u0027re handling InvalidAllocationConstraintsViolated separately in the REST API when POSTing allocations.\n\nSo the code added here is I guess just for safety measures even though nothing actually uses it?","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":889,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":890,"context_line":"                                              reason\u003d\u0027already created\u0027)"},{"line_number":891,"context_line":"        if \u0027used\u0027 not in self:"},{"line_number":892,"context_line":"            # Used is required before calling create()"},{"line_number":893,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":894,"context_line":"                    reason\u003d\u0027no value for the \"used\" amount specified\u0027)"},{"line_number":895,"context_line":"        if self.used \u003c\u003d 0:"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_e99d1d67","line":892,"updated":"2017-01-04 19:23:15.000000000","message":"allocations.used is nullable\u003dFalse in the DB schema, so do we really need to check for this here? We\u0027ll get a DBError if trying to create an allocations record without this set.","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":891,"context_line":"        if \u0027used\u0027 not in self:"},{"line_number":892,"context_line":"            # Used is required before calling create()"},{"line_number":893,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":894,"context_line":"                    reason\u003d\u0027no value for the \"used\" amount specified\u0027)"},{"line_number":895,"context_line":"        if self.used \u003c\u003d 0:"},{"line_number":896,"context_line":"            # Don\u0027t allow negative or zero allocations."},{"line_number":897,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_e9c6fd66","line":894,"range":{"start_line":894,"start_character":27,"end_line":894,"end_character":69},"updated":"2017-01-04 19:23:15.000000000","message":"This should probably be marked for translation.","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":895,"context_line":"        if self.used \u003c\u003d 0:"},{"line_number":896,"context_line":"            # Don\u0027t allow negative or zero allocations."},{"line_number":897,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":898,"context_line":"                    reason\u003d\u0027negative or zero allocations are not allowed\u0027)"},{"line_number":899,"context_line":"        _ensure_rc_cache(self._context)"},{"line_number":900,"context_line":"        updates \u003d self._make_db(self.obj_get_changes())"},{"line_number":901,"context_line":"        db_allocation \u003d self._create_in_db(self._context, updates)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_89ead1aa","line":898,"updated":"2017-01-04 19:23:15.000000000","message":"This should probably be marked for translation also.\n\nThis message is also potentially confusing, this might be more clear:\n\n\u0027the \"used\" amount must be greater than zero\u0027","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d68a40b9c27df147804fbda55ed837a90e9b1f46","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        DISK_GB: disk,"},{"line_number":112,"context_line":"    }"},{"line_number":113,"context_line":"    # Remove any zero allocations."},{"line_number":114,"context_line":"    return {key: val for key, val in alloc_dict.items() if val}"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"class SchedulerReportClient(object):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_41e22830","line":114,"updated":"2016-12-06 10:48:41.000000000","message":"that\u0027s a nicely tidy way to do that","commit_id":"6f15fffe5120a7288ea59f381653f81fad9bf05a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d5fc3515881d4fc61b42c4a2c3ccdae54da1d603","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        DISK_GB: disk,"},{"line_number":112,"context_line":"    }"},{"line_number":113,"context_line":"    # Remove any zero allocations."},{"line_number":114,"context_line":"    return {key: val for key, val in alloc_dict.items() if val}"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"class SchedulerReportClient(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da4df55a_f4827bff","line":114,"updated":"2016-12-23 15:53:57.000000000","message":"The above is fine, of course, but I think it would be best to raise an assertion somewhere if we end up with no allocation records because all requested amounts of resource were zero...","commit_id":"f61a059499beea15d35eb2b7209846c5d6b57522"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e795ec2827a5aeee2fedf70f82ab6ae19121b12f","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        DISK_GB: disk,"},{"line_number":112,"context_line":"    }"},{"line_number":113,"context_line":"    # Remove any zero allocations."},{"line_number":114,"context_line":"    return {key: val for key, val in alloc_dict.items() if val}"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"class SchedulerReportClient(object):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5201f7_1de80de2","line":114,"in_reply_to":"da4df55a_f4827bff","updated":"2017-01-03 18:26:04.000000000","message":"Sure, could do that, but is it even possible to have an instance with zero RAM or zero VCPU?","commit_id":"f61a059499beea15d35eb2b7209846c5d6b57522"}],"nova/tests/unit/objects/test_resource_provider.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d5fc3515881d4fc61b42c4a2c3ccdae54da1d603","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        mock_db_create.assert_called_once_with(self.context, expected)"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    @mock.patch(\u0027nova.objects.resource_provider._ensure_rc_cache\u0027,"},{"line_number":499,"context_line":"            side_effect\u003d_fake_ensure_cache)"},{"line_number":500,"context_line":"    @mock.patch(\u0027nova.objects.Allocation._create_in_db\u0027,"},{"line_number":501,"context_line":"                return_value\u003d_ALLOCATION_DB)"},{"line_number":502,"context_line":"    def test_create_zero_allocation(self, mock_db_create, mock_ensure_cache):"}],"source_content_type":"text/x-python","patch_set":5,"id":"da4df55a_74c92b78","line":499,"updated":"2016-12-23 15:53:57.000000000","message":"femto-nit: alignment.","commit_id":"f61a059499beea15d35eb2b7209846c5d6b57522"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e795ec2827a5aeee2fedf70f82ab6ae19121b12f","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        mock_db_create.assert_called_once_with(self.context, expected)"},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    @mock.patch(\u0027nova.objects.resource_provider._ensure_rc_cache\u0027,"},{"line_number":499,"context_line":"            side_effect\u003d_fake_ensure_cache)"},{"line_number":500,"context_line":"    @mock.patch(\u0027nova.objects.Allocation._create_in_db\u0027,"},{"line_number":501,"context_line":"                return_value\u003d_ALLOCATION_DB)"},{"line_number":502,"context_line":"    def test_create_zero_allocation(self, mock_db_create, mock_ensure_cache):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba5201f7_bd8b811d","line":499,"in_reply_to":"da4df55a_74c92b78","updated":"2017-01-03 18:26:04.000000000","message":"The standard is either visual alignment with the preceding line, or 2 levels (8 spaces in our case). Note that this is simply a copy of the decorator on the method above. I don\u0027t like the inconsistency, though, so I\u0027ll change line 501 to match.","commit_id":"f61a059499beea15d35eb2b7209846c5d6b57522"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":482,"context_line":""},{"line_number":483,"context_line":"    @mock.patch(\u0027nova.objects.resource_provider._ensure_rc_cache\u0027,"},{"line_number":484,"context_line":"            side_effect\u003d_fake_ensure_cache)"},{"line_number":485,"context_line":"    @mock.patch(\u0027nova.objects.Allocation._create_in_db\u0027,"},{"line_number":486,"context_line":"            return_value\u003d_ALLOCATION_DB)"},{"line_number":487,"context_line":"    def test_create_zero_allocation(self, mock_db_create, mock_ensure_cache):"},{"line_number":488,"context_line":"        rp \u003d objects.ResourceProvider(id\u003d_RESOURCE_PROVIDER_ID,"},{"line_number":489,"context_line":"                                      uuid\u003duuids.resource_provider)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_1430b4e7","line":486,"range":{"start_line":485,"start_character":4,"end_line":486,"end_character":40},"updated":"2017-01-04 19:23:15.000000000","message":"Why do we need to mock this out? It\u0027s not called. Neither of these mocks are from what I can tell.","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":492,"context_line":"                                 resource_class\u003d_RESOURCE_CLASS_NAME,"},{"line_number":493,"context_line":"                                 consumer_id\u003duuids.fake_instance,"},{"line_number":494,"context_line":"                                 used\u003d0)"},{"line_number":495,"context_line":"        self. assertRaises(exception.ObjectActionError, obj.create)"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    @mock.patch(\u0027nova.objects.resource_provider._ensure_rc_cache\u0027,"},{"line_number":498,"context_line":"            side_effect\u003d_fake_ensure_cache)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_0902610b","line":495,"range":{"start_line":495,"start_character":13,"end_line":495,"end_character":14},"updated":"2017-01-04 19:23:15.000000000","message":"nit on the whitespace here\n\nAlso, there are multiple ways to get the ObjectActionError when calling create() now, you could make this test a bit more strict by asserting the reason in the exception that comes back from self.assertRaises. See how that\u0027s done on L598.","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":494,"context_line":"                                 used\u003d0)"},{"line_number":495,"context_line":"        self. assertRaises(exception.ObjectActionError, obj.create)"},{"line_number":496,"context_line":""},{"line_number":497,"context_line":"    @mock.patch(\u0027nova.objects.resource_provider._ensure_rc_cache\u0027,"},{"line_number":498,"context_line":"            side_effect\u003d_fake_ensure_cache)"},{"line_number":499,"context_line":"    @mock.patch(\u0027nova.objects.Allocation._create_in_db\u0027)"},{"line_number":500,"context_line":"    def test_create_unspecified_used_fails(self, mock_db_create,"},{"line_number":501,"context_line":"            mock_ensure_cache):"},{"line_number":502,"context_line":"        db \u003d copy.deepcopy(_ALLOCATION_DB)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_347698a4","line":499,"range":{"start_line":497,"start_character":4,"end_line":499,"end_character":56},"updated":"2017-01-04 19:23:15.000000000","message":"these aren\u0027t called so not sure why they are mocked","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                                 resource_provider\u003drp,"},{"line_number":509,"context_line":"                                 resource_class\u003d_RESOURCE_CLASS_NAME,"},{"line_number":510,"context_line":"                                 consumer_id\u003duuids.fake_instance)"},{"line_number":511,"context_line":"        self.assertRaises(exception.ObjectActionError, obj.create)"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"    @mock.patch(\u0027nova.objects.resource_provider._ensure_rc_cache\u0027,"},{"line_number":514,"context_line":"            side_effect\u003d_fake_ensure_cache)"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_547b1c8c","line":511,"updated":"2017-01-04 19:23:15.000000000","message":"same comment as above about asserting the reason for the object action error.","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d8c026bb329f1f8ee9f4698546436f9d7bfa58d8","unresolved":false,"context_lines":[{"line_number":514,"context_line":"            side_effect\u003d_fake_ensure_cache)"},{"line_number":515,"context_line":"    @mock.patch(\u0027nova.objects.Allocation._create_in_db\u0027,"},{"line_number":516,"context_line":"                return_value\u003d_ALLOCATION_DB)"},{"line_number":517,"context_line":"    def test_create_zero_used_fails(self, mock_db_create, mock_ensure_cache):"},{"line_number":518,"context_line":"        rp \u003d objects.ResourceProvider(id\u003d_RESOURCE_PROVIDER_ID,"},{"line_number":519,"context_line":"                                      uuid\u003duuids.resource_provider)"},{"line_number":520,"context_line":"        obj \u003d objects.Allocation(context\u003dself.context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba5201f7_349db8bc","line":517,"range":{"start_line":517,"start_character":8,"end_line":517,"end_character":35},"updated":"2017-01-04 19:23:15.000000000","message":"How is this any different from test_create_zero_allocation above?","commit_id":"8231f08f1fe46b49bd54a488d36c3e5d76f0c43d"}]}
