diff --git a/taskflow/storage.py b/taskflow/storage.py index 5c348f350..68137c37e 100644 --- a/taskflow/storage.py +++ b/taskflow/storage.py @@ -423,6 +423,11 @@ class Storage(object): # This never changes (so no read locking needed). return self._flowdetail.uuid + @property + def flow_meta(self): + """The flow detail metadata this storage unit is associated with.""" + return self._flowdetail.meta + @property def backend(self): """The backend this storage unit is associated with.""" diff --git a/taskflow/tests/unit/test_storage.py b/taskflow/tests/unit/test_storage.py index 53ca21064..dae5a22c0 100644 --- a/taskflow/tests/unit/test_storage.py +++ b/taskflow/tests/unit/test_storage.py @@ -60,11 +60,13 @@ class StorageTestMixin(object): s.ensure_atom(test_utils.NoopTask('my_task')) self.assertTrue(uuidutils.is_uuid_like(s.get_atom_uuid('my_task'))) - def test_flow_name_and_uuid(self): + def test_flow_name_uuid_and_meta(self): flow_detail = models.FlowDetail(name='test-fd', uuid='aaaa') + flow_detail.meta = {'a': 1} s = self._get_storage(flow_detail) self.assertEqual('test-fd', s.flow_name) self.assertEqual('aaaa', s.flow_uuid) + self.assertEqual({'a': 1}, s.flow_meta) def test_ensure_task(self): s = self._get_storage()