From a2baffdccec6a792b90534d0341b772d696645c1 Mon Sep 17 00:00:00 2001 From: Chris Dent Date: Wed, 3 Jan 2018 19:45:33 +0000 Subject: [PATCH] Document lack of side-effects in AllocationList.create_all() In I3c7aea7d8959a20c3c404bc6616b47336ff40b67 a request was made for clarifying documentation on the behavior of AllocationList.create_all(). The database id is not set as a ide-effect on the created objects. Change-Id: I8a77a8146b6ec6babf5cb0897ed70fa3b2936b4e --- nova/objects/resource_provider.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nova/objects/resource_provider.py b/nova/objects/resource_provider.py index 9a09b398ae..26efaf7fe9 100644 --- a/nova/objects/resource_provider.py +++ b/nova/objects/resource_provider.py @@ -2141,7 +2141,12 @@ class AllocationList(base.ObjectListBase, base.NovaObject): return alloc_list def create_all(self): - """Create the supplied allocations.""" + """Create the supplied allocations. + + Note that the Allocation objects that are created are not + returned to the caller, nor are their database ids set. If + those ids are required use one of the get_all_by* methods. + """ # TODO(jaypipes): Retry the allocation writes on # ConcurrentUpdateDetected self._set_allocations(self._context, self.objects)