Clean up error display in template, and handle a DNS server which is uncontactable.
This commit is contained in:
parent
32aadb1ee2
commit
e18d0e0d4b
|
@ -6,7 +6,6 @@ import urllib2
|
||||||
from BeautifulSoup import BeautifulStoneSoup as BS
|
from BeautifulSoup import BeautifulStoneSoup as BS
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
TSIG_ALGORITHMS = (('hmac-md5', 'MD5'),('hmac-sha1', 'SHA1'),('hmac-224', 'SHA224'),('hmac-sha256', 'SHA256'),('hmac-sha384', 'SHA384'),('hmac-sha512', 'SHA512'))
|
TSIG_ALGORITHMS = (('hmac-md5', 'MD5'),('hmac-sha1', 'SHA1'),('hmac-224', 'SHA224'),('hmac-sha256', 'SHA256'),('hmac-sha384', 'SHA384'),('hmac-sha512', 'SHA512'))
|
||||||
|
|
||||||
class BindServer(models.Model):
|
class BindServer(models.Model):
|
||||||
|
@ -25,7 +24,7 @@ class BindServer(models.Model):
|
||||||
try:
|
try:
|
||||||
http_request = urllib2.urlopen(myreq)
|
http_request = urllib2.urlopen(myreq)
|
||||||
except urllib2.URLError, err_reason: # Error retrieving zone list.
|
except urllib2.URLError, err_reason: # Error retrieving zone list.
|
||||||
return { 'errors' : err_reason, 'error_context' : "Trying to retrieve zone list from %s" % dns_hostname }
|
return { 'errors' : err_reason, 'error_context' : "Trying to retrieve zone list from %s" % self.hostname }
|
||||||
|
|
||||||
return_array = []
|
return_array = []
|
||||||
xmloutput = http_request.read()
|
xmloutput = http_request.read()
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
{% endblock pageheader %}
|
{% endblock pageheader %}
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
{% if errors %}
|
|
||||||
{% block errors %}
|
{% block errors %}
|
||||||
|
{% if errors %}
|
||||||
<div class="errors">
|
<div class="errors">
|
||||||
Errors were encountered:
|
Errors were encountered:
|
||||||
<br>
|
<br>
|
||||||
|
@ -28,8 +28,9 @@
|
||||||
{{ error_context }}
|
{{ error_context }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<hr>
|
<hr>
|
||||||
{% endblock errors %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endblock errors %}
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|
Loading…
Reference in New Issue