Define default settings explicitly (openstack_dashboard 3/5)
This commit mainly covers settings in openstack_dashboard/dashboards/project/. Part of blueprint ini-based-configuration Change-Id: I22413d2fe20576a507634dc4e2d0354c7db8800a
This commit is contained in:
parent
5b3f506921
commit
fcdc67b819
@ -119,8 +119,7 @@ def download_ec2_bundle(request):
|
|||||||
|
|
||||||
|
|
||||||
def download_rc_file(request):
|
def download_rc_file(request):
|
||||||
template = getattr(settings, 'OPENRC_CUSTOM_TEMPLATE',
|
template = settings.OPENRC_CUSTOM_TEMPLATE
|
||||||
'project/api_access/openrc.sh.template')
|
|
||||||
|
|
||||||
context = _get_openrc_credentials(request)
|
context = _get_openrc_credentials(request)
|
||||||
# make v3 specific changes
|
# make v3 specific changes
|
||||||
@ -139,17 +138,13 @@ def download_rc_file(request):
|
|||||||
|
|
||||||
|
|
||||||
def download_clouds_yaml_file(request):
|
def download_clouds_yaml_file(request):
|
||||||
template = getattr(settings, 'OPENSTACK_CLOUDS_YAML_CUSTOM_TEMPLATE',
|
template = settings.OPENSTACK_CLOUDS_YAML_CUSTOM_TEMPLATE
|
||||||
'project/api_access/clouds.yaml.template')
|
|
||||||
|
|
||||||
context = _get_openrc_credentials(request)
|
context = _get_openrc_credentials(request)
|
||||||
context['cloud_name'] = getattr(
|
context['cloud_name'] = settings.OPENSTACK_CLOUDS_YAML_NAME
|
||||||
settings, "OPENSTACK_CLOUDS_YAML_NAME", 'openstack')
|
context['profile'] = settings.OPENSTACK_CLOUDS_YAML_PROFILE
|
||||||
context['profile'] = getattr(
|
|
||||||
settings, "OPENSTACK_CLOUDS_YAML_PROFILE", None)
|
|
||||||
context['regions'] = [
|
context['regions'] = [
|
||||||
region_tuple[1] for region_tuple in getattr(
|
region_tuple[1] for region_tuple in settings.AVAILABLE_REGIONS
|
||||||
settings, "AVAILABLE_REGIONS", [])
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if utils.get_keystone_version() >= 3:
|
if utils.get_keystone_version() >= 3:
|
||||||
|
@ -25,5 +25,5 @@ class FloatingIps(horizon.Panel):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def can_register():
|
def can_register():
|
||||||
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
|
network_config = settings.OPENSTACK_NEUTRON_NETWORK
|
||||||
return network_config.get('enable_router', True)
|
return network_config['enable_router']
|
||||||
|
@ -36,8 +36,8 @@ from openstack_dashboard import api
|
|||||||
from openstack_dashboard import policy
|
from openstack_dashboard import policy
|
||||||
|
|
||||||
|
|
||||||
IMAGE_BACKEND_SETTINGS = getattr(settings, 'OPENSTACK_IMAGE_BACKEND', {})
|
IMAGE_BACKEND_SETTINGS = settings.OPENSTACK_IMAGE_BACKEND
|
||||||
IMAGE_FORMAT_CHOICES = IMAGE_BACKEND_SETTINGS.get('image_formats', [])
|
IMAGE_FORMAT_CHOICES = IMAGE_BACKEND_SETTINGS['image_formats']
|
||||||
|
|
||||||
|
|
||||||
class ImageURLField(forms.URLField):
|
class ImageURLField(forms.URLField):
|
||||||
@ -158,7 +158,7 @@ class CreateImageForm(CreateParent):
|
|||||||
if api.glance.VERSIONS.active >= 2:
|
if api.glance.VERSIONS.active >= 2:
|
||||||
# NOTE: GlanceV2 doesn't support copy-from feature, sorry!
|
# NOTE: GlanceV2 doesn't support copy-from feature, sorry!
|
||||||
self._hide_is_copying()
|
self._hide_is_copying()
|
||||||
if not getattr(settings, 'IMAGES_ALLOW_LOCATION', False):
|
if not settings.IMAGES_ALLOW_LOCATION:
|
||||||
self._hide_url_source_type()
|
self._hide_url_source_type()
|
||||||
if (api.glance.get_image_upload_mode() == 'off' or not
|
if (api.glance.get_image_upload_mode() == 'off' or not
|
||||||
policy.check((("image", "upload_image"),), request)):
|
policy.check((("image", "upload_image"),), request)):
|
||||||
|
@ -190,7 +190,7 @@ class UpdateMetadata(tables.LinkAction):
|
|||||||
|
|
||||||
|
|
||||||
def filter_tenants():
|
def filter_tenants():
|
||||||
return getattr(settings, 'IMAGES_LIST_FILTER_TENANTS', [])
|
return settings.IMAGES_LIST_FILTER_TENANTS
|
||||||
|
|
||||||
|
|
||||||
def filter_tenant_ids():
|
def filter_tenant_ids():
|
||||||
@ -347,9 +347,9 @@ class ImagesTable(tables.DataTable):
|
|||||||
verbose_name = _("Images")
|
verbose_name = _("Images")
|
||||||
table_actions = (OwnerFilter, CreateImage, DeleteImage,)
|
table_actions = (OwnerFilter, CreateImage, DeleteImage,)
|
||||||
launch_actions = ()
|
launch_actions = ()
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_LEGACY_ENABLED', False):
|
if settings.LAUNCH_INSTANCE_LEGACY_ENABLED:
|
||||||
launch_actions = (LaunchImage,) + launch_actions
|
launch_actions = (LaunchImage,) + launch_actions
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', True):
|
if settings.LAUNCH_INSTANCE_NG_ENABLED:
|
||||||
launch_actions = (LaunchImageNG,) + launch_actions
|
launch_actions = (LaunchImageNG,) + launch_actions
|
||||||
row_actions = launch_actions + (CreateVolumeFromImage,
|
row_actions = launch_actions + (CreateVolumeFromImage,
|
||||||
EditImage, UpdateMetadata,
|
EditImage, UpdateMetadata,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from django import conf
|
from django.conf import settings
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from horizon import tabs
|
from horizon import tabs
|
||||||
@ -25,8 +25,7 @@ class OverviewTab(tabs.Tab):
|
|||||||
|
|
||||||
def get_context_data(self, request):
|
def get_context_data(self, request):
|
||||||
image = self.tab_group.kwargs['image']
|
image = self.tab_group.kwargs['image']
|
||||||
custom_titles = getattr(conf.settings,
|
custom_titles = settings.IMAGE_CUSTOM_PROPERTY_TITLES
|
||||||
'IMAGE_CUSTOM_PROPERTY_TITLES', {})
|
|
||||||
image_props = []
|
image_props = []
|
||||||
for prop, val in image.properties.items():
|
for prop, val in image.properties.items():
|
||||||
if prop == 'description':
|
if prop == 'description':
|
||||||
|
@ -71,9 +71,7 @@ class CreateView(forms.ModalFormView):
|
|||||||
context = super(CreateView, self).get_context_data(**kwargs)
|
context = super(CreateView, self).get_context_data(**kwargs)
|
||||||
upload_mode = api.glance.get_image_upload_mode()
|
upload_mode = api.glance.get_image_upload_mode()
|
||||||
context['image_upload_enabled'] = upload_mode != 'off'
|
context['image_upload_enabled'] = upload_mode != 'off'
|
||||||
context['images_allow_location'] = getattr(settings,
|
context['images_allow_location'] = settings.IMAGES_ALLOW_LOCATION
|
||||||
'IMAGES_ALLOW_LOCATION',
|
|
||||||
False)
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
@ -557,8 +557,9 @@ class ConsoleLink(policy.PolicyTargetMixin, tables.LinkAction):
|
|||||||
def allowed(self, request, instance=None):
|
def allowed(self, request, instance=None):
|
||||||
# We check if ConsoleLink is allowed only if settings.CONSOLE_TYPE is
|
# We check if ConsoleLink is allowed only if settings.CONSOLE_TYPE is
|
||||||
# not set at all, or if it's set to any value other than None or False.
|
# not set at all, or if it's set to any value other than None or False.
|
||||||
return bool(getattr(settings, 'CONSOLE_TYPE', True)) and \
|
return (bool(settings.CONSOLE_TYPE) and
|
||||||
instance.status in ACTIVE_STATES and not is_deleting(instance)
|
instance.status in ACTIVE_STATES and
|
||||||
|
not is_deleting(instance))
|
||||||
|
|
||||||
def get_link_url(self, datum):
|
def get_link_url(self, datum):
|
||||||
base_url = super(ConsoleLink, self).get_link_url(datum)
|
base_url = super(ConsoleLink, self).get_link_url(datum)
|
||||||
@ -660,10 +661,7 @@ class DecryptInstancePassword(tables.LinkAction):
|
|||||||
url = "horizon:project:instances:decryptpassword"
|
url = "horizon:project:instances:decryptpassword"
|
||||||
|
|
||||||
def allowed(self, request, instance):
|
def allowed(self, request, instance):
|
||||||
enable = getattr(settings,
|
return (settings.OPENSTACK_ENABLE_PASSWORD_RETRIEVE and
|
||||||
'OPENSTACK_ENABLE_PASSWORD_RETRIEVE',
|
|
||||||
False)
|
|
||||||
return (enable and
|
|
||||||
(instance.status in ACTIVE_STATES or
|
(instance.status in ACTIVE_STATES or
|
||||||
instance.status == 'SHUTOFF') and
|
instance.status == 'SHUTOFF') and
|
||||||
not is_deleting(instance) and
|
not is_deleting(instance) and
|
||||||
@ -1293,9 +1291,9 @@ class InstancesTable(tables.DataTable):
|
|||||||
row_class = UpdateRow
|
row_class = UpdateRow
|
||||||
table_actions_menu = (StartInstance, StopInstance, SoftRebootInstance)
|
table_actions_menu = (StartInstance, StopInstance, SoftRebootInstance)
|
||||||
launch_actions = ()
|
launch_actions = ()
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_LEGACY_ENABLED', False):
|
if settings.LAUNCH_INSTANCE_LEGACY_ENABLED:
|
||||||
launch_actions = (LaunchLink,) + launch_actions
|
launch_actions = (LaunchLink,) + launch_actions
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', True):
|
if settings.LAUNCH_INSTANCE_NG_ENABLED:
|
||||||
launch_actions = (LaunchLinkNG,) + launch_actions
|
launch_actions = (LaunchLinkNG,) + launch_actions
|
||||||
table_actions = launch_actions + (DeleteInstance,
|
table_actions = launch_actions + (DeleteInstance,
|
||||||
InstancesFilterAction)
|
InstancesFilterAction)
|
||||||
|
@ -93,7 +93,7 @@ class ConsoleTab(tabs.Tab):
|
|||||||
|
|
||||||
def get_context_data(self, request):
|
def get_context_data(self, request):
|
||||||
instance = self.tab_group.kwargs['instance']
|
instance = self.tab_group.kwargs['instance']
|
||||||
console_type = getattr(settings, 'CONSOLE_TYPE', 'AUTO')
|
console_type = settings.CONSOLE_TYPE
|
||||||
console_url = None
|
console_url = None
|
||||||
try:
|
try:
|
||||||
console_type, console_url = console.get_console(
|
console_type, console_url = console.get_console(
|
||||||
@ -112,7 +112,7 @@ class ConsoleTab(tabs.Tab):
|
|||||||
def allowed(self, request):
|
def allowed(self, request):
|
||||||
# The ConsoleTab is available if settings.CONSOLE_TYPE is not set at
|
# The ConsoleTab is available if settings.CONSOLE_TYPE is not set at
|
||||||
# all, or if it's set to any value other than None or False.
|
# all, or if it's set to any value other than None or False.
|
||||||
return bool(getattr(settings, 'CONSOLE_TYPE', True))
|
return bool(settings.CONSOLE_TYPE)
|
||||||
|
|
||||||
|
|
||||||
class AuditTab(tabs.TableTab):
|
class AuditTab(tabs.TableTab):
|
||||||
|
@ -890,7 +890,7 @@ class InstanceTableTests(InstanceTestBase, InstanceTableTestMixin):
|
|||||||
api.network: ('servers_update_addresses',),
|
api.network: ('servers_update_addresses',),
|
||||||
api.cinder: ('volume_list',)})
|
api.cinder: ('volume_list',)})
|
||||||
def test_suspend_instance_if_placed_on_2nd_page(self):
|
def test_suspend_instance_if_placed_on_2nd_page(self):
|
||||||
page_size = getattr(settings, 'API_RESULT_PAGE_SIZE', 2)
|
page_size = settings.API_RESULT_PAGE_SIZE
|
||||||
servers = self.servers.list()[:3]
|
servers = self.servers.list()[:3]
|
||||||
|
|
||||||
self.mock_extension_supported.return_value = True
|
self.mock_extension_supported.return_value = True
|
||||||
@ -4992,7 +4992,7 @@ class InstanceTests2(InstanceTestBase, InstanceTableTestMixin):
|
|||||||
# The form action on the next page should have marker
|
# The form action on the next page should have marker
|
||||||
# object from the previous page last element.
|
# object from the previous page last element.
|
||||||
|
|
||||||
page_size = getattr(settings, 'API_RESULT_PAGE_SIZE', 2)
|
page_size = settings.API_RESULT_PAGE_SIZE
|
||||||
servers = self.servers.list()[:3]
|
servers = self.servers.list()[:3]
|
||||||
|
|
||||||
self._mock_extension_supported({'AdminActions': True,
|
self._mock_extension_supported({'AdminActions': True,
|
||||||
@ -5076,7 +5076,7 @@ class InstanceTests2(InstanceTestBase, InstanceTableTestMixin):
|
|||||||
def test_delete_instance_with_pagination(self):
|
def test_delete_instance_with_pagination(self):
|
||||||
# Instance should be deleted from the next page.
|
# Instance should be deleted from the next page.
|
||||||
|
|
||||||
page_size = getattr(settings, 'API_RESULT_PAGE_SIZE', 2)
|
page_size = settings.API_RESULT_PAGE_SIZE
|
||||||
servers = self.servers.list()[:3]
|
servers = self.servers.list()[:3]
|
||||||
server = servers[-1]
|
server = servers[-1]
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ def sort_flavor_list(request, flavors, with_menu_label=True):
|
|||||||
'"ram" instead.', sort_key)
|
'"ram" instead.', sort_key)
|
||||||
return getattr(flavor, 'ram')
|
return getattr(flavor, 'ram')
|
||||||
try:
|
try:
|
||||||
flavor_sort = getattr(settings, 'CREATE_INSTANCE_FLAVOR_SORT', {})
|
flavor_sort = settings.CREATE_INSTANCE_FLAVOR_SORT
|
||||||
sort_key = flavor_sort.get('key', 'ram')
|
sort_key = flavor_sort.get('key', 'ram')
|
||||||
rev = flavor_sort.get('reverse', False)
|
rev = flavor_sort.get('reverse', False)
|
||||||
if not callable(sort_key):
|
if not callable(sort_key):
|
||||||
|
@ -125,8 +125,7 @@ class IndexView(tables.PagedTableMixin, tables.DataTableView):
|
|||||||
# nova network info cache is not synced. Precisely there is no
|
# nova network info cache is not synced. Precisely there is no
|
||||||
# need to check IP addresses of all servers. It is sufficient to
|
# need to check IP addresses of all servers. It is sufficient to
|
||||||
# fetch IP address information for servers recently updated.
|
# fetch IP address information for servers recently updated.
|
||||||
if not getattr(settings,
|
if not settings.OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES:
|
||||||
'OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES', True):
|
|
||||||
return instances
|
return instances
|
||||||
try:
|
try:
|
||||||
api.network.servers_update_addresses(self.request, instances)
|
api.network.servers_update_addresses(self.request, instances)
|
||||||
@ -263,8 +262,8 @@ class LaunchInstanceView(workflows.WorkflowView):
|
|||||||
initial = super(LaunchInstanceView, self).get_initial()
|
initial = super(LaunchInstanceView, self).get_initial()
|
||||||
initial['project_id'] = self.request.user.tenant_id
|
initial['project_id'] = self.request.user.tenant_id
|
||||||
initial['user_id'] = self.request.user.id
|
initial['user_id'] = self.request.user.id
|
||||||
defaults = getattr(settings, 'LAUNCH_INSTANCE_DEFAULTS', {})
|
defaults = settings.LAUNCH_INSTANCE_DEFAULTS
|
||||||
initial['config_drive'] = defaults.get('config_drive', False)
|
initial['config_drive'] = defaults['config_drive']
|
||||||
return initial
|
return initial
|
||||||
|
|
||||||
|
|
||||||
@ -285,7 +284,7 @@ def console(request, instance_id):
|
|||||||
|
|
||||||
|
|
||||||
def auto_console(request, instance_id):
|
def auto_console(request, instance_id):
|
||||||
console_type = getattr(settings, 'CONSOLE_TYPE', 'AUTO')
|
console_type = settings.CONSOLE_TYPE
|
||||||
try:
|
try:
|
||||||
instance = api.nova.server_get(request, instance_id)
|
instance = api.nova.server_get(request, instance_id)
|
||||||
console_url = project_console.get_console(request, console_type,
|
console_url = project_console.get_console(request, console_type,
|
||||||
|
@ -28,7 +28,7 @@ def get_context(request, context=None):
|
|||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
|
|
||||||
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
|
network_config = settings.OPENSTACK_NEUTRON_NETWORK
|
||||||
|
|
||||||
context['launch_instance_allowed'] = policy.check(
|
context['launch_instance_allowed'] = policy.check(
|
||||||
(("compute", "os_compute_api:servers:create"),), request)
|
(("compute", "os_compute_api:servers:create"),), request)
|
||||||
@ -37,14 +37,14 @@ def get_context(request, context=None):
|
|||||||
(("network", "create_network"),), request)
|
(("network", "create_network"),), request)
|
||||||
context['network_quota_exceeded'] = _quota_exceeded(request, 'network')
|
context['network_quota_exceeded'] = _quota_exceeded(request, 'network')
|
||||||
context['create_router_allowed'] = (
|
context['create_router_allowed'] = (
|
||||||
network_config.get('enable_router', True) and
|
network_config['enable_router'] and
|
||||||
policy.check((("network", "create_router"),), request))
|
policy.check((("network", "create_router"),), request))
|
||||||
context['router_quota_exceeded'] = _quota_exceeded(request, 'router')
|
context['router_quota_exceeded'] = _quota_exceeded(request, 'router')
|
||||||
context['console_type'] = getattr(settings, 'CONSOLE_TYPE', 'AUTO')
|
context['console_type'] = settings.CONSOLE_TYPE
|
||||||
context['show_ng_launch'] = (
|
context['show_ng_launch'] = (
|
||||||
base.is_service_enabled(request, 'compute') and
|
base.is_service_enabled(request, 'compute') and
|
||||||
getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', True))
|
settings.LAUNCH_INSTANCE_NG_ENABLED)
|
||||||
context['show_legacy_launch'] = (
|
context['show_legacy_launch'] = (
|
||||||
base.is_service_enabled(request, 'compute') and
|
base.is_service_enabled(request, 'compute') and
|
||||||
getattr(settings, 'LAUNCH_INSTANCE_LEGACY_ENABLED', False))
|
settings.LAUNCH_INSTANCE_LEGACY_ENABLED)
|
||||||
return context
|
return context
|
||||||
|
@ -214,8 +214,8 @@ class JSONView(View):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_router_enabled(self):
|
def is_router_enabled(self):
|
||||||
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
|
network_config = settings.OPENSTACK_NEUTRON_NETWORK
|
||||||
return network_config.get('enable_router', True)
|
return network_config['enable_router']
|
||||||
|
|
||||||
def add_resource_url(self, view, resources):
|
def add_resource_url(self, view, resources):
|
||||||
tenant_id = self.request.user.tenant_id
|
tenant_id = self.request.user.tenant_id
|
||||||
@ -239,7 +239,7 @@ class JSONView(View):
|
|||||||
except Exception:
|
except Exception:
|
||||||
servers = []
|
servers = []
|
||||||
data = []
|
data = []
|
||||||
console_type = getattr(settings, 'CONSOLE_TYPE', 'AUTO')
|
console_type = settings.CONSOLE_TYPE
|
||||||
# lowercase of the keys will be used at the end of the console URL.
|
# lowercase of the keys will be used at the end of the console URL.
|
||||||
for server in servers:
|
for server in servers:
|
||||||
server_data = {'name': server.name,
|
server_data = {'name': server.name,
|
||||||
|
@ -160,9 +160,8 @@ class CreatePortInfoAction(workflows.Action):
|
|||||||
return is_supproted
|
return is_supproted
|
||||||
|
|
||||||
def _populate_vnic_type_choices(self, request):
|
def _populate_vnic_type_choices(self, request):
|
||||||
neutron_settings = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
|
neutron_settings = settings.OPENSTACK_NEUTRON_NETWORK
|
||||||
supported_vnic_types = neutron_settings.get('supported_vnic_types',
|
supported_vnic_types = neutron_settings['supported_vnic_types']
|
||||||
['*'])
|
|
||||||
# When a list of VNIC types is empty, hide the corresponding field.
|
# When a list of VNIC types is empty, hide the corresponding field.
|
||||||
if not supported_vnic_types:
|
if not supported_vnic_types:
|
||||||
del self.fields['binding__vnic_type']
|
del self.fields['binding__vnic_type']
|
||||||
@ -315,10 +314,8 @@ class UpdatePortInfoAction(workflows.Action):
|
|||||||
super(UpdatePortInfoAction, self).__init__(request, *args, **kwargs)
|
super(UpdatePortInfoAction, self).__init__(request, *args, **kwargs)
|
||||||
try:
|
try:
|
||||||
if api.neutron.is_extension_supported(request, 'binding'):
|
if api.neutron.is_extension_supported(request, 'binding'):
|
||||||
neutron_settings = getattr(settings,
|
neutron_settings = settings.OPENSTACK_NEUTRON_NETWORK
|
||||||
'OPENSTACK_NEUTRON_NETWORK', {})
|
supported_vnic_types = neutron_settings['supported_vnic_types']
|
||||||
supported_vnic_types = neutron_settings.get(
|
|
||||||
'supported_vnic_types', ['*'])
|
|
||||||
if supported_vnic_types:
|
if supported_vnic_types:
|
||||||
if supported_vnic_types == ['*']:
|
if supported_vnic_types == ['*']:
|
||||||
vnic_type_choices = api.neutron.VNIC_TYPES
|
vnic_type_choices = api.neutron.VNIC_TYPES
|
||||||
|
@ -67,8 +67,8 @@ class DefaultSubnetWorkflowMixin(object):
|
|||||||
|
|
||||||
def get_default_dns_servers(self):
|
def get_default_dns_servers(self):
|
||||||
# this returns the default dns servers to be used for new subnets
|
# this returns the default dns servers to be used for new subnets
|
||||||
dns_default = "\n".join(getattr(settings, 'OPENSTACK_NEUTRON_NETWORK',
|
dns_default = "\n".join(
|
||||||
{}).get('default_dns_nameservers', ''))
|
settings.OPENSTACK_NEUTRON_NETWORK['default_dns_nameservers'])
|
||||||
return dns_default
|
return dns_default
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,8 +205,7 @@ class CreateSubnetInfoAction(workflows.Action):
|
|||||||
def __init__(self, request, context, *args, **kwargs):
|
def __init__(self, request, context, *args, **kwargs):
|
||||||
super(CreateSubnetInfoAction, self).__init__(request, context, *args,
|
super(CreateSubnetInfoAction, self).__init__(request, context, *args,
|
||||||
**kwargs)
|
**kwargs)
|
||||||
if not getattr(settings, 'OPENSTACK_NEUTRON_NETWORK',
|
if not settings.OPENSTACK_NEUTRON_NETWORK['enable_ipv6']:
|
||||||
{}).get('enable_ipv6', True):
|
|
||||||
self.fields['ip_version'].widget = forms.HiddenInput()
|
self.fields['ip_version'].widget = forms.HiddenInput()
|
||||||
self.fields['ip_version'].initial = 4
|
self.fields['ip_version'].initial = 4
|
||||||
|
|
||||||
@ -261,7 +260,7 @@ class CreateSubnetInfoAction(workflows.Action):
|
|||||||
if not self.check_subnet_range:
|
if not self.check_subnet_range:
|
||||||
return
|
return
|
||||||
|
|
||||||
allowed_cidr = getattr(settings, "ALLOWED_PRIVATE_SUBNET_CIDR", {})
|
allowed_cidr = settings.ALLOWED_PRIVATE_SUBNET_CIDR
|
||||||
version_str = 'ipv%s' % ip_version
|
version_str = 'ipv%s' % ip_version
|
||||||
allowed_ranges = allowed_cidr.get(version_str, [])
|
allowed_ranges = allowed_cidr.get(version_str, [])
|
||||||
if allowed_ranges:
|
if allowed_ranges:
|
||||||
@ -381,8 +380,7 @@ class CreateSubnetDetailAction(workflows.Action):
|
|||||||
def __init__(self, request, context, *args, **kwargs):
|
def __init__(self, request, context, *args, **kwargs):
|
||||||
super(CreateSubnetDetailAction, self).__init__(request, context,
|
super(CreateSubnetDetailAction, self).__init__(request, context,
|
||||||
*args, **kwargs)
|
*args, **kwargs)
|
||||||
if not getattr(settings, 'OPENSTACK_NEUTRON_NETWORK',
|
if not settings.OPENSTACK_NEUTRON_NETWORK['enable_ipv6']:
|
||||||
{}).get('enable_ipv6', True):
|
|
||||||
self.fields['ipv6_modes'].widget = forms.HiddenInput()
|
self.fields['ipv6_modes'].widget = forms.HiddenInput()
|
||||||
|
|
||||||
def populate_ipv6_modes_choices(self, request, context):
|
def populate_ipv6_modes_choices(self, request, context):
|
||||||
|
@ -25,5 +25,5 @@ class Routers(horizon.Panel):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def can_register():
|
def can_register():
|
||||||
network_config = getattr(settings, 'OPENSTACK_NEUTRON_NETWORK', {})
|
network_config = settings.OPENSTACK_NEUTRON_NETWORK
|
||||||
return network_config.get('enable_router', True)
|
return network_config['enable_router']
|
||||||
|
@ -269,7 +269,7 @@ class AddRule(forms.SelfHandlingForm):
|
|||||||
# parameter. If 'backend' is used, error message should be emitted.
|
# parameter. If 'backend' is used, error message should be emitted.
|
||||||
backend = 'neutron'
|
backend = 'neutron'
|
||||||
|
|
||||||
rules_dict = getattr(settings, 'SECURITY_GROUP_RULES', [])
|
rules_dict = settings.SECURITY_GROUP_RULES
|
||||||
common_rules = [
|
common_rules = [
|
||||||
(k, rules_dict[k]['name'])
|
(k, rules_dict[k]['name'])
|
||||||
for k in rules_dict
|
for k in rules_dict
|
||||||
@ -296,8 +296,7 @@ class AddRule(forms.SelfHandlingForm):
|
|||||||
('all', _('All ports')),
|
('all', _('All ports')),
|
||||||
]
|
]
|
||||||
|
|
||||||
if not getattr(settings, 'OPENSTACK_NEUTRON_NETWORK',
|
if not settings.OPENSTACK_NEUTRON_NETWORK['enable_ipv6']:
|
||||||
{}).get('enable_ipv6', True):
|
|
||||||
self.fields['cidr'].version = forms.IPv4
|
self.fields['cidr'].version = forms.IPv4
|
||||||
self.fields['ethertype'].widget = forms.TextInput(
|
self.fields['ethertype'].widget = forms.TextInput(
|
||||||
attrs={'readonly': 'readonly'})
|
attrs={'readonly': 'readonly'})
|
||||||
|
@ -217,7 +217,7 @@ def filter_protocol(protocol):
|
|||||||
|
|
||||||
|
|
||||||
def check_rule_template(port, ip_proto):
|
def check_rule_template(port, ip_proto):
|
||||||
rules_dict = getattr(settings, 'SECURITY_GROUP_RULES', {})
|
rules_dict = settings.SECURITY_GROUP_RULES
|
||||||
if not rules_dict:
|
if not rules_dict:
|
||||||
return port
|
return port
|
||||||
templ_rule = [rule for rule in rules_dict.values()
|
templ_rule = [rule for rule in rules_dict.values()
|
||||||
|
@ -224,9 +224,9 @@ class VolumeDetailsSnapshotsTable(volume_tables.VolumesTableBase):
|
|||||||
table_actions = (VolumeSnapshotsFilterAction, DeleteVolumeSnapshot,)
|
table_actions = (VolumeSnapshotsFilterAction, DeleteVolumeSnapshot,)
|
||||||
|
|
||||||
launch_actions = ()
|
launch_actions = ()
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_LEGACY_ENABLED', False):
|
if settings.LAUNCH_INSTANCE_LEGACY_ENABLED:
|
||||||
launch_actions = (LaunchSnapshot,) + launch_actions
|
launch_actions = (LaunchSnapshot,) + launch_actions
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', True):
|
if settings.LAUNCH_INSTANCE_NG_ENABLED:
|
||||||
launch_actions = (LaunchSnapshotNG,) + launch_actions
|
launch_actions = (LaunchSnapshotNG,) + launch_actions
|
||||||
|
|
||||||
row_actions = ((CreateVolumeFromSnapshot,) + launch_actions +
|
row_actions = ((CreateVolumeFromSnapshot,) + launch_actions +
|
||||||
|
@ -40,8 +40,8 @@ from openstack_dashboard.dashboards.project.images import utils
|
|||||||
from openstack_dashboard.dashboards.project.instances import tables
|
from openstack_dashboard.dashboards.project.instances import tables
|
||||||
from openstack_dashboard.usage import quotas
|
from openstack_dashboard.usage import quotas
|
||||||
|
|
||||||
IMAGE_BACKEND_SETTINGS = getattr(settings, 'OPENSTACK_IMAGE_BACKEND', {})
|
IMAGE_BACKEND_SETTINGS = settings.OPENSTACK_IMAGE_BACKEND
|
||||||
IMAGE_FORMAT_CHOICES = IMAGE_BACKEND_SETTINGS.get('image_formats', [])
|
IMAGE_FORMAT_CHOICES = IMAGE_BACKEND_SETTINGS['image_formats']
|
||||||
VALID_DISK_FORMATS = ('raw', 'vmdk', 'vdi', 'qcow2', 'vhd', 'vhdx')
|
VALID_DISK_FORMATS = ('raw', 'vmdk', 'vdi', 'qcow2', 'vhd', 'vhdx')
|
||||||
DEFAULT_CONTAINER_FORMAT = 'bare'
|
DEFAULT_CONTAINER_FORMAT = 'bare'
|
||||||
|
|
||||||
|
@ -567,9 +567,9 @@ class VolumesTable(VolumesTableBase):
|
|||||||
VolumesFilterAction)
|
VolumesFilterAction)
|
||||||
|
|
||||||
launch_actions = ()
|
launch_actions = ()
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_LEGACY_ENABLED', False):
|
if settings.LAUNCH_INSTANCE_LEGACY_ENABLED:
|
||||||
launch_actions = (LaunchVolume,) + launch_actions
|
launch_actions = (LaunchVolume,) + launch_actions
|
||||||
if getattr(settings, 'LAUNCH_INSTANCE_NG_ENABLED', True):
|
if settings.LAUNCH_INSTANCE_NG_ENABLED:
|
||||||
launch_actions = (LaunchVolumeNG,) + launch_actions
|
launch_actions = (LaunchVolumeNG,) + launch_actions
|
||||||
|
|
||||||
row_actions = ((EditVolume, ExtendVolume,) +
|
row_actions = ((EditVolume, ExtendVolume,) +
|
||||||
|
@ -12,15 +12,55 @@
|
|||||||
|
|
||||||
"""Default settings for openstack_dashboard"""
|
"""Default settings for openstack_dashboard"""
|
||||||
|
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
# This must be configured
|
# This must be configured
|
||||||
# OPENSTACK_KEYSTONE_URL = 'http://localhost/identity/v3'
|
# OPENSTACK_KEYSTONE_URL = 'http://localhost/identity/v3'
|
||||||
|
|
||||||
|
# Dict used to restrict user private subnet cidr range.
|
||||||
|
# An empty list means that user input will not be restricted
|
||||||
|
# for a corresponding IP version. By default, there is
|
||||||
|
# no restriction for IPv4 or IPv6. To restrict
|
||||||
|
# user private subnet cidr range set ALLOWED_PRIVATE_SUBNET_CIDR
|
||||||
|
# to something like
|
||||||
|
# ALLOWED_PRIVATE_SUBNET_CIDR = {
|
||||||
|
# 'ipv4': ['10.0.0.0/8', '192.168.0.0/16'],
|
||||||
|
# 'ipv6': ['fc00::/7']
|
||||||
|
# }
|
||||||
|
ALLOWED_PRIVATE_SUBNET_CIDR = {'ipv4': [], 'ipv6': []}
|
||||||
|
|
||||||
# The number of objects (Swift containers/objects or images) to display
|
# The number of objects (Swift containers/objects or images) to display
|
||||||
# on a single page before providing a paging element (a "more" link)
|
# on a single page before providing a paging element (a "more" link)
|
||||||
# to paginate results.
|
# to paginate results.
|
||||||
API_RESULT_LIMIT = 1000
|
API_RESULT_LIMIT = 1000
|
||||||
API_RESULT_PAGE_SIZE = 20
|
API_RESULT_PAGE_SIZE = 20
|
||||||
|
|
||||||
|
# For multiple regions uncomment this configuration, and add (endpoint, title).
|
||||||
|
# AVAILABLE_REGIONS = [
|
||||||
|
# ('http://cluster1.example.com:5000/v3', 'cluster1'),
|
||||||
|
# ('http://cluster2.example.com:5000/v3', 'cluster2'),
|
||||||
|
# ]
|
||||||
|
AVAILABLE_REGIONS = []
|
||||||
|
|
||||||
|
# Set Console type:
|
||||||
|
# valid options are "AUTO"(default), "VNC", "SPICE", "RDP", "SERIAL", "MKS"
|
||||||
|
# or None. Set to None explicitly if you want to deactivate the console.
|
||||||
|
CONSOLE_TYPE = "AUTO"
|
||||||
|
|
||||||
|
# When launching an instance, the menu of available flavors is
|
||||||
|
# sorted by RAM usage, ascending. If you would like a different sort order,
|
||||||
|
# you can provide another flavor attribute as sorting key. Alternatively, you
|
||||||
|
# can provide a custom callback method to use for sorting. You can also provide
|
||||||
|
# a flag for reverse sort. For more info, see
|
||||||
|
# http://docs.python.org/2/library/functions.html#sorted
|
||||||
|
# CREATE_INSTANCE_FLAVOR_SORT = {
|
||||||
|
# 'key': 'name',
|
||||||
|
# # or
|
||||||
|
# 'key': my_awesome_callback_method,
|
||||||
|
# 'reverse': False,
|
||||||
|
# }
|
||||||
|
CREATE_INSTANCE_FLAVOR_SORT = {}
|
||||||
|
|
||||||
ENABLE_CLIENT_TOKEN = True
|
ENABLE_CLIENT_TOKEN = True
|
||||||
# Set this to True to display an 'Admin Password' field on the Change Password
|
# Set this to True to display an 'Admin Password' field on the Change Password
|
||||||
# form to verify that it is indeed the admin logged-in who wants to change
|
# form to verify that it is indeed the admin logged-in who wants to change
|
||||||
@ -56,6 +96,78 @@ HORIZON_IMAGES_UPLOAD_MODE = 'legacy'
|
|||||||
# configuration and policies allow setting locations.
|
# configuration and policies allow setting locations.
|
||||||
IMAGES_ALLOW_LOCATION = False
|
IMAGES_ALLOW_LOCATION = False
|
||||||
|
|
||||||
|
# The IMAGE_CUSTOM_PROPERTY_TITLES settings is used to customize the titles for
|
||||||
|
# image custom property attributes that appear on image detail pages.
|
||||||
|
IMAGE_CUSTOM_PROPERTY_TITLES = {
|
||||||
|
"architecture": _("Architecture"),
|
||||||
|
"kernel_id": _("Kernel ID"),
|
||||||
|
"ramdisk_id": _("Ramdisk ID"),
|
||||||
|
"image_state": _("Euca2ools state"),
|
||||||
|
"project_id": _("Project ID"),
|
||||||
|
"image_type": _("Image Type"),
|
||||||
|
}
|
||||||
|
|
||||||
|
IMAGES_LIST_FILTER_TENANTS = []
|
||||||
|
|
||||||
|
# The Launch Instance user experience has been significantly enhanced.
|
||||||
|
# You can choose whether to enable the new launch instance experience,
|
||||||
|
# the legacy experience, or both. The legacy experience will be removed
|
||||||
|
# in a future release, but is available as a temporary backup setting to ensure
|
||||||
|
# compatibility with existing deployments. Further development will not be
|
||||||
|
# done on the legacy experience. Please report any problems with the new
|
||||||
|
# experience via the Launchpad tracking system.
|
||||||
|
#
|
||||||
|
# Toggle LAUNCH_INSTANCE_LEGACY_ENABLED and LAUNCH_INSTANCE_NG_ENABLED to
|
||||||
|
# determine the experience to enable. Set them both to true to enable
|
||||||
|
# both.
|
||||||
|
LAUNCH_INSTANCE_LEGACY_ENABLED = False
|
||||||
|
LAUNCH_INSTANCE_NG_ENABLED = True
|
||||||
|
|
||||||
|
# A dictionary of settings which can be used to provide the default values for
|
||||||
|
# properties found in the Launch Instance modal.
|
||||||
|
LAUNCH_INSTANCE_DEFAULTS = {
|
||||||
|
'config_drive': False,
|
||||||
|
'create_volume': True,
|
||||||
|
'hide_create_volume': False,
|
||||||
|
'disable_image': False,
|
||||||
|
'disable_instance_snapshot': False,
|
||||||
|
'disable_volume': False,
|
||||||
|
'disable_volume_snapshot': False,
|
||||||
|
'enable_scheduler_hints': True,
|
||||||
|
}
|
||||||
|
|
||||||
|
OPENRC_CUSTOM_TEMPLATE = 'project/api_access/openrc.sh.template'
|
||||||
|
OPENSTACK_CLOUDS_YAML_CUSTOM_TEMPLATE = ('project/api_access/'
|
||||||
|
'clouds.yaml.template')
|
||||||
|
|
||||||
|
SECURITY_GROUP_RULES = {
|
||||||
|
'all_tcp': {
|
||||||
|
'name': _('All TCP'),
|
||||||
|
'ip_protocol': 'tcp',
|
||||||
|
'from_port': '1',
|
||||||
|
'to_port': '65535',
|
||||||
|
},
|
||||||
|
'all_udp': {
|
||||||
|
'name': _('All UDP'),
|
||||||
|
'ip_protocol': 'udp',
|
||||||
|
'from_port': '1',
|
||||||
|
'to_port': '65535',
|
||||||
|
},
|
||||||
|
'all_icmp': {
|
||||||
|
'name': _('All ICMP'),
|
||||||
|
'ip_protocol': 'icmp',
|
||||||
|
'from_port': '-1',
|
||||||
|
'to_port': '-1',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
# Controls whether the keystone openrc file is accesible from the user
|
||||||
|
# menu and the api access panel.
|
||||||
|
SHOW_OPENRC_FILE = True
|
||||||
|
# Controls whether clouds.yaml is accesible from the user
|
||||||
|
# menu and the api access panel.
|
||||||
|
SHOW_OPENSTACK_CLOUDS_YAML = True
|
||||||
|
|
||||||
# The size of chunk in bytes for downloading objects from Swift
|
# The size of chunk in bytes for downloading objects from Swift
|
||||||
SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024
|
SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024
|
||||||
|
|
||||||
@ -146,6 +258,7 @@ OPENSTACK_NEUTRON_NETWORK = {
|
|||||||
# The entries below are examples only, and are not appropriate for
|
# The entries below are examples only, and are not appropriate for
|
||||||
# real deployments
|
# real deployments
|
||||||
# 'default_dns_nameservers': ["8.8.8.8", "8.8.4.4", "208.67.222.222"],
|
# 'default_dns_nameservers': ["8.8.8.8", "8.8.4.4", "208.67.222.222"],
|
||||||
|
'default_dns_nameservers': [],
|
||||||
|
|
||||||
# Set which provider network types are supported. Only the network types
|
# Set which provider network types are supported. Only the network types
|
||||||
# in this list will be available to choose from when creating a network.
|
# in this list will be available to choose from when creating a network.
|
||||||
@ -184,6 +297,12 @@ OPENSTACK_NEUTRON_NETWORK = {
|
|||||||
# e.g. ['default', 'test']
|
# e.g. ['default', 'test']
|
||||||
'physical_networks': [],
|
'physical_networks': [],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This settings controls whether IP addresses of servers are retrieved from
|
||||||
|
# neutron in the project instance table. Setting this to ``False`` may mitigate
|
||||||
|
# a performance issue in the project instance table in large deployments.
|
||||||
|
OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES = True
|
||||||
|
|
||||||
OPENSTACK_NOVA_EXTENSIONS_BLACKLIST = []
|
OPENSTACK_NOVA_EXTENSIONS_BLACKLIST = []
|
||||||
# The Xen Hypervisor has the ability to set the mount point for volumes
|
# The Xen Hypervisor has the ability to set the mount point for volumes
|
||||||
# attached to instances (other Hypervisors currently do not). Setting
|
# attached to instances (other Hypervisors currently do not). Setting
|
||||||
@ -196,6 +315,38 @@ OPENSTACK_HYPERVISOR_FEATURES = {
|
|||||||
'requires_keypair': False,
|
'requires_keypair': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Setting this to True, will add a new "Retrieve Password" action on instance,
|
||||||
|
# allowing Admin session password retrieval/decryption.
|
||||||
|
OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
|
||||||
|
|
||||||
|
# The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
|
||||||
|
# in the OpenStack Dashboard related to the Image service, such as the list
|
||||||
|
# of supported image formats.
|
||||||
|
OPENSTACK_IMAGE_BACKEND = {
|
||||||
|
'image_formats': [
|
||||||
|
('', _('Select format')),
|
||||||
|
('aki', _('AKI - Amazon Kernel Image')),
|
||||||
|
('ami', _('AMI - Amazon Machine Image')),
|
||||||
|
('ari', _('ARI - Amazon Ramdisk Image')),
|
||||||
|
('docker', _('Docker')),
|
||||||
|
('iso', _('ISO - Optical Disk Image')),
|
||||||
|
('ova', _('OVA - Open Virtual Appliance')),
|
||||||
|
('ploop', _('PLOOP - Virtuozzo/Parallels Loopback Disk')),
|
||||||
|
('qcow2', _('QCOW2 - QEMU Emulator')),
|
||||||
|
('raw', _('Raw')),
|
||||||
|
('vdi', _('VDI - Virtual Disk Image')),
|
||||||
|
('vhd', _('VHD - Virtual Hard Disk')),
|
||||||
|
('vhdx', _('VHDX - Large Virtual Hard Disk')),
|
||||||
|
('vmdk', _('VMDK - Virtual Machine Disk')),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set OPENSTACK_CLOUDS_YAML_NAME to provide a nicer name for this cloud for
|
||||||
|
# the clouds.yaml file than "openstack".
|
||||||
|
OPENSTACK_CLOUDS_YAML_NAME = 'openstack'
|
||||||
|
# If this cloud has a vendor profile in os-client-config, put it's name here.
|
||||||
|
OPENSTACK_CLOUDS_YAML_PROFILE = ''
|
||||||
|
|
||||||
# AngularJS requires some settings to be made available to
|
# AngularJS requires some settings to be made available to
|
||||||
# the client side. Some settings are required by in-tree / built-in horizon
|
# the client side. Some settings are required by in-tree / built-in horizon
|
||||||
# features. These settings must be added to REST_API_REQUIRED_SETTINGS in the
|
# features. These settings must be added to REST_API_REQUIRED_SETTINGS in the
|
||||||
|
@ -70,19 +70,6 @@ WEBROOT = '/'
|
|||||||
# ('Default', 'Default'),
|
# ('Default', 'Default'),
|
||||||
#)
|
#)
|
||||||
|
|
||||||
# Set Console type:
|
|
||||||
# valid options are "AUTO"(default), "VNC", "SPICE", "RDP", "SERIAL", "MKS"
|
|
||||||
# or None. Set to None explicitly if you want to deactivate the console.
|
|
||||||
#CONSOLE_TYPE = "AUTO"
|
|
||||||
|
|
||||||
# Controls whether the keystone openrc file is accesible from the user
|
|
||||||
# menu and the api access panel.
|
|
||||||
SHOW_OPENRC_FILE = True
|
|
||||||
|
|
||||||
# Controls whether clouds.yaml is accesible from the user
|
|
||||||
# menu and the api access panel.
|
|
||||||
SHOW_OPENSTACK_CLOUDS_YAML = True
|
|
||||||
|
|
||||||
# If provided, a "Report Bug" link will be displayed in the site header
|
# If provided, a "Report Bug" link will be displayed in the site header
|
||||||
# which links to the value of this setting (ideally a URL containing
|
# which links to the value of this setting (ideally a URL containing
|
||||||
# information on how to report issues).
|
# information on how to report issues).
|
||||||
@ -149,12 +136,6 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
|||||||
#EMAIL_HOST_USER = 'djangomail'
|
#EMAIL_HOST_USER = 'djangomail'
|
||||||
#EMAIL_HOST_PASSWORD = 'top-secret!'
|
#EMAIL_HOST_PASSWORD = 'top-secret!'
|
||||||
|
|
||||||
# For multiple regions uncomment this configuration, and add (endpoint, title).
|
|
||||||
#AVAILABLE_REGIONS = [
|
|
||||||
# ('http://cluster1.example.com:5000/v3', 'cluster1'),
|
|
||||||
# ('http://cluster2.example.com:5000/v3', 'cluster2'),
|
|
||||||
#]
|
|
||||||
|
|
||||||
OPENSTACK_HOST = "127.0.0.1"
|
OPENSTACK_HOST = "127.0.0.1"
|
||||||
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
|
OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
|
||||||
|
|
||||||
@ -233,41 +214,6 @@ OPENSTACK_KEYSTONE_URL = "http://%s:5000/v3" % OPENSTACK_HOST
|
|||||||
# should not match any service provider IDs.
|
# should not match any service provider IDs.
|
||||||
#KEYSTONE_PROVIDER_IDP_ID = "localkeystone"
|
#KEYSTONE_PROVIDER_IDP_ID = "localkeystone"
|
||||||
|
|
||||||
# Setting this to True, will add a new "Retrieve Password" action on instance,
|
|
||||||
# allowing Admin session password retrieval/decryption.
|
|
||||||
#OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False
|
|
||||||
|
|
||||||
# The Launch Instance user experience has been significantly enhanced.
|
|
||||||
# You can choose whether to enable the new launch instance experience,
|
|
||||||
# the legacy experience, or both. The legacy experience will be removed
|
|
||||||
# in a future release, but is available as a temporary backup setting to ensure
|
|
||||||
# compatibility with existing deployments. Further development will not be
|
|
||||||
# done on the legacy experience. Please report any problems with the new
|
|
||||||
# experience via the Launchpad tracking system.
|
|
||||||
#
|
|
||||||
# Toggle LAUNCH_INSTANCE_LEGACY_ENABLED and LAUNCH_INSTANCE_NG_ENABLED to
|
|
||||||
# determine the experience to enable. Set them both to true to enable
|
|
||||||
# both.
|
|
||||||
#LAUNCH_INSTANCE_LEGACY_ENABLED = True
|
|
||||||
#LAUNCH_INSTANCE_NG_ENABLED = False
|
|
||||||
|
|
||||||
# A dictionary of settings which can be used to provide the default values for
|
|
||||||
# properties found in the Launch Instance modal.
|
|
||||||
#LAUNCH_INSTANCE_DEFAULTS = {
|
|
||||||
# 'config_drive': False,
|
|
||||||
# 'enable_scheduler_hints': True,
|
|
||||||
# 'disable_image': False,
|
|
||||||
# 'disable_instance_snapshot': False,
|
|
||||||
# 'disable_volume': False,
|
|
||||||
# 'disable_volume_snapshot': False,
|
|
||||||
# 'create_volume': True,
|
|
||||||
#}
|
|
||||||
|
|
||||||
# This settings controls whether IP addresses of servers are retrieved from
|
|
||||||
# neutron in the project instance table. Setting this to ``False`` may mitigate
|
|
||||||
# a performance issue in the project instance table in large deployments.
|
|
||||||
#OPENSTACK_INSTANCE_RETRIEVE_IP_ADDRESSES = True
|
|
||||||
|
|
||||||
# The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
|
# The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional
|
||||||
# services provided by neutron. Options currently available are load
|
# services provided by neutron. Options currently available are load
|
||||||
# balancer service, security groups, quotas, VPN service.
|
# balancer service, security groups, quotas, VPN service.
|
||||||
@ -298,38 +244,6 @@ OPENSTACK_HEAT_STACK = {
|
|||||||
'enable_user_pass': True,
|
'enable_user_pass': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
# The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
|
|
||||||
# in the OpenStack Dashboard related to the Image service, such as the list
|
|
||||||
# of supported image formats.
|
|
||||||
#OPENSTACK_IMAGE_BACKEND = {
|
|
||||||
# 'image_formats': [
|
|
||||||
# ('', _('Select format')),
|
|
||||||
# ('aki', _('AKI - Amazon Kernel Image')),
|
|
||||||
# ('ami', _('AMI - Amazon Machine Image')),
|
|
||||||
# ('ari', _('ARI - Amazon Ramdisk Image')),
|
|
||||||
# ('docker', _('Docker')),
|
|
||||||
# ('iso', _('ISO - Optical Disk Image')),
|
|
||||||
# ('ova', _('OVA - Open Virtual Appliance')),
|
|
||||||
# ('qcow2', _('QCOW2 - QEMU Emulator')),
|
|
||||||
# ('raw', _('Raw')),
|
|
||||||
# ('vdi', _('VDI - Virtual Disk Image')),
|
|
||||||
# ('vhd', _('VHD - Virtual Hard Disk')),
|
|
||||||
# ('vhdx', _('VHDX - Large Virtual Hard Disk')),
|
|
||||||
# ('vmdk', _('VMDK - Virtual Machine Disk')),
|
|
||||||
# ],
|
|
||||||
#}
|
|
||||||
|
|
||||||
# The IMAGE_CUSTOM_PROPERTY_TITLES settings is used to customize the titles for
|
|
||||||
# image custom property attributes that appear on image detail pages.
|
|
||||||
IMAGE_CUSTOM_PROPERTY_TITLES = {
|
|
||||||
"architecture": _("Architecture"),
|
|
||||||
"kernel_id": _("Kernel ID"),
|
|
||||||
"ramdisk_id": _("Ramdisk ID"),
|
|
||||||
"image_state": _("Euca2ools state"),
|
|
||||||
"project_id": _("Project ID"),
|
|
||||||
"image_type": _("Image Type"),
|
|
||||||
}
|
|
||||||
|
|
||||||
# The IMAGE_RESERVED_CUSTOM_PROPERTIES setting is used to specify which image
|
# The IMAGE_RESERVED_CUSTOM_PROPERTIES setting is used to specify which image
|
||||||
# custom properties should not be displayed in the Image Custom Properties
|
# custom properties should not be displayed in the Image Custom Properties
|
||||||
# table.
|
# table.
|
||||||
@ -350,19 +264,6 @@ DROPDOWN_MAX_ITEMS = 30
|
|||||||
# of your entire OpenStack installation, and hopefully be in UTC.
|
# of your entire OpenStack installation, and hopefully be in UTC.
|
||||||
TIME_ZONE = "UTC"
|
TIME_ZONE = "UTC"
|
||||||
|
|
||||||
# When launching an instance, the menu of available flavors is
|
|
||||||
# sorted by RAM usage, ascending. If you would like a different sort order,
|
|
||||||
# you can provide another flavor attribute as sorting key. Alternatively, you
|
|
||||||
# can provide a custom callback method to use for sorting. You can also provide
|
|
||||||
# a flag for reverse sort. For more info, see
|
|
||||||
# http://docs.python.org/2/library/functions.html#sorted
|
|
||||||
#CREATE_INSTANCE_FLAVOR_SORT = {
|
|
||||||
# 'key': 'name',
|
|
||||||
# # or
|
|
||||||
# 'key': my_awesome_callback_method,
|
|
||||||
# 'reverse': False,
|
|
||||||
#}
|
|
||||||
|
|
||||||
# Modules that provide /auth routes that can be used to handle different types
|
# Modules that provide /auth routes that can be used to handle different types
|
||||||
# of user authentication. Add auth plugins that require extra route handling to
|
# of user authentication. Add auth plugins that require extra route handling to
|
||||||
# this list.
|
# this list.
|
||||||
@ -696,18 +597,6 @@ SECURITY_GROUP_RULES = {
|
|||||||
# of data fetched by default when rendering the Overview panel.
|
# of data fetched by default when rendering the Overview panel.
|
||||||
#OVERVIEW_DAYS_RANGE = 1
|
#OVERVIEW_DAYS_RANGE = 1
|
||||||
|
|
||||||
# Dict used to restrict user private subnet cidr range.
|
|
||||||
# An empty list means that user input will not be restricted
|
|
||||||
# for a corresponding IP version. By default, there is
|
|
||||||
# no restriction for IPv4 or IPv6. To restrict
|
|
||||||
# user private subnet cidr range set ALLOWED_PRIVATE_SUBNET_CIDR
|
|
||||||
# to something like
|
|
||||||
#ALLOWED_PRIVATE_SUBNET_CIDR = {
|
|
||||||
# 'ipv4': ['10.0.0.0/8', '192.168.0.0/16'],
|
|
||||||
# 'ipv6': ['fc00::/7']
|
|
||||||
#}
|
|
||||||
ALLOWED_PRIVATE_SUBNET_CIDR = {'ipv4': [], 'ipv6': []}
|
|
||||||
|
|
||||||
# Projects and users can have extra attributes as defined by keystone v3.
|
# Projects and users can have extra attributes as defined by keystone v3.
|
||||||
# Horizon has the ability to display these extra attributes via this setting.
|
# Horizon has the ability to display these extra attributes via this setting.
|
||||||
# If you'd like to display extra data in the project or user tables, set the
|
# If you'd like to display extra data in the project or user tables, set the
|
||||||
|
@ -91,28 +91,6 @@ HORIZON_CONFIG = {
|
|||||||
'integration_tests_support': INTEGRATION_TESTS_SUPPORT
|
'integration_tests_support': INTEGRATION_TESTS_SUPPORT
|
||||||
}
|
}
|
||||||
|
|
||||||
# The OPENSTACK_IMAGE_BACKEND settings can be used to customize features
|
|
||||||
# in the OpenStack Dashboard related to the Image service, such as the list
|
|
||||||
# of supported image formats.
|
|
||||||
OPENSTACK_IMAGE_BACKEND = {
|
|
||||||
'image_formats': [
|
|
||||||
('', _('Select format')),
|
|
||||||
('aki', _('AKI - Amazon Kernel Image')),
|
|
||||||
('ami', _('AMI - Amazon Machine Image')),
|
|
||||||
('ari', _('ARI - Amazon Ramdisk Image')),
|
|
||||||
('docker', _('Docker')),
|
|
||||||
('iso', _('ISO - Optical Disk Image')),
|
|
||||||
('ova', _('OVA - Open Virtual Appliance')),
|
|
||||||
('ploop', _('PLOOP - Virtuozzo/Parallels Loopback Disk')),
|
|
||||||
('qcow2', _('QCOW2 - QEMU Emulator')),
|
|
||||||
('raw', _('Raw')),
|
|
||||||
('vdi', _('VDI - Virtual Disk Image')),
|
|
||||||
('vhd', _('VHD - Virtual Hard Disk')),
|
|
||||||
('vhdx', _('VHDX - Large Virtual Hard Disk')),
|
|
||||||
('vmdk', _('VMDK - Virtual Machine Disk')),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
MIDDLEWARE = (
|
MIDDLEWARE = (
|
||||||
'openstack_auth.middleware.OpenstackAuthMonkeyPatchMiddleware',
|
'openstack_auth.middleware.OpenstackAuthMonkeyPatchMiddleware',
|
||||||
'debreach.middleware.RandomCommentMiddleware',
|
'debreach.middleware.RandomCommentMiddleware',
|
||||||
@ -270,12 +248,6 @@ USE_I18N = True
|
|||||||
USE_L10N = True
|
USE_L10N = True
|
||||||
USE_TZ = True
|
USE_TZ = True
|
||||||
|
|
||||||
# Set OPENSTACK_CLOUDS_YAML_NAME to provide a nicer name for this cloud for
|
|
||||||
# the clouds.yaml file than "openstack".
|
|
||||||
OPENSTACK_CLOUDS_YAML_NAME = 'openstack'
|
|
||||||
# If this cloud has a vendor profile in os-client-config, put it's name here.
|
|
||||||
OPENSTACK_CLOUDS_YAML_PROFILE = ''
|
|
||||||
|
|
||||||
DEFAULT_EXCEPTION_REPORTER_FILTER = 'horizon.exceptions.HorizonReporterFilter'
|
DEFAULT_EXCEPTION_REPORTER_FILTER = 'horizon.exceptions.HorizonReporterFilter'
|
||||||
|
|
||||||
POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
|
POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf")
|
||||||
@ -296,27 +268,6 @@ POLICY_DIRS = {
|
|||||||
SECRET_KEY = None
|
SECRET_KEY = None
|
||||||
LOCAL_PATH = None
|
LOCAL_PATH = None
|
||||||
|
|
||||||
SECURITY_GROUP_RULES = {
|
|
||||||
'all_tcp': {
|
|
||||||
'name': _('All TCP'),
|
|
||||||
'ip_protocol': 'tcp',
|
|
||||||
'from_port': '1',
|
|
||||||
'to_port': '65535',
|
|
||||||
},
|
|
||||||
'all_udp': {
|
|
||||||
'name': _('All UDP'),
|
|
||||||
'ip_protocol': 'udp',
|
|
||||||
'from_port': '1',
|
|
||||||
'to_port': '65535',
|
|
||||||
},
|
|
||||||
'all_icmp': {
|
|
||||||
'name': _('All ICMP'),
|
|
||||||
'ip_protocol': 'icmp',
|
|
||||||
'from_port': '-1',
|
|
||||||
'to_port': '-1',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
ADD_INSTALLED_APPS = []
|
ADD_INSTALLED_APPS = []
|
||||||
|
|
||||||
# NOTE: The default value of USER_MENU_LINKS will be set after loading
|
# NOTE: The default value of USER_MENU_LINKS will be set after loading
|
||||||
@ -351,9 +302,6 @@ CSRF_COOKIE_AGE = None
|
|||||||
|
|
||||||
COMPRESS_OFFLINE_CONTEXT = 'horizon.themes.offline_context'
|
COMPRESS_OFFLINE_CONTEXT = 'horizon.themes.offline_context'
|
||||||
|
|
||||||
SHOW_OPENRC_FILE = True
|
|
||||||
SHOW_OPENSTACK_CLOUDS_YAML = True
|
|
||||||
|
|
||||||
# Dictionary of currently available angular features
|
# Dictionary of currently available angular features
|
||||||
ANGULAR_FEATURES = {
|
ANGULAR_FEATURES = {
|
||||||
'images_panel': True,
|
'images_panel': True,
|
||||||
@ -430,6 +378,8 @@ if os.path.exists(LOCAL_SETTINGS_DIR_PATH):
|
|||||||
# The purpose of OPENSTACK_IMAGE_FORMATS is to provide a simple object
|
# The purpose of OPENSTACK_IMAGE_FORMATS is to provide a simple object
|
||||||
# that does not contain the lazy-loaded translations, so the list can
|
# that does not contain the lazy-loaded translations, so the list can
|
||||||
# be sent as JSON to the client-side (Angular).
|
# be sent as JSON to the client-side (Angular).
|
||||||
|
# TODO(amotoki): Do we really need this here? Can't we calculate this
|
||||||
|
# in openstack_dashboard.api.rest.config?
|
||||||
OPENSTACK_IMAGE_FORMATS = [fmt for (fmt, name)
|
OPENSTACK_IMAGE_FORMATS = [fmt for (fmt, name)
|
||||||
in OPENSTACK_IMAGE_BACKEND['image_formats']]
|
in OPENSTACK_IMAGE_BACKEND['image_formats']]
|
||||||
|
|
||||||
|
@ -149,22 +149,6 @@ OPENSTACK_NEUTRON_NETWORK['enable_distributed_router'] = False
|
|||||||
|
|
||||||
OPENSTACK_HYPERVISOR_FEATURES['can_set_password'] = True
|
OPENSTACK_HYPERVISOR_FEATURES['can_set_password'] = True
|
||||||
|
|
||||||
OPENSTACK_IMAGE_BACKEND = {
|
|
||||||
'image_formats': [
|
|
||||||
('', 'Select format'),
|
|
||||||
('aki', 'AKI - Amazon Kernel Image'),
|
|
||||||
('ami', 'AMI - Amazon Machine Image'),
|
|
||||||
('ari', 'ARI - Amazon Ramdisk Image'),
|
|
||||||
('iso', 'ISO - Optical Disk Image'),
|
|
||||||
('ploop', 'PLOOP - Virtuozzo/Parallels Loopback Disk'),
|
|
||||||
('qcow2', 'QCOW2 - QEMU Emulator'),
|
|
||||||
('raw', 'Raw'),
|
|
||||||
('vdi', 'VDI'),
|
|
||||||
('vhd', 'VHD'),
|
|
||||||
('vmdk', 'VMDK')
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
LOGGING['loggers'].update(
|
LOGGING['loggers'].update(
|
||||||
{
|
{
|
||||||
'openstack_dashboard': {
|
'openstack_dashboard': {
|
||||||
@ -236,9 +220,6 @@ REST_API_SECURITY = 'SECURITY'
|
|||||||
REST_API_REQUIRED_SETTINGS = ['REST_API_SETTING_1']
|
REST_API_REQUIRED_SETTINGS = ['REST_API_SETTING_1']
|
||||||
REST_API_ADDITIONAL_SETTINGS = ['REST_API_SETTING_2']
|
REST_API_ADDITIONAL_SETTINGS = ['REST_API_SETTING_2']
|
||||||
|
|
||||||
ALLOWED_PRIVATE_SUBNET_CIDR = {'ipv4': [], 'ipv6': []}
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------
|
# --------------------
|
||||||
# Test-only settings
|
# Test-only settings
|
||||||
# --------------------
|
# --------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user