Commit 79cab042 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou

ui: Introduce setting UI_SUPPORT_SSH_OS_FAMILY_LIST

os families list setting for which ui will allow ssh key injection
parent 981ef332
......@@ -236,6 +236,8 @@ Cyclades UI
- Double escaping fix in machine create wizard images list and machine details
subview.
- Fix image ordering in machine create wizard.
- New setting ``UI_SUPPORT_SSH_OS_FAMILY_LIST``. A list of image OS families
for which ui will enable ssh key injection in machine wizard.
Pithos
......
......@@ -189,3 +189,6 @@
##Base url for external css fonts. If set to ``None``, no external css fonts
##will be loaded.
#UI_FONTS_BASE_URL = "//fonts.googleapis.com/"
#
## A list of os family names that support ssh public key assignment
#UI_SUPPORT_SSH_OS_FAMILY_LIST = ['linux', 'openbsd', 'freebsd', 'netbsd']
......@@ -552,12 +552,19 @@
},
_supports_ssh: function() {
if (synnefo.config.support_ssh_os_list.indexOf(this.get_os()) > -1) {
var os_list = synnefo.config.support_ssh_os_list;
var osfamily_list = synnefo.config.support_ssh_os_family_list;
var os = this.get_os();
if (os_list.indexOf(os) > -1) {
return true;
}
if (this.get_meta('osfamily') == 'linux') {
return true;
var osfamily = this.get_meta("osfamily");
if (osfamily_list.indexOf(osfamily) > -1) {
return true
}
return false;
},
......
......@@ -660,6 +660,7 @@
synnefo.config.ui_console_url = '{% url ui_machines_console %}';
synnefo.config.ui_connect_url = '{% url ui_machines_connect %}';
synnefo.config.support_ssh_os_list = {{ support_ssh_os_list|safe }};
synnefo.config.support_ssh_os_family_list = {{ support_ssh_os_family_list|safe }};
synnefo.config.unknown_os = {{ unknown_os|safe }};
synnefo.config.os_created_users = {{ os_created_users|safe }};
synnefo.config.feedback_post_url = {{ feedback_post_url|safe }};
......
......@@ -78,6 +78,9 @@ IMAGE_DELETED_SIZE_TITLE = \
getattr(settings, 'UI_IMAGE_DELETED_SIZE_TITLE', '(none)')
SUPPORT_SSH_OS_LIST = getattr(settings, "UI_SUPPORT_SSH_OS_LIST",)
SUPPORT_SSH_OS_FAMILY_LIST = getattr(settings, "UI_SUPPORT_SSH_OS_FAMILY_LIST",
['linux', 'openbsd', 'freebsd', 'netbsd'])
OS_CREATED_USERS = getattr(settings, "UI_OS_DEFAULT_USER_MAP")
UNKNOWN_OS = getattr(settings, "UI_UNKNOWN_OS", "unknown")
......@@ -225,6 +228,7 @@ def home(request):
'vm_name_template': json.dumps(VM_NAME_TEMPLATE),
'flavors_disk_templates_info': json.dumps(FLAVORS_DISK_TEMPLATES_INFO),
'support_ssh_os_list': json.dumps(SUPPORT_SSH_OS_LIST),
'support_ssh_os_family_list': json.dumps(SUPPORT_SSH_OS_FAMILY_LIST),
'unknown_os': json.dumps(UNKNOWN_OS),
'os_created_users': json.dumps(OS_CREATED_USERS),
'userdata_keys_limit': json.dumps(MAX_SSH_KEYS_PER_USER),
......
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