Clarify conditional_update return types

Comments currently state that conditional_update() returns
an int, but it actually returns a boolean.

Change-Id: I5d2349db2a884c7bea63c2f23da5b666a0d9029c
This commit is contained in:
Eric Harney 2021-11-09 10:19:03 -05:00
parent bada2f2487
commit fb430df6fb
2 changed files with 4 additions and 4 deletions

View File

@ -1935,7 +1935,7 @@ def conditional_update(context, model, values, expected_values, filters=(),
equivalent to read_deleted.
:param project_only: Should the query be limited to context's project.
:param order: Specific order of fields in which to update the values
:returns: Number of db rows that were updated.
:returns: Boolean indicating whether db rows were updated.
"""
return IMPL.conditional_update(context, model, values, expected_values,
filters, include_deleted, project_only,

View File

@ -412,9 +412,9 @@ class CinderPersistentObject(object):
mean in some cases that we have to reload the
object from the database.
:param order: Specific order of fields in which to update the values
:returns: number of db rows that were updated, which can be used as a
boolean, since it will be 0 if we couldn't update the DB and
1 if we could, because we are using unique index id.
:returns: Boolean indicating whether db rows were updated.
It will be False if we couldn't update the DB and
True if we could.
"""
if 'id' not in self.fields:
msg = (_('VersionedObject %s does not support conditional update.')