Commit f00910dd authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

ui: Remove UI_VM_HOSTNAME_FORMAT setting

no longer needed since compute api responses contain the fqdn vm attribute.

Setting ``UI_NO_FQDN_MESSAGE`` setting added. Setting value will be displayed
when fqdn vm attribute is empty.
parent 674fb570
......@@ -75,9 +75,6 @@
## vms. {0} gets replaced by the image OS value
#VM_CREATE_NAME_TPL = "My {0} server"
#
## Template to use to build vm hostname
#UI_VM_HOSTNAME_FORMAT = 'snf-%(id)s.vm.synnefo.org'
#
## Name/description metadata for the available flavor disk templates
## Dict key is the disk_template value as stored in database
#UI_FLAVORS_DISK_TEMPLATES_INFO = {
......@@ -185,3 +182,6 @@
# 'admin@synnefo.gr': 'system',
# 'images@synnefo.gr': 'system'
#}
#
## Message to display for vms with empty fqdn value
#UI_NO_FQDN_MESSAGE = 'No available FQDN'
......@@ -2038,8 +2038,7 @@
// network metadata
data['firewalls'] = {};
data['fqdn'] = data['SNF:fqdn'] || synnefo.config.vm_hostname_format.format(data['id']);
data['fqdn'] = data['SNF:fqdn'];
// if vm has no metadata, no metadata object
// is in json response, reset it to force
......
......@@ -828,7 +828,7 @@
// truncate name
el.find("span.name").text(util.truncate(vm.get("name"), 40));
el.find('.fqdn').text(vm.get('fqdn'));
el.find('.fqdn').text(vm.get('fqdn') || synnefo.config.no_fqdn_message);
el.find("div.status").text(STATE_TEXTS[vm.state()]);
// set state class
el.find("div.state").removeClass().addClass(views.IconView.STATE_CLASSES[vm.state()].join(" "));
......
......@@ -386,7 +386,7 @@
// truncate name
el.find(".machine-detail.name").text(util.truncate(vm.get("name"), 53));
el.find(".fqdn").text(vm.get("fqdn"));
el.find(".fqdn").text(vm.get("fqdn") || synnefo.confi.no_fqdn_message);
// set the state (i18n ??)
el.find(".state-label").text(STATE_TEXTS[vm.state()]);
// set state class
......
......@@ -674,7 +674,7 @@
synnefo.config.network_allow_multiple_destory = {{ network_allow_multiple_destroy }};
synnefo.config.group_public_networks = {{ group_public_networks }};
synnefo.config.grouped_public_network_name = {{ grouped_public_network_name|safe }};
synnefo.config.vm_hostname_format = {{ vm_hostname_format|safe }};
synnefo.config.no_fqdn_message = {{ no_fqdn_message|safe }};
synnefo.config.automatic_network_range_format = {{ automatic_network_range_format|safe }};
synnefo.config.custom_image_help_url = '{{ custom_image_help_url|safe }}';
synnefo.config.forced_server_networks = {{ forced_server_networks|safe }};
......
......@@ -95,11 +95,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.synnefo.org')
if isinstance(VM_HOSTNAME_FORMAT, basestring):
VM_HOSTNAME_FORMAT = VM_HOSTNAME_FORMAT % {'id': '{0}'}
NO_FQDN_MESSAGE = getattr(settings, "UI_NO_FQDN_MESSAGE", "No available FQDN")
MAX_SSH_KEYS_PER_USER = getattr(settings, "USERDATA_MAX_SSH_KEYS_PER_USER")
FLAVORS_DISK_TEMPLATES_INFO = \
......@@ -246,7 +242,7 @@ def home(request):
'private_networks_nic_hotplug':
json.dumps(PRIVATE_NETWORKS_NIC_HOTPLUG),
'diagnostics_update_interval': json.dumps(DIAGNOSTICS_UPDATE_INTERVAL),
'vm_hostname_format': json.dumps(VM_HOSTNAME_FORMAT)
'no_fqdn_message': json.dumps(NO_FQDN_MESSAGE)
}
return template('home', request, 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