def _is_safe_to_update_metadata(self, patch, aggregate_uuid):
"""Check if it's safe to update aggregate metadata"""
keys = ['availability_zone', 'affinity_zone']
# Check if this tries to change *keys* to empty.
for patch_dict in patch:
for key in keys:
if patch_dict['path'] == '/metadata/' + key \
and patch_dict['op'] != 'remove':
if not patch_dict['value']:
msg = _("Aggregate %(uuid)s does not support empty "
"named %(key)s") % {"uuid": aggregate_uuid,
"key": key}
raise wsme.exc.ClientSideError(
msg, status_code=http_client.BAD_REQUEST)
else:
self._check_metadata_conflicts(
aggregate_uuid, key, patch_dict['value'])
评论列表
文章目录