more pep8 fixes

This commit is contained in:
Thomas Waldmann 2013-11-05 00:32:07 +01:00
parent 51e5efbe8f
commit e2f51d5eb1
3 changed files with 6 additions and 6 deletions

View File

@ -138,14 +138,14 @@ class Host(models.Model):
return Host.objects.filter(
subdomain=splitted[0], domain__domain=splitted[1], **kwargs)
def getIPv4(self):
def get_ipv4(self):
try:
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,
dnstools.NameServerNotAvailable):
return 'error'
def getIPv6(self):
def get_ipv6(self):
try:
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,

View File

@ -36,7 +36,7 @@
</p>
<div class="form-group">
<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>
<input class="form-control" type="text" id="myipv4" name="myipv4" placeholder="give new ipv4 address" value="{{ request.session.ipv4 }}" required autofocus>
</div>
@ -44,7 +44,7 @@
<p></p>
<div class="form-group">
<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>
<input class="form-control" type="text" id="myipv6" name="myipv6" placeholder="give new ipv6 address" value="{{ request.session.ipv6 }}" required>
</div>

View File

@ -10,8 +10,8 @@
{% for host in hosts %}
<tr>
<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.getIPv6 }} ({{ host.last_update_ipv6|timesince }}, {% if not host.ssl_update_ipv6 %}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.get_ipv6 }} ({{ host.last_update_ipv6|timesince }}, {% if not host.ssl_update_ipv6 %}no {% endif %}SSL)</td>
<td>{{ host.comment }}</td>
</tr>
{% empty %}