diff --git a/doc/source/configuration/settings.rst b/doc/source/configuration/settings.rst index 14f9a3d72c..74c56fd873 100644 --- a/doc/source/configuration/settings.rst +++ b/doc/source/configuration/settings.rst @@ -1872,6 +1872,29 @@ This setting specifies the type of in-browser console used to access the VMs. Valid values are ``"AUTO"``, ``"VNC"``, ``"SPICE"``, ``"RDP"``, ``"SERIAL"``, and ``None``. +ENABLE_FLAVOR_EDIT +~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 12.0.0(Pike) + +.. deprecated:: 12.0.0(Pike) + +Default: ``False`` + +This setting enables the ability to edit flavors. + +.. warning:: + + Historically, Horizon has provided the ability to edit Flavors by deleting + and creating a new one with the same information. This is not supported in + the Nova API and causes unexpected issues and breakages. To avoid breaking + standard deprecation procedure, this code is still in Horizon, but disabled + by default. It will be removed during the 14.0.0 ('R') release cycle. + + See `this email thread + `_ + for further information. + INSTANCE_LOG_LENGTH ~~~~~~~~~~~~~~~~~~~ diff --git a/openstack_dashboard/dashboards/admin/flavors/tables.py b/openstack_dashboard/dashboards/admin/flavors/tables.py index 291a15b9da..96b3a953eb 100644 --- a/openstack_dashboard/dashboards/admin/flavors/tables.py +++ b/openstack_dashboard/dashboards/admin/flavors/tables.py @@ -16,6 +16,7 @@ # License for the specific language governing permissions and limitations # under the License. +from django.conf import settings from django.core.urlresolvers import reverse from django.template import defaultfilters as filters from django.utils.http import urlencode @@ -64,6 +65,9 @@ class UpdateFlavor(tables.LinkAction): classes = ("ajax-modal",) icon = "pencil" + def allowed(self, request, flavor): + return getattr(settings, 'ENABLE_FLAVOR_EDIT', False) + def get_link_url(self, flavor): step = 'update_info' base_url = reverse(self.url, args=[flavor.id]) diff --git a/releasenotes/notes/bug-1709056-33d18a562840e334.yaml b/releasenotes/notes/bug-1709056-33d18a562840e334.yaml new file mode 100644 index 0000000000..10f220c753 --- /dev/null +++ b/releasenotes/notes/bug-1709056-33d18a562840e334.yaml @@ -0,0 +1,6 @@ +upgrade: + - The ability to edit flavors is disabled by default. See + ``ENABLE_FLAVOR_EDIT`` in the settings documentation for more information. +deprecations: + - Editing flavors is deprecated and may be removed from the 'R' cycle + onwards.