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

ui: Fix resolving of vm hostname

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