[Kimchi-devel] [PATCH] [Wok] Create utils method get_task_id()

pvital at linux.vnet.ibm.com pvital at linux.vnet.ibm.com
Sat Dec 5 19:19:56 UTC 2015


From: Paulo Vital <pvital at linux.vnet.ibm.com>

The task_id, used to store the AsyncTasks on objectstore, is a global
variable. This patch creates a simple method to return the value of
this variable.

Signed-off-by: Paulo Vital <pvital at linux.vnet.ibm.com>
---
 src/wok/utils.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/wok/utils.py b/src/wok/utils.py
index 74c521f..8c8973a 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -48,6 +48,11 @@ def get_next_task_id():
     return task_id
 
 
+def get_task_id():
+    global task_id
+    return task_id
+
+
 def add_task(target_uri, fn, objstore, opaque=None):
     id = get_next_task_id()
     AsyncTask(id, target_uri, fn, objstore, opaque)
-- 
2.5.0




More information about the Kimchi-devel mailing list