From 82b89b0cb77d6416193f81cfc0bb34b7f241dce8 Mon Sep 17 00:00:00 2001 From: Zhenguo Niu Date: Thu, 10 Aug 2017 16:47:18 +0800 Subject: [PATCH] Do not allow update flavor internal attributes This makes it only allow to update '/name', '/is_public', 'disabled' attributes. Partially Implements: bp new-flavor Change-Id: I8eb584ee47ce6bcdc2fe229485fa8540d48aa923 --- mogan/api/controllers/v1/flavors.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mogan/api/controllers/v1/flavors.py b/mogan/api/controllers/v1/flavors.py index 5198f97d..3af45b67 100644 --- a/mogan/api/controllers/v1/flavors.py +++ b/mogan/api/controllers/v1/flavors.py @@ -108,6 +108,13 @@ class FlavorPatchType(types.JsonPatchType): _api_base = Flavor + @staticmethod + def internal_attrs(): + defaults = types.JsonPatchType.internal_attrs() + return defaults + ['/description', '/resources', + '/resource_traits', + '/resource_aggregates'] + class FlavorCollection(base.APIBase): """API representation of a collection of flavor."""