Пример #1
0
    'schema': 'simpleflow',
    'user': '******',
    'passwd': '111111'
}
sql_connection = connformater % dst
session = build_session(sql_connection)

work_bask = 'C:\\Users\\loliz_000\\Desktop\\work'
update_base = 'C:\\Users\\loliz_000\\Desktop\\update'
backup_base = 'C:\\Users\\loliz_000\\Desktop\\backup'

backup_file = os.path.join(backup_base, 'wtf.tar.gz')

mananager = TestManager(work_bask, update_base)
endpoint = TestEndpoint(manager=mananager, group=test_group)
_middleware = middleware.EntityMiddleware(entity=1, endpoint=endpoint)

upgrade = application.AppUpgradeFile(source='nova')

_appcation = application.Application(upgrade=upgrade, backup=backup_file)

m = middleware.EntityMiddleware(entity=1,
                                endpoint=endpoint,
                                application=_appcation)

store = {}

main_flow = pipe.flow_factory(session=session, middlewares=[
    m,
], store=store)
Пример #2
0
from goperation.taskflow import base
from goperation.manager.rpc.agent.application.taskflow import middleware

from test.unit.taskflow import test_group
from test.unit.taskflow import TestEndpoint
from test.unit.taskflow import TestManager

mananager = TestManager('/root')

endpoint = TestEndpoint(manager=mananager, group=test_group)

_middleware = middleware.EntityMiddleware(entity=1, endpoint=endpoint)

try:
    cs = base.StandardTask(_middleware, rebind=['wtf'])
except Exception as e:
    print 'catch exception', e
    print 'StandardTask test success'


class TestTask(base.StandardTask):
    def execute(self, *args, **kwargs):
        pass


new_cs = TestTask(_middleware)

print 'all test success'
Пример #3
0
    'user': '******',
    'passwd': '111111',
    'host': '172.20.0.3',
    'port': 3305,
    'schema': 'xiaohua_login'
}

backup_file = os.path.join(backup_base, 'db.sql')

update = database.DbUpdateFile(source='update')

_database = database.Database(backup=backup_file, update=update, **db_info)

m = middleware.EntityMiddleware(entity=1,
                                endpoint=endpoint,
                                databases=[
                                    _database,
                                ],
                                application=_appcation)

store = {}

main_flow = pipe.flow_factory(session=session, middlewares=[
    m,
], store=store)

connection = Connection(session)

engine = api.load(connection,
                  main_flow,
                  store=store,
                  engine_cls=ParallelActionEngine)