From e9b8d707dadf0f66e41a687ae35a8c93e904adb4 Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Wed, 17 Aug 2022 23:00:35 +0300 Subject: [PATCH] Add new settings to LAUNCH_INSTANCE_DEFAULTS The new settings ``LAUNCH_INSTANCE_DEFAULTS.enable_metadata`` and ``LAUNCH_INSTANCE_DEFAULTS.enable_net_ports`` allow to hide Metadata and Network Ports tabs from launch instance workflow. It is implemented in the similar way to existing enable_scheduler_hints setting and doesn't change default behaviour Change-Id: I3d1ae5ab6cee614dd2c400f66570e320efbe6100 --- doc/source/configuration/settings.rst | 26 +++++++++++++++++++ .../launch-instance-workflow.service.js | 6 +++-- openstack_dashboard/defaults.py | 2 ++ ...le_net_ports_options-8213bb18558031a8.yaml | 6 +++++ 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add_enable_metadata_and_enable_net_ports_options-8213bb18558031a8.yaml diff --git a/doc/source/configuration/settings.rst b/doc/source/configuration/settings.rst index e2cbf0c6ee..5acaaac4a0 100644 --- a/doc/source/configuration/settings.rst +++ b/doc/source/configuration/settings.rst @@ -2174,6 +2174,10 @@ LAUNCH_INSTANCE_DEFAULTS Added the ``default_availability_zone`` option. +.. versionchanged:: 22.3.0(Zed) + + Added the ``enable_metadata``, ``enable_net_ports`` options. + Default: .. code-block:: python @@ -2187,6 +2191,8 @@ Default: "disable_volume": False, "disable_volume_snapshot": False, "enable_scheduler_hints": True, + "enable_metadata": True, + "enable_net_ports": True, "default_availability_zone": "Any", } @@ -2274,6 +2280,26 @@ Default: ``True`` This setting specifies whether or not Scheduler Hints can be provided when launching an instance. +enable_metadata +############### + +.. versionadded:: 22.3.0(Zed) + +Default: ``True`` + +This setting specifies whether or not Metadata can be provided when launching +an instance. + +enable_net_ports +################ + +.. versionadded:: 22.3.0(Zed) + +Default: ``True`` + +This setting specifies whether or not Network Ports can be selected when +launching an instance. + default_availability_zone ######################### diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-workflow.service.js b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-workflow.service.js index 0d5f757836..f9e01d2b2d 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-workflow.service.js +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-workflow.service.js @@ -66,7 +66,8 @@ templateUrl: basePath + 'networkports/ports.html', helpUrl: basePath + 'networkports/ports.help.html', formName: 'launchInstanceNetworkPortForm', - requiredServiceTypes: ['network'] + requiredServiceTypes: ['network'], + setting: 'LAUNCH_INSTANCE_DEFAULTS.enable_net_ports' }, { id: 'secgroups', @@ -112,7 +113,8 @@ title: gettext('Metadata'), templateUrl: basePath + 'metadata/metadata.html', helpUrl: basePath + 'metadata/metadata.help.html', - formName: 'launchInstanceMetadataForm' + formName: 'launchInstanceMetadataForm', + setting: 'LAUNCH_INSTANCE_DEFAULTS.enable_metadata' } ], diff --git a/openstack_dashboard/defaults.py b/openstack_dashboard/defaults.py index 4ed8d1fc58..0023d2aaf4 100644 --- a/openstack_dashboard/defaults.py +++ b/openstack_dashboard/defaults.py @@ -251,6 +251,8 @@ LAUNCH_INSTANCE_DEFAULTS = { 'disable_volume': False, 'disable_volume_snapshot': False, 'enable_scheduler_hints': True, + 'enable_metadata': True, + 'enable_net_ports': True, 'default_availability_zone': 'Any', } diff --git a/releasenotes/notes/add_enable_metadata_and_enable_net_ports_options-8213bb18558031a8.yaml b/releasenotes/notes/add_enable_metadata_and_enable_net_ports_options-8213bb18558031a8.yaml new file mode 100644 index 0000000000..564e4e568d --- /dev/null +++ b/releasenotes/notes/add_enable_metadata_and_enable_net_ports_options-8213bb18558031a8.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + The new settings ``LAUNCH_INSTANCE_DEFAULTS.enable_metadata`` and + ``LAUNCH_INSTANCE_DEFAULTS.enable_net_ports`` allow to hide Metadata and + Network Ports tabs from launch instance workflow.