From b262371a5314a733f40afabe7f53b7759280c082 Mon Sep 17 00:00:00 2001 From: Peter Baumgartner Date: Wed, 5 Mar 2014 22:13:09 -0600 Subject: [PATCH] Upgrades to Django 1.6 --- cabot/cabotapp/alert.py | 6 +++--- cabot/cabotapp/models.py | 2 +- cabot/cabotapp/tests/__init__.py | 1 - cabot/templates/base.html | 18 +++++++++--------- .../templates/cabotapp/_statuscheck_list.html | 16 ++++++++-------- cabot/templates/cabotapp/service_detail.html | 4 ++-- cabot/templates/cabotapp/service_form.html | 4 ++-- cabot/templates/cabotapp/service_list.html | 8 ++++---- cabot/templates/cabotapp/shift_list.html | 4 ++-- .../templates/cabotapp/statuscheck_detail.html | 8 ++++---- cabot/templates/cabotapp/statuscheck_form.html | 4 ++-- .../cabotapp/statuscheckresult_detail.html | 4 ++-- cabot/templates/cabotapp/subscriptions.html | 6 +++--- cabot/templates/cabotapp/userprofile_form.html | 2 +- cabot/templates/registration/login.html | 2 +- cabot/urls.py | 2 +- setup.py | 6 +++--- 17 files changed, 48 insertions(+), 49 deletions(-) diff --git a/cabot/cabotapp/alert.py b/cabot/cabotapp/alert.py index 914417f..0826113 100644 --- a/cabot/cabotapp/alert.py +++ b/cabot/cabotapp/alert.py @@ -12,7 +12,7 @@ import logging logger = logging.getLogger(__name__) -email_template = """Service {{ service.name }} {{ scheme }}://{{ host }}{% url service pk=service.id %} {% if service.overall_status != service.PASSING_STATUS %}alerting with status: {{ service.overall_status }}{% else %}is back to normal{% endif %}. +email_template = """Service {{ service.name }} {{ scheme }}://{{ host }}{% url 'service' pk=service.id %} {% if service.overall_status != service.PASSING_STATUS %}alerting with status: {{ service.overall_status }}{% else %}is back to normal{% endif %}. {% if service.overall_status != service.PASSING_STATUS %} CHECKS FAILING:{% for check in service.all_failing_checks %} FAILING - {{ check.name }} - Type: {{ check.check_category }} - Importance: {{ check.get_importance_display }}{% endfor %} @@ -23,9 +23,9 @@ Passing checks:{% for check in service.all_passing_checks %} {% endif %} """ -hipchat_template = "Service {{ service.name }} {% if service.overall_status == service.PASSING_STATUS %}is back to normal{% else %}reporting {{ service.overall_status }} status{% endif %}: {{ scheme }}://{{ host }}{% url service pk=service.id %}. {% if service.overall_status != service.PASSING_STATUS %}Checks failing:{% for check in service.all_failing_checks %} {{ check.name }}{% if check.last_result.error %} ({{ check.last_result.error|safe }}){% endif %}{% endfor %}{% endif %}{% if alert %}{% for alias in users %} @{{ alias }}{% endfor %}{% endif %}" +hipchat_template = "Service {{ service.name }} {% if service.overall_status == service.PASSING_STATUS %}is back to normal{% else %}reporting {{ service.overall_status }} status{% endif %}: {{ scheme }}://{{ host }}{% url 'service' pk=service.id %}. {% if service.overall_status != service.PASSING_STATUS %}Checks failing:{% for check in service.all_failing_checks %} {{ check.name }}{% if check.last_result.error %} ({{ check.last_result.error|safe }}){% endif %}{% endfor %}{% endif %}{% if alert %}{% for alias in users %} @{{ alias }}{% endfor %}{% endif %}" -sms_template = "Service {{ service.name }} {% if service.overall_status == service.PASSING_STATUS %}is back to normal{% else %}reporting {{ service.overall_status }} status{% endif %}: {{ scheme }}://{{ host }}{% url service pk=service.id %}" +sms_template = "Service {{ service.name }} {% if service.overall_status == service.PASSING_STATUS %}is back to normal{% else %}reporting {{ service.overall_status }} status{% endif %}: {{ scheme }}://{{ host }}{% url 'service' pk=service.id %}" telephone_template = "This is an urgent message from Arachnys monitoring. Service \"{{ service.name }}\" is erroring. Please check Cabot urgently." diff --git a/cabot/cabotapp/models.py b/cabot/cabotapp/models.py index 414eadf..1a25f0c 100644 --- a/cabot/cabotapp/models.py +++ b/cabot/cabotapp/models.py @@ -3,7 +3,7 @@ from django.conf import settings from django.core.exceptions import ValidationError from polymorphic import PolymorphicModel from django.db.models import F -from django.contrib.admin.models import User +from django.contrib.auth.models import User from .jenkins import get_job_status from .alert import send_alert diff --git a/cabot/cabotapp/tests/__init__.py b/cabot/cabotapp/tests/__init__.py index eb60afd..e69de29 100644 --- a/cabot/cabotapp/tests/__init__.py +++ b/cabot/cabotapp/tests/__init__.py @@ -1 +0,0 @@ -from basic import * diff --git a/cabot/templates/base.html b/cabot/templates/base.html index 00c0920..a7ca2ba 100644 --- a/cabot/templates/base.html +++ b/cabot/templates/base.html @@ -32,7 +32,7 @@
@@ -77,7 +77,7 @@

