Revision 3e323ae8
b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js | ||
---|---|---|
1300 | 1300 |
}, |
1301 | 1301 |
|
1302 | 1302 |
get_hostname: function() { |
1303 |
var hostname = this.get_meta('hostname'); |
|
1303 |
var hostname = this.get_meta('hostname') || this.get('fqdn');
|
|
1304 | 1304 |
if (!hostname) { |
1305 | 1305 |
if (synnefo.config.vm_hostname_format) { |
1306 | 1306 |
hostname = synnefo.config.vm_hostname_format.format(this.id); |
1307 | 1307 |
} else { |
1308 |
// TODO: resolve public ip |
|
1309 |
hostname = 'PUBLIC NIC'; |
|
1308 |
hostname = 'unknown'; |
|
1310 | 1309 |
} |
1311 | 1310 |
} |
1312 | 1311 |
return hostname; |
... | ... | |
2005 | 2004 |
|
2006 | 2005 |
// network metadata |
2007 | 2006 |
data['firewalls'] = {}; |
2008 |
|
|
2009 |
data['fqdn'] = synnefo.config.vm_hostname_format.format(data['id']); |
|
2007 |
|
|
2008 |
data['fqdn'] = data['SNF:fqdn'] || synnefo.config.vm_hostname_format.format(data['id']);
|
|
2010 | 2009 |
|
2011 | 2010 |
// if vm has no metadata, no metadata object |
2012 | 2011 |
// is in json response, reset it to force |
Also available in: Unified diff