diff --git a/stacktach/views.py b/stacktach/views.py index a4976a4..d770645 100644 --- a/stacktach/views.py +++ b/stacktach/views.py @@ -4,6 +4,7 @@ import datetime import json import pprint +from django import db from django import http from django.shortcuts import render_to_response from django import template @@ -321,13 +322,16 @@ def aggregate_usage(raw): def str_time_to_unix(when): try: + when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S") + except ValueError: try: when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S.%f") except ValueError: - # Old way of doing it - when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f") - except Exception, e: - pass + try: + # Old way of doing it + when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f") + except Exception, e: + print "BAD DATE: ", e return dt.dt_to_decimal(when) diff --git a/worker/worker.py b/worker/worker.py index c164a86..7e10f4e 100644 --- a/worker/worker.py +++ b/worker/worker.py @@ -152,7 +152,8 @@ def run(deployment_config): LOG.debug("Processing on '%s'" % name) with kombu.connection.BrokerConnection(**params) as conn: try: - consumer = NovaConsumer(name, conn, deployment, durable) + consumer = NovaConsumer(name, conn, deployment, durable, + queue_arguments) consumer.run() except Exception as e: LOG.exception("name=%s, exception=%s. Reconnecting in 5s" %