Status check report

-
+
{{ report_form.service }} diff --git a/cabot/templates/cabotapp/service_form.html b/cabot/templates/cabotapp/service_form.html index f9658b7..b4e6eb6 100644 --- a/cabot/templates/cabotapp/service_form.html +++ b/cabot/templates/cabotapp/service_form.html @@ -14,11 +14,11 @@
{% if form.instance.id %} {% endif %}
diff --git a/cabot/templates/cabotapp/service_list.html b/cabot/templates/cabotapp/service_list.html index 7407494..e1549b6 100644 --- a/cabot/templates/cabotapp/service_list.html +++ b/cabot/templates/cabotapp/service_list.html @@ -6,7 +6,7 @@

Services

-

+

@@ -27,7 +27,7 @@ {% for service in services %} - {{service.name}} + {{service.name}} {% if service.alerts_enabled %}{{ service.overall_status|lower|capfirst }}{% else %}Disabled{% endif %} @@ -39,7 +39,7 @@ {{ service.inactive_status_checks.all.count }} - + @@ -60,4 +60,4 @@ {% endcompress %} -{% endblock js %} \ No newline at end of file +{% endblock js %} diff --git a/cabot/templates/cabotapp/shift_list.html b/cabot/templates/cabotapp/shift_list.html index fc1b56e..ab5bd60 100644 --- a/cabot/templates/cabotapp/shift_list.html +++ b/cabot/templates/cabotapp/shift_list.html @@ -22,7 +22,7 @@ {% for shift in shifts %} - {{ shift.user.username }} + {{ shift.user.username }} {{ shift.start }} - {{ shift.end }} @@ -49,4 +49,4 @@ {% endcompress %} -{% endblock js %} \ No newline at end of file +{% endblock js %} diff --git a/cabot/templates/cabotapp/statuscheck_detail.html b/cabot/templates/cabotapp/statuscheck_detail.html index 17114a5..25ada47 100644 --- a/cabot/templates/cabotapp/statuscheck_detail.html +++ b/cabot/templates/cabotapp/statuscheck_detail.html @@ -13,7 +13,7 @@ {% if check.polymorphic_ctype.model == 'jenkinsstatuscheck' %} {% endif %} - +
@@ -45,7 +45,7 @@ - {{ result.time }} + {{ result.time }} {{ result.time_complete }} {{ result.took }} @@ -63,7 +63,7 @@ {% if service.hackpad_id %}

