From 28fd43ba07990142e9d2c3fe216058ff0777dc92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 10 Feb 2015 11:15:05 +0100 Subject: [PATCH 1/4] use first zone URL when checking for operationality (#6460) Checking the base URL doesn't work for services such as Combo where the base URL will 404 as long as no page have been added. --- hobo/environment/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hobo/environment/models.py b/hobo/environment/models.py index b37a1eb..f32aeb9 100644 --- a/hobo/environment/models.py +++ b/hobo/environment/models.py @@ -65,10 +65,11 @@ class ServiceBase(models.Model): once_now = now() self.last_operational_check_timestamp = once_now try: - fd = urllib2.urlopen(self.base_url, timeout=10) + zone = self.get_admin_zones()[0] + fd = urllib2.urlopen(zone.href, timeout=10) fd.close() self.last_operational_success_timestamp = once_now - except (urllib2.URLError, urllib2.HTTPError): + except (urllib2.URLError, urllib2.HTTPError), e: pass self.save(update_fields=('last_operational_check_timestamp', 'last_operational_success_timestamp')) -- 2.1.4