Cleaning up files/extraneous files/fixing relations
This commit is contained in:
		@@ -2,7 +2,6 @@
 | 
			
		||||
 | 
			
		||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 | 
			
		||||
 | 
			
		||||
#    Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
 | 
			
		||||
#    Copyright (C) 2013 Rackspace Hosting Inc. All Rights Reserved.
 | 
			
		||||
#
 | 
			
		||||
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,6 @@
 | 
			
		||||
 | 
			
		||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 | 
			
		||||
 | 
			
		||||
#    Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
 | 
			
		||||
#    Copyright (C) 2013 Rackspace Hosting Inc. All Rights Reserved.
 | 
			
		||||
#
 | 
			
		||||
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,6 @@
 | 
			
		||||
 | 
			
		||||
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 | 
			
		||||
 | 
			
		||||
#    Copyright (C) 2012 Yahoo! Inc. All Rights Reserved.
 | 
			
		||||
#    Copyright (C) 2013 Rackspace Hosting Inc. All Rights Reserved.
 | 
			
		||||
#
 | 
			
		||||
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 | 
			
		||||
 
 | 
			
		||||
@@ -1,20 +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 Inc. 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.
 | 
			
		||||
 | 
			
		||||
from taskflow.openstack.common import *
 | 
			
		||||
@@ -24,7 +24,6 @@ from oslo.config import cfg
 | 
			
		||||
from taskflow.common import config
 | 
			
		||||
from taskflow import utils
 | 
			
		||||
 | 
			
		||||
SQL_CONNECTION = 'sqlite://'
 | 
			
		||||
db_opts = [
 | 
			
		||||
    cfg.StrOpt('db_backend',
 | 
			
		||||
               default='sqlalchemy',
 | 
			
		||||
@@ -84,6 +83,9 @@ def job_get_owner(context, job_id):
 | 
			
		||||
def job_get_state(context, job_id):
 | 
			
		||||
    return IMPL.job_get_state(context, job_id)
 | 
			
		||||
 | 
			
		||||
def job_get_logbook(context, job_id):
 | 
			
		||||
    return IMPL.job_get_logbook(context, job_id)
 | 
			
		||||
 | 
			
		||||
def job_destroy(context, job_id):
 | 
			
		||||
    return IMPL.job_destroy(context, job_id)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -136,6 +136,11 @@ def job_get_state(context, job_id):
 | 
			
		||||
    job = job_get(context, job_id)
 | 
			
		||||
    return job.state
 | 
			
		||||
 | 
			
		||||
def job_get_logbook(context, job_id):
 | 
			
		||||
    """Return the logbook associated with the given job"""
 | 
			
		||||
    job = job_get(context, job_id)
 | 
			
		||||
    return job.logbook
 | 
			
		||||
 | 
			
		||||
def job_destroy(context, job_id):
 | 
			
		||||
    """Delete a given Job"""
 | 
			
		||||
    session = get_session()
 | 
			
		||||
 
 | 
			
		||||
@@ -48,7 +48,7 @@ class Json(types.TypeDecorator, types.MutableType):
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class TaskFlowBase(object):
 | 
			
		||||
    """Base class for Heat Models."""
 | 
			
		||||
    """Base class for TaskFlow Models."""
 | 
			
		||||
    __table_args__ = {'mysql_engine':'InnoDB'}
 | 
			
		||||
    __table_initialized = False
 | 
			
		||||
    created_at = Column(DateTime, default=timeutils.utcnow)
 | 
			
		||||
@@ -132,6 +132,7 @@ class LogBook(BASE, TaskFlowBase):
 | 
			
		||||
    name = Column(String)
 | 
			
		||||
    workflows = relationship("Workflow",
 | 
			
		||||
                             secondary=workflow_logbook_assoc)
 | 
			
		||||
    job = relationship("Job", uselist=False, backref="logbook")
 | 
			
		||||
 | 
			
		||||
class Job(BASE, TaskFlowBase):
 | 
			
		||||
    """Represents a Job"""
 | 
			
		||||
@@ -146,10 +147,11 @@ class Job(BASE, TaskFlowBase):
 | 
			
		||||
    state = Column(String)
 | 
			
		||||
    workflows = relationship("Workflow",
 | 
			
		||||
                             secondary=workflow_job_assoc)
 | 
			
		||||
    logbook_id = Column(String, ForeignKey('logbook.logbook_id')
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Workflow(BASE, TaskFlowBase):
 | 
			
		||||
    """Represents Workflow Objects"""
 | 
			
		||||
    """Represents Workflow detail objects"""
 | 
			
		||||
 | 
			
		||||
    __tablename__ = 'workflow'
 | 
			
		||||
 | 
			
		||||
@@ -158,7 +160,7 @@ class Workflow(BASE, TaskFlowBase):
 | 
			
		||||
    tasks = relationship("Task", backref="workflow")
 | 
			
		||||
 | 
			
		||||
class Task(BASE, TaskFlowBase):
 | 
			
		||||
    """Represents Task Objects"""
 | 
			
		||||
    """Represents Task detail objects"""
 | 
			
		||||
 | 
			
		||||
    __tablename__ = 'task'
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ from celery import chord
 | 
			
		||||
LOG = logging.getLogger(__name__)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Workflow(object):
 | 
			
		||||
class Flow(object):
 | 
			
		||||
    """A linear chain of independent tasks that can be applied as one unit or
 | 
			
		||||
       rolled back as one unit."""
 | 
			
		||||
 | 
			
		||||
@@ -83,5 +83,5 @@ class Workflow(object):
 | 
			
		||||
 | 
			
		||||
    def run(self, context, *args, **kwargs):
 | 
			
		||||
        """ Start root task and kick off workflow """
 | 
			
		||||
        root(context)
 | 
			
		||||
        self.root(context)
 | 
			
		||||
        LOG.info('WF %s has been started' % (self.name,))
 | 
			
		||||
 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user