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

ui: Fix resolving of vm hostname

parent 1800feec
......@@ -1300,13 +1300,12 @@
},
get_hostname: function() {
var hostname = this.get_meta('hostname');
var hostname = this.get_meta('hostname') || this.get('fqdn');
if (!hostname) {
if (synnefo.config.vm_hostname_format) {
hostname = synnefo.config.vm_hostname_format.format(this.id);
} else {
// TODO: resolve public ip
hostname = 'PUBLIC NIC';
hostname = 'unknown';
}
}
return hostname;
......@@ -2005,8 +2004,8 @@
// network metadata
data['firewalls'] = {};
data['fqdn'] = synnefo.config.vm_hostname_format.format(data['id']);
data['fqdn'] = data['SNF:fqdn'] || synnefo.config.vm_hostname_format.format(data['id']);
// if vm has no metadata, no metadata object
// is in json response, reset it to force
......
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