예제 #1
0
 def test_non_saving_storage(self):
     _lb, flow_detail = p_utils.temporary_flow_detail(self.backend)
     s = storage.Storage(flow_detail=flow_detail)  # no backend
     s.ensure_task('my_task')
     self.assertTrue(
         uuidutils.is_uuid_like(s.get_task_uuid('my_task')))
예제 #2
0
 def test_ensure_task(self):
     s = self._get_storage()
     s.ensure_task('my task')
     self.assertEqual(s.get_task_state('my task'), states.PENDING)
     self.assertTrue(
         uuidutils.is_uuid_like(s.get_task_uuid('my task')))
예제 #3
0
            ),
            # Finally boot it all.
            BootVM("boot-it"),
        ),
        # Ya it worked!
        PrintText("Finished vm create.", no_slow=True),
        PrintText("Instance is running!", no_slow=True))
    return flow

print_wrapped("Initializing")

# Setup the persistence & resumption layer.
backend = get_backend()
try:
    book_id, flow_id = sys.argv[2].split("+", 1)
    if not uuidutils.is_uuid_like(book_id):
        book_id = None
    if not uuidutils.is_uuid_like(flow_id):
        flow_id = None
except (IndexError, ValueError):
    book_id = None
    flow_id = None

# Set up how we want our engine to run, serial, parallel...
engine_conf = {
    'engine': 'parallel',
}
if e_utils.EVENTLET_AVAILABLE:
    engine_conf['executor'] = e_utils.GreenExecutor(5)

# Create/fetch a logbook that will track the workflows work.
예제 #4
0
 def test_task_by_name(self):
     s = self._get_storage()
     s.ensure_task('my task')
     self.assertTrue(
         uuidutils.is_uuid_like(s.get_task_uuid('my task')))
예제 #5
0
 def test_non_saving_storage(self):
     _lb, flow_detail = p_utils.temporary_flow_detail(self.backend)
     s = storage.SingleThreadedStorage(flow_detail=flow_detail)
     s.ensure_atom(test_utils.NoopTask('my_task'))
     self.assertTrue(uuidutils.is_uuid_like(s.get_atom_uuid('my_task')))
예제 #6
0
 def test_ensure_task(self):
     s = self._get_storage()
     s.ensure_atom(test_utils.NoopTask('my task'))
     self.assertEqual(s.get_atom_state('my task'), states.PENDING)
     self.assertTrue(uuidutils.is_uuid_like(s.get_atom_uuid('my task')))
예제 #7
0
 def test_task_by_name(self):
     s = self._get_storage()
     s.ensure_atom(test_utils.NoopTask('my task'))
     self.assertTrue(uuidutils.is_uuid_like(s.get_atom_uuid('my task')))
예제 #8
0
 def test_non_saving_storage(self):
     _lb, flow_detail = p_utils.temporary_flow_detail(self.backend)
     s = storage.SingleThreadedStorage(flow_detail=flow_detail)
     s.ensure_task("my_task")
     self.assertTrue(uuidutils.is_uuid_like(s.get_task_uuid("my_task")))
예제 #9
0
            # Finally boot it all.
            BootVM("boot-it"),
        ),
        # Ya it worked!
        PrintText("Finished vm create.", no_slow=True),
        PrintText("Instance is running!", no_slow=True))
    return flow


print_wrapped("Initializing")

# Setup the persistence & resumption layer.
backend = get_backend()
try:
    book_id, flow_id = sys.argv[2].split("+", 1)
    if not uuidutils.is_uuid_like(book_id):
        book_id = None
    if not uuidutils.is_uuid_like(flow_id):
        flow_id = None
except (IndexError, ValueError):
    book_id = None
    flow_id = None

# Set up how we want our engine to run, serial, parallel...
engine_conf = {
    'engine': 'parallel',
    'executor': e_utils.GreenExecutor(5),
}

# Create/fetch a logbook that will track the workflows work.
book = None
예제 #10
0
 def test_ensure_task(self):
     s = self._get_storage()
     s.ensure_atom(test_utils.NoopTask("my task"))
     self.assertEqual(s.get_atom_state("my task"), states.PENDING)
     self.assertTrue(uuidutils.is_uuid_like(s.get_atom_uuid("my task")))
예제 #11
0
 def test_task_by_name(self):
     s = self._get_storage()
     s.ensure_atom(test_utils.NoopTask("my task"))
     self.assertTrue(uuidutils.is_uuid_like(s.get_atom_uuid("my task")))