merge errors and a datetime fix
This commit is contained in:
@@ -4,6 +4,7 @@ import datetime
|
|||||||
import json
|
import json
|
||||||
import pprint
|
import pprint
|
||||||
|
|
||||||
|
from django import db
|
||||||
from django import http
|
from django import http
|
||||||
from django.shortcuts import render_to_response
|
from django.shortcuts import render_to_response
|
||||||
from django import template
|
from django import template
|
||||||
@@ -321,13 +322,16 @@ def aggregate_usage(raw):
|
|||||||
|
|
||||||
def str_time_to_unix(when):
|
def str_time_to_unix(when):
|
||||||
try:
|
try:
|
||||||
|
when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S")
|
||||||
|
except ValueError:
|
||||||
try:
|
try:
|
||||||
when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S.%f")
|
when = datetime.datetime.strptime(when, "%Y-%m-%d %H:%M:%S.%f")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
# Old way of doing it
|
try:
|
||||||
when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f")
|
# Old way of doing it
|
||||||
except Exception, e:
|
when = datetime.datetime.strptime(when, "%Y-%m-%dT%H:%M:%S.%f")
|
||||||
pass
|
except Exception, e:
|
||||||
|
print "BAD DATE: ", e
|
||||||
return dt.dt_to_decimal(when)
|
return dt.dt_to_decimal(when)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -152,7 +152,8 @@ def run(deployment_config):
|
|||||||
LOG.debug("Processing on '%s'" % name)
|
LOG.debug("Processing on '%s'" % name)
|
||||||
with kombu.connection.BrokerConnection(**params) as conn:
|
with kombu.connection.BrokerConnection(**params) as conn:
|
||||||
try:
|
try:
|
||||||
consumer = NovaConsumer(name, conn, deployment, durable)
|
consumer = NovaConsumer(name, conn, deployment, durable,
|
||||||
|
queue_arguments)
|
||||||
consumer.run()
|
consumer.run()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOG.exception("name=%s, exception=%s. Reconnecting in 5s" %
|
LOG.exception("name=%s, exception=%s. Reconnecting in 5s" %
|
||||||
|
Reference in New Issue
Block a user