-

Recovery instructions for linked service {{ service.name }}

+

Recovery instructions for linked service {{ service.name }}

@@ -81,4 +81,4 @@ {% endcompress %} -{% endblock js %} \ No newline at end of file +{% endblock js %} diff --git a/cabot/templates/cabotapp/statuscheck_form.html b/cabot/templates/cabotapp/statuscheck_form.html index 43b4608..b3ae871 100644 --- a/cabot/templates/cabotapp/statuscheck_form.html +++ b/cabot/templates/cabotapp/statuscheck_form.html @@ -14,11 +14,11 @@
{% if form.instance.id %} {% endif %}
diff --git a/cabot/templates/cabotapp/statuscheckresult_detail.html b/cabot/templates/cabotapp/statuscheckresult_detail.html index 68e4ebc..28cc259 100644 --- a/cabot/templates/cabotapp/statuscheckresult_detail.html +++ b/cabot/templates/cabotapp/statuscheckresult_detail.html @@ -5,7 +5,7 @@

-

Check result: {{ result.check.name }}

+

Check result: {{ result.check.name }}

{{ result.status|capfirst }}

@@ -56,4 +56,4 @@ Morris.Line hideHover: true {% endcompress %} -{% endblock js %} \ No newline at end of file +{% endblock js %} diff --git a/cabot/templates/cabotapp/subscriptions.html b/cabot/templates/cabotapp/subscriptions.html index 30f868a..0bd58f5 100644 --- a/cabot/templates/cabotapp/subscriptions.html +++ b/cabot/templates/cabotapp/subscriptions.html @@ -29,7 +29,7 @@ {% endif %} {% endif %} - + @@ -40,7 +40,7 @@ {% for service in services %} - {{service.name}} + {{service.name}} {% if service.email_alert %}email{% endif %} {% if service.hipchat_alert %}hipchat{% endif %} {% if service.sms_alert %}sms{% endif %} @@ -63,4 +63,4 @@
-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/cabot/templates/cabotapp/userprofile_form.html b/cabot/templates/cabotapp/userprofile_form.html index a4e029d..67da949 100644 --- a/cabot/templates/cabotapp/userprofile_form.html +++ b/cabot/templates/cabotapp/userprofile_form.html @@ -17,7 +17,7 @@
diff --git a/cabot/templates/registration/login.html b/cabot/templates/registration/login.html index 83847bc..ce38c7f 100644 --- a/cabot/templates/registration/login.html +++ b/cabot/templates/registration/login.html @@ -14,7 +14,7 @@
diff --git a/cabot/urls.py b/cabot/urls.py index 3e30d9e..1147fa1 100644 --- a/cabot/urls.py +++ b/cabot/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, include, url +from django.conf.urls import patterns, include, url from cabot.cabotapp.views import ( run_status_check, graphite_api_data, twiml_callback, checks_run_recently, GraphiteCheckCreateView, GraphiteCheckUpdateView, diff --git a/setup.py b/setup.py index 589a54e..2f4ae2b 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,9 @@ setup( 'https://argparse.googlecode.com/files/argparse-1.2.1.tar.gz', ], install_requires=[ - 'Django==1.4.10', + 'Django==1.6.2', 'PyJWT==0.1.2', - 'South==0.7.6', + 'South==0.8.4', 'amqp==1.3.3', 'anyjson==0.3.3', 'billiard==3.3.0.13', @@ -28,7 +28,7 @@ setup( 'django-appconf==0.6', 'django-celery==3.1.1', 'django-celery-with-redis==3.0', - 'django-compressor==1.2', + 'django-compressor==1.3', 'django-dotenv==1.2', 'django-jsonify==0.2.1', 'django-mptt==0.6.0',