Skip to content
Snippets Groups Projects
Commit b5f52d9f authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add host FQDN in host view

JIRA INFRA-459 #action In Progress
parent 108b1db0
No related branches found
No related tags found
No related merge requests found
......@@ -943,6 +943,17 @@ class Host(CreatedMixin, db.Model):
except IndexError:
return None
@property
def fqdn(self):
"""Return the host fully qualified domain name
The domain is based on the main interface
"""
if self.main_interface:
return f"{self.name}.{self.main_interface.network.domain}"
else:
return self.name
def __str__(self):
return str(self.name)
......
......@@ -22,7 +22,7 @@
<div class="col-sm-9">
<dl class="row">
<dt class="col-sm-3">Hostname</dt>
<dd class="col-sm-9">{{ host.name }}</dd>
<dd class="col-sm-9">{{ host.fqdn }}</dd>
<dt class="col-sm-3">Device Type</dt>
<dd class="col-sm-9">{{ host.device_type }}</dd>
{% if host.items %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment