~ttx/glance/cactus-final-version

« back to all changes in this revision

Viewing changes to glance/registry/db/api.py

Updated properties should be marked as deleted=0. This allows previously deleted properties to be reactivated on an update.

Add unit tests to check the above condition.

Also updated the help for bin/glance's 'update' command so that it explicitly states:

 Metadata fields that are not specified in the update command will be deleted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
286
286
    """Used internally by image_property_create and image_property_update
287
287
    """
288
288
    _drop_protected_attrs(models.ImageProperty, values)
 
289
    values["deleted"] = False
289
290
    prop_ref.update(values)
290
291
    prop_ref.save(session=session)
291
292
    return prop_ref