Browse Source

Merge "Update upgrade_check to discover dashboard settings automatically"

changes/66/778366/3
Zuul 5 months ago
committed by Gerrit Code Review
parent
commit
03aee256ec
  1. 112
      openstack_dashboard/management/commands/upgrade_check.py

112
openstack_dashboard/management/commands/upgrade_check.py

@ -19,6 +19,8 @@ from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard import defaults
CHECKS = []
@ -32,30 +34,23 @@ def register_check(name):
@register_check(_("Unknown Settings"))
def check_invalid_settings(dummy=None):
# This list can be updated using the tools/find_settings.py script.
KNOWN_SETTINGS = {
KNOWN_SETTINGS_NON_DASHBOARD = [
'ABSOLUTE_URL_OVERRIDES',
'ACTION_CSS_CLASSES',
'ADD_INSTALLED_APPS',
'ADD_TEMPLATE_DIRS',
'ADD_TEMPLATE_LOADERS',
'ADMINS',
'ALLOWED_HOSTS',
'ALLOWED_PRIVATE_SUBNET_CIDR',
'ANGULAR_FEATURES',
'API_RESULT_LIMIT',
'API_RESULT_PAGE_SIZE',
'APPEND_SLASH',
'AUTHENTICATION_BACKENDS',
'AUTHENTICATION_URLS',
'AUTH_PASSWORD_VALIDATORS',
'AUTH_USER_MODEL',
'AVAILABLE_REGIONS',
'AVAILABLE_THEMES',
'CACHED_TEMPLATE_LOADERS',
'CACHES',
'CACHE_MIDDLEWARE_ALIAS',
'CACHE_MIDDLEWARE_KEY_PREFIX',
'CACHE_MIDDLEWARE_SECONDS',
'COMPRESSORS',
'COMPRESS_CACHEABLE_PRECOMPILERS',
'COMPRESS_CACHE_BACKEND',
'COMPRESS_CACHE_KEY_FUNCTION',
@ -69,6 +64,7 @@ def check_invalid_settings(dummy=None):
'COMPRESS_DATA_URI_MAX_SIZE',
'COMPRESS_DEBUG_TOGGLE',
'COMPRESS_ENABLED',
'COMPRESS_FILTERS',
'COMPRESS_JINJA2_GET_ENVIRONMENT',
'COMPRESS_JS_COMPRESSOR',
'COMPRESS_JS_FILTERS',
@ -94,13 +90,12 @@ def check_invalid_settings(dummy=None):
'COMPRESS_YUI_BINARY',
'COMPRESS_YUI_CSS_ARGUMENTS',
'COMPRESS_YUI_JS_ARGUMENTS',
'CONSOLE_TYPE',
'CREATE_INSTANCE_FLAVOR_SORT',
'CSRF_COOKIE_AGE',
'CSRF_COOKIE_DOMAIN',
'CSRF_COOKIE_HTTPONLY',
'CSRF_COOKIE_NAME',
'CSRF_COOKIE_PATH',
'CSRF_COOKIE_SAMESITE',
'CSRF_COOKIE_SECURE',
'CSRF_FAILURE_VIEW',
'CSRF_HEADER_NAME',
@ -124,11 +119,8 @@ def check_invalid_settings(dummy=None):
'DEFAULT_FILE_STORAGE',
'DEFAULT_FROM_EMAIL',
'DEFAULT_INDEX_TABLESPACE',
'DEFAULT_SERVICE_REGIONS',
'DEFAULT_TABLESPACE',
'DEFAULT_THEME',
'DISALLOWED_USER_AGENTS',
'DROPDOWN_MAX_ITEMS',
'EMAIL_BACKEND',
'EMAIL_HOST',
'EMAIL_HOST_PASSWORD',
@ -141,35 +133,22 @@ def check_invalid_settings(dummy=None):
'EMAIL_USE_LOCALTIME',
'EMAIL_USE_SSL',
'EMAIL_USE_TLS',
'ENABLE_CLIENT_TOKEN',
'ENFORCE_PASSWORD_CHECK',
'EXTERNAL_MONITORING',
'FILE_CHARSET',
'FILE_UPLOAD_DIRECTORY_PERMISSIONS',
'FILE_UPLOAD_HANDLERS',
'FILE_UPLOAD_MAX_MEMORY_SIZE',
'FILE_UPLOAD_PERMISSIONS',
'FILE_UPLOAD_TEMP_DIR',
'FILTER_DATA_FIRST',
'FIRST_DAY_OF_WEEK',
'FIXTURE_DIRS',
'FORCE_SCRIPT_NAME',
'FORMAT_MODULE_PATH',
'FORM_RENDERER',
'HORIZON_COMPRESS_OFFLINE_CONTEXT_BASE',
'HORIZON_CONFIG',
'HORIZON_IMAGES_UPLOAD_MODE',
'IGNORABLE_404_URLS',
'IMAGES_ALLOW_LOCATION',
'IMAGES_LIST_FILTER_TENANTS',
'IMAGE_CUSTOM_PROPERTY_TITLES',
'IMAGE_RESERVED_CUSTOM_PROPERTIES',
'INSTALLED_APPS',
'INSTANCE_LOG_LENGTH',
'INTEGRATION_TESTS_SUPPORT',
'INTERNAL_IPS',
'KEYSTONE_PROVIDER_IDP_ID',
'KEYSTONE_PROVIDER_IDP_NAME',
'LANGUAGES',
'LANGUAGES_BIDI',
'LANGUAGE_CODE',
@ -177,72 +156,27 @@ def check_invalid_settings(dummy=None):
'LANGUAGE_COOKIE_DOMAIN',
'LANGUAGE_COOKIE_NAME',
'LANGUAGE_COOKIE_PATH',
'LAUNCH_INSTANCE_DEFAULTS',
'LAUNCH_INSTANCE_LEGACY_ENABLED',
'LAUNCH_INSTANCE_NG_ENABLED',
'LOCALE_PATHS',
'LOCAL_PATH',
'LOCAL_SETTINGS_DIR_PATH',
'LOGGING',
'LOGGING_CONFIG',
'LOGIN_ERROR',
'LOGIN_REDIRECT_URL',
'LOGIN_URL',
'LOGOUT_REDIRECT_URL',
'LOGOUT_URL',
'MANAGERS',
'MEDIA_ROOT',
'MEDIA_URL',
'MEMOIZED_MAX_SIZE_DEFAULT',
'MESSAGES_PATH',
'MESSAGE_STORAGE',
'MIDDLEWARE',
'MIDDLEWARE_CLASSES',
'MIGRATION_MODULES',
'MONTH_DAY_FORMAT',
'NG_TEMPLATE_CACHE_AGE',
'NUMBER_GROUPING',
'OPENRC_CUSTOM_TEMPLATE',
'OPENSTACK_API_VERSIONS',
'OPENSTACK_CINDER_FEATURES',
'OPENSTACK_CLOUDS_YAML_CUSTOM_TEMPLATE',
'OPENSTACK_CLOUDS_YAML_NAME',
'OPENSTACK_CLOUDS_YAML_PROFILE',
'OPENSTACK_ENABLE_PASSWORD_RETRIEVE',
'OPENSTACK_ENDPOINT_TYPE',
'OPENSTACK_HEAT_STACK',
'OPENSTACK_HOST',
'OPENSTACK_HYPERVISOR_FEATURES',
'OPENSTACK_IMAGE_BACKEND',
'OPENSTACK_IMAGE_FORMATS',
'OPENSTACK_KEYSTONE_ADMIN_ROLES',
'OPENSTACK_KEYSTONE_BACKEND',
'OPENSTACK_KEYSTONE_DEFAULT_DOMAIN',
'OPENSTACK_KEYSTONE_DEFAULT_ROLE',
'OPENSTACK_KEYSTONE_DOMAIN_DROPDOWN',
'OPENSTACK_KEYSTONE_FEDERATION_MANAGEMENT',
'OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT',
'OPENSTACK_KEYSTONE_URL',
'OPENSTACK_NEUTRON_NETWORK',
'OPENSTACK_PROFILER',
'OPENSTACK_SSL_CACERT',
'OPENSTACK_SSL_NO_VERIFY',
'OPERATION_LOG_ENABLED',
'OPERATION_LOG_OPTIONS',
'OVERVIEW_DAYS_RANGE',
'PASSWORD_HASHERS',
'PASSWORD_RESET_TIMEOUT_DAYS',
'POLICY_CHECK_FUNCTION',
'POLICY_DIRS',
'POLICY_FILES',
'POLICY_FILES_PATH',
'PREPEND_WWW',
'PROJECT_TABLE_EXTRA_INFO',
'REST_API_ADDITIONAL_SETTINGS',
'REST_API_REQUIRED_SETTINGS',
'ROOT_PATH',
'ROOT_URLCONF',
'SECONDARY_ENDPOINT_TYPE',
'SECRET_KEY',
'SECURE_BROWSER_XSS_FILTER',
'SECURE_CONTENT_TYPE_NOSNIFF',
@ -253,53 +187,36 @@ def check_invalid_settings(dummy=None):
'SECURE_REDIRECT_EXEMPT',
'SECURE_SSL_HOST',
'SECURE_SSL_REDIRECT',
'SECURITY_GROUP_RULES',
'SELECTABLE_THEMES',
'SERVER_EMAIL',
'SESSION_CACHE_ALIAS',
'SESSION_COOKIE_AGE',
'SESSION_COOKIE_DOMAIN',
'SESSION_COOKIE_HTTPONLY',
'SESSION_COOKIE_MAX_SIZE',
'SESSION_COOKIE_NAME',
'SESSION_COOKIE_PATH',
'SESSION_COOKIE_SAMESITE',
'SESSION_COOKIE_SECURE',
'SESSION_ENGINE',
'SESSION_EXPIRE_AT_BROWSER_CLOSE',
'SESSION_FILE_PATH',
'SESSION_REFRESH',
'SESSION_SAVE_EVERY_REQUEST',
'SESSION_SERIALIZER',
'SESSION_TIMEOUT',
'SETTINGS_MODULE',
'SHORT_DATETIME_FORMAT',
'SHORT_DATE_FORMAT',
'SHOW_OPENRC_FILE',
'SHOW_OPENSTACK_CLOUDS_YAML',
'SIGNING_BACKEND',
'SILENCED_SYSTEM_CHECKS',
'SITE_BRANDING',
'SITE_BRANDING_LINK',
'STATICFILES_DIRS',
'STATICFILES_FINDERS',
'STATICFILES_STORAGE',
'STATIC_ROOT',
'STATIC_URL',
'SWIFT_FILE_TRANSFER_CHUNK_SIZE',
'TEMPLATES',
'TESTSERVER',
'TEST_GLOBAL_MOCKS_ON_PANELS',
'TEST_NON_SERIALIZED_APPS',
'TEST_RUNNER',
'THEME_COLLECTION_DIR',
'THEME_COOKIE_NAME',
'THOUSAND_SEPARATOR',
'TIME_FORMAT',
'TIME_INPUT_FORMATS',
'TIME_ZONE',
'TOKEN_TIMEOUT_MARGIN',
'USER_MENU_LINKS',
'USER_TABLE_EXTRA_INFO',
'USE_ETAGS',
'USE_I18N',
'USE_L10N',
@ -307,21 +224,14 @@ def check_invalid_settings(dummy=None):
'USE_TZ',
'USE_X_FORWARDED_HOST',
'USE_X_FORWARDED_PORT',
'WEBROOT',
'WEBSSO_CHOICES',
'WEBSSO_DEFAULT_REDIRECT',
'WEBSSO_DEFAULT_REDIRECT_LOGOUT',
'WEBSSO_DEFAULT_REDIRECT_PROTOCOL',
'WEBSSO_DEFAULT_REDIRECT_REGION',
'WEBSSO_ENABLED',
'WEBSSO_IDP_MAPPING',
'WEBSSO_INITIAL_CHOICE',
'WEBSSO_KEYSTONE_URL',
'WSGI_APPLICATION',
'XSTATIC_MODULES',
'X_FRAME_OPTIONS',
'YEAR_MONTH_FORMAT',
}
]
KNOWN_SETTINGS_DASHBOARD = dir(defaults)
KNOWN_SETTINGS = set(KNOWN_SETTINGS_DASHBOARD +
KNOWN_SETTINGS_NON_DASHBOARD)
invalid = []
for setting in dir(settings):
if not setting.isupper() or setting.startswith("_"):

Loading…
Cancel
Save