more pep8 fixes
This commit is contained in:
parent
51e5efbe8f
commit
e2f51d5eb1
@ -138,14 +138,14 @@ class Host(models.Model):
|
|||||||
return Host.objects.filter(
|
return Host.objects.filter(
|
||||||
subdomain=splitted[0], domain__domain=splitted[1], **kwargs)
|
subdomain=splitted[0], domain__domain=splitted[1], **kwargs)
|
||||||
|
|
||||||
def getIPv4(self):
|
def get_ipv4(self):
|
||||||
try:
|
try:
|
||||||
return dnstools.query_ns(self.get_fqdn(), 'A', origin=self.domain.domain)
|
return dnstools.query_ns(self.get_fqdn(), 'A', origin=self.domain.domain)
|
||||||
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers, dns.resolver.Timeout,
|
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers, dns.resolver.Timeout,
|
||||||
dnstools.NameServerNotAvailable):
|
dnstools.NameServerNotAvailable):
|
||||||
return 'error'
|
return 'error'
|
||||||
|
|
||||||
def getIPv6(self):
|
def get_ipv6(self):
|
||||||
try:
|
try:
|
||||||
return dnstools.query_ns(self.get_fqdn(), 'AAAA', origin=self.domain.domain)
|
return dnstools.query_ns(self.get_fqdn(), 'AAAA', origin=self.domain.domain)
|
||||||
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers, dns.resolver.Timeout,
|
except (dns.resolver.NXDOMAIN, dns.resolver.NoAnswer, dns.resolver.NoNameservers, dns.resolver.Timeout,
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="current_ipv4">Current IPv4 address from master nameserver</label>
|
<label for="current_ipv4">Current IPv4 address from master nameserver</label>
|
||||||
<input class="form-control" type="text" id="current_ipv4" name="current_ipv4" value="{{ host.getIPv4 }}" disabled>
|
<input class="form-control" type="text" id="current_ipv4" name="current_ipv4" value="{{ host.get_ipv4 }}" disabled>
|
||||||
<label for="myipv4">Set new IPv4 address</label>
|
<label for="myipv4">Set new IPv4 address</label>
|
||||||
<input class="form-control" type="text" id="myipv4" name="myipv4" placeholder="give new ipv4 address" value="{{ request.session.ipv4 }}" required autofocus>
|
<input class="form-control" type="text" id="myipv4" name="myipv4" placeholder="give new ipv4 address" value="{{ request.session.ipv4 }}" required autofocus>
|
||||||
</div>
|
</div>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
<p></p>
|
<p></p>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="current_ipv6">Current IPv6 address from master nameserver</label>
|
<label for="current_ipv6">Current IPv6 address from master nameserver</label>
|
||||||
<input class="form-control" type="text" id="current_ipv6" name="current_ipv6" value="{{ host.getIPv6 }}" disabled>
|
<input class="form-control" type="text" id="current_ipv6" name="current_ipv6" value="{{ host.get_ipv6 }}" disabled>
|
||||||
<label for="myipv6">Set new IPv6 address</label>
|
<label for="myipv6">Set new IPv6 address</label>
|
||||||
<input class="form-control" type="text" id="myipv6" name="myipv6" placeholder="give new ipv6 address" value="{{ request.session.ipv6 }}" required>
|
<input class="form-control" type="text" id="myipv6" name="myipv6" placeholder="give new ipv6 address" value="{{ request.session.ipv6 }}" required>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
{% for host in hosts %}
|
{% for host in hosts %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'host_view' host.pk %}"><b>{{ host.subdomain }}.{{ host.domain.domain }}</b></a></td>
|
<td><a href="{% url 'host_view' host.pk %}"><b>{{ host.subdomain }}.{{ host.domain.domain }}</b></a></td>
|
||||||
<td>{{ host.getIPv4 }} ({{ host.last_update_ipv4|timesince }}, {% if not host.ssl_update_ipv4 %}no {% endif %}SSL)</td>
|
<td>{{ host.get_ipv4 }} ({{ host.last_update_ipv4|timesince }}, {% if not host.ssl_update_ipv4 %}no {% endif %}SSL)</td>
|
||||||
<td>{{ host.getIPv6 }} ({{ host.last_update_ipv6|timesince }}, {% if not host.ssl_update_ipv6 %}no {% endif %}SSL)</td>
|
<td>{{ host.get_ipv6 }} ({{ host.last_update_ipv6|timesince }}, {% if not host.ssl_update_ipv6 %}no {% endif %}SSL)</td>
|
||||||
<td>{{ host.comment }}</td>
|
<td>{{ host.comment }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user