Commit 634c7db5 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Configurable unknown os identifier

parent 4852e902
......@@ -1954,7 +1954,7 @@
// OS attribute
if (this.has_meta(data)) {
data['OS'] = data.metadata.values.OS || "unknown";
data['OS'] = data.metadata.values.OS || snf.config.unknown_os;
}
if (!data.diagnostics) {
......
......@@ -445,6 +445,7 @@ function set_machine_os_image(machine, machines_view, state, os, skip_reset_stat
var size = sizes_map[machines_view];
var img_selector = views_map[machines_view];
var cls = states_map[state];
if (os === "unknown") { os = synnefo.config.unknown_os }
var new_img = 'url("' + synnefo.config.machines_icons_url + size + '/' + os + '-sprite.png")';
......
......@@ -484,7 +484,7 @@
var os = vm.get_os();
var icons = window.os_icons || views.ListView.VM_OS_ICONS;
if (icons.indexOf(os) == -1) {
os = "unknown";
os = snf.config.unknown_os;
}
return os;
},
......@@ -495,7 +495,7 @@
var icons = window.os_icons || views.ListView.VM_OS_ICONS;
if (icons.indexOf(os) == -1) {
os = "unknown";
os = snf.config.unknown_os;
}
var st = "off";
......
......@@ -627,6 +627,7 @@
synnefo.config.indicators_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/indicators/';
synnefo.config.machines_icons_url = '{{ SYNNEFO_IMAGES_URL }}icons/machines/';
synnefo.config.support_ssh_os_list = {{ support_ssh_os_list|safe }};
synnefo.config.unknown_os = {{ unknown_os|safe }};
synnefo.config.os_created_users = {{ os_created_users|safe }};
synnefo.config.logout_redirect = '{{ logout_redirect }}';
......
......@@ -86,6 +86,7 @@ IMAGE_DELETED_SIZE_TITLE = getattr(settings, 'UI_IMAGE_DELETED_SIZE_TITLE',
SUPPORT_SSH_OS_LIST = getattr(settings, "UI_SUPPORT_SSH_OS_LIST",)
OS_CREATED_USERS = getattr(settings, "UI_OS_DEFAULT_USER_MAP")
UNKNOWN_OS = getattr(settings, "UI_UNKNOWN_OS", "unknown")
LOGOUT_URL = getattr(settings, "UI_LOGOUT_URL", '/im/authenticate')
LOGIN_URL = getattr(settings, "UI_LOGIN_URL", '/im/login')
AUTH_COOKIE_NAME = getattr(settings, "UI_AUTH_COOKIE_NAME", 'synnefo_user')
......@@ -99,7 +100,7 @@ SKIP_TIMEOUTS = getattr(settings, "UI_SKIP_TIMEOUTS", 1)
# Additional settings
VM_NAME_TEMPLATE = getattr(settings, "VM_CREATE_NAME_TPL", "My {0} server")
VM_HOSTNAME_FORMAT = getattr(settings, "UI_VM_HOSTNAME_FORMAT",
'snf-%(id)s.vm.okeanos.grnet.gr')
'snf-%(id)s.vm.synnefo.org')
if isinstance(VM_HOSTNAME_FORMAT, basestring):
VM_HOSTNAME_FORMAT = VM_HOSTNAME_FORMAT % {'id':'{0}'}
......@@ -127,7 +128,7 @@ UI_SYNNEFO_JS_WEB_URL = getattr(settings,
# extensions
ENABLE_GLANCE = getattr(settings, 'UI_ENABLE_GLANCE', True)
GLANCE_API_URL = getattr(settings, 'UI_GLANCE_API_URL', '/glance')
FEEDBACK_CONTACTS = getattr(settings, "FEEDBACK_CONTACTS", [])
FEEDBACK_CONTACTS = getattr(settings, "FEEDBACK_CONTACTS", [])
DIAGNOSTICS_UPDATE_INTERVAL = getattr(settings,
'UI_DIAGNOSTICS_UPDATE_INTERVAL', 2000)
......@@ -203,6 +204,7 @@ def home(request):
'flavors_disk_templates_info': json.dumps(FLAVORS_DISK_TEMPLATES_INFO),
'support_ssh_os_list': json.dumps(SUPPORT_SSH_OS_LIST),
'os_created_users': json.dumps(OS_CREATED_USERS),
'unknown_os': json.dumps(UNKNOWN_OS),
'userdata_keys_limit': json.dumps(MAX_SSH_KEYS_PER_USER),
'use_glance': json.dumps(ENABLE_GLANCE),
'glance_api_url': json.dumps(GLANCE_API_URL),
......@@ -449,8 +451,8 @@ def feedback_submit(request):
mail_subject_txt = 'Feedback from '
+ snf_settings.BRANDING_SERVICE_NAME +' application'
mail_subject = unicode(_mail_subject_txt)
mail_subject = unicode(_mail_subject_txt)
mail_context = {'message': message, 'data': data, 'email': email,
'allow_data_send': allow_data_send, 'request': request}
mail_content = render_to_string("feedback_mail.txt", mail_context)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment