Clean Up for DB changes
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -19,14 +19,11 @@
|
||||
|
||||
import traceback as tb
|
||||
|
||||
from taskflow.tests import easy
|
||||
from celery.signals import task_failure, task_success
|
||||
from nova.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
easy.register()
|
||||
|
||||
@task_failure.connect
|
||||
def task_error_handler(signal=None, sender=None, task_id=None,
|
||||
exception=None, args=None, kwargs=None,
|
||||
@@ -38,8 +35,8 @@ def task_error_handler(signal=None, sender=None, task_id=None,
|
||||
LOG.error('Trackeback: %s' % (tb.print_tb(traceback), ))
|
||||
wf = sender.name.split('.')[0]
|
||||
task = ('.').join(n for n in (sender.name.split('.')[1:]) if n)
|
||||
logbook.update_task(wf, task, status="ERROR", args=args, kwargs=kwargs,
|
||||
exception=exception, traceback=(tb.print_tb(traceback)))
|
||||
#logbook.update_task(wf, task, status="ERROR", args=args, kwargs=kwargs,
|
||||
# exception=exception, traceback=(tb.print_tb(traceback)))
|
||||
|
||||
# TODO: Auto-initiate rollback from failed task
|
||||
|
||||
@@ -48,8 +45,7 @@ def task_success_handler(singal=None, sender=None, result=None):
|
||||
""" Save task results to WF """
|
||||
wf = sender.name.split('.')[0]
|
||||
task = ('.').join(n for n in (sender.name.split('.')[1:]) if n)
|
||||
logbook.update_task(wf, task, status="SUCCESS", result=result)
|
||||
pass
|
||||
#logbook.update_task(wf, task, status="SUCCESS", result=result)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,12 +27,6 @@ from oslo.cfg import cfg
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
""" If ALWAYS_EAGER is set to true, Celery will execute synchronously """
|
||||
if '--eager' in sys.argv:
|
||||
CELERY_ALWAYS_EAGER = True
|
||||
else:
|
||||
CELERY_ALWAYS_EAGER = False
|
||||
|
||||
BROKER_URL = cfg.CFG('celery_mq')
|
||||
|
||||
|
||||
CELERY_RESULT_BACKEND = "database"
|
||||
CELERY_RESULT_DBURI = cfg.CFG('celery_backend')
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
# Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
|
||||
# Copyright (C) 2013 Rackspace Hosting All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
import sqlalchemy
|
||||
|
||||
from oslo.cfg import cfg.CONF
|
||||
|
||||
from taskflow import catalog
|
||||
from taskflow import exceptions as exc
|
||||
from taskflow import job
|
||||
from taskflow import jobboard
|
||||
from taskflow import logbook
|
||||
from taskflow import states
|
||||
from taskflow import utils
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
Binary file not shown.
BIN
taskflow/test.db
BIN
taskflow/test.db
Binary file not shown.
Reference in New Issue
Block a user