فهرست منبع

tau: fix a big in set_comment RPC, and exit with no access msg accordingly

dasman 1 سال پیش
والد
کامیت
5f36dcda79
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 2
      bin/tau/tau-python/api.py
  2. 2 1
      bin/tau/tau-python/tau

+ 1 - 2
bin/tau/tau-python/api.py

@@ -78,8 +78,7 @@ async def fetch_archive_task(task_refid, month_ts, server_name, port):
     return await query("fetch_archive_task", [task_refid, str(month_ts)], server_name, int(port))
 
 async def add_task_comment(refid, comment, server_name, port):
-    await query("set_comment", [refid, comment], server_name, int(port))
-    return True
+    return await query("set_comment", [refid, comment], server_name, int(port))
 
 async def export_to(path, server_name, port):
     return await query("export", [path], server_name, int(port))

+ 2 - 1
bin/tau/tau-python/tau

@@ -460,7 +460,8 @@ async def comment(refid, args, server_name, port):
         exit(-1)
 
     if not await api.add_task_comment(refid, comment, server_name, port):
-        return -1
+        print("You don't have write access")
+        exit(-1)
 
     # Two json rpcs back to back cause Unexpected EOF error
     time.sleep(0.1)