From e18d0e0d4b3d6b0491a4c98d561e94cf594a9d37 Mon Sep 17 00:00:00 2001 From: Jeffrey Forman Date: Fri, 25 Nov 2011 12:07:22 -0500 Subject: [PATCH] Clean up error display in template, and handle a DNS server which is uncontactable. --- binder/bcommon/models.py | 3 +-- binder/templates/base.htm | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/binder/bcommon/models.py b/binder/bcommon/models.py index 7ca8aed..5d92a56 100644 --- a/binder/bcommon/models.py +++ b/binder/bcommon/models.py @@ -6,7 +6,6 @@ import urllib2 from BeautifulSoup import BeautifulStoneSoup as BS import re - TSIG_ALGORITHMS = (('hmac-md5', 'MD5'),('hmac-sha1', 'SHA1'),('hmac-224', 'SHA224'),('hmac-sha256', 'SHA256'),('hmac-sha384', 'SHA384'),('hmac-sha512', 'SHA512')) class BindServer(models.Model): @@ -25,7 +24,7 @@ class BindServer(models.Model): try: http_request = urllib2.urlopen(myreq) 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 = [] xmloutput = http_request.read() diff --git a/binder/templates/base.htm b/binder/templates/base.htm index 8b54e7d..4e1e66b 100644 --- a/binder/templates/base.htm +++ b/binder/templates/base.htm @@ -15,8 +15,8 @@ {% endblock pageheader %} -{% if errors %} {% block errors %} +{% if errors %}
Errors were encountered:
@@ -28,8 +28,9 @@ {{ error_context }} {% endif %}
-{% endblock errors %} {% endif %} +{% endblock errors %} +
{% block body %} {% endblock body %}