Browse Source

return if n=0

bigeagle 10 years ago
parent
commit
139088bef3
2 changed files with 5 additions and 2 deletions
  1. 1 1
      tunasync/mirror_provider.py
  2. 4 1
      tunasync/tunasync.py

+ 1 - 1
tunasync/mirror_provider.py

@@ -124,7 +124,7 @@ class TwoStageRsyncProvider(RsyncProvider):
 
 
     def set_stage1_profile(self, profile):
     def set_stage1_profile(self, profile):
         if profile not in self._stage1_profiles:
         if profile not in self._stage1_profiles:
-            raise Exception("Profile Undefined!")
+            raise Exception("Profile Undefined: %s, %s" % (profile, self.name))
 
 
         self._stage1_excludes = self._stage1_profiles[profile]
         self._stage1_excludes = self._stage1_profiles[profile]
 
 

+ 4 - 1
tunasync/tunasync.py

@@ -235,7 +235,10 @@ class TUNASync(object):
             job_ctx = self.status_manager.get_info(mirror_name, "ctx")
             job_ctx = self.status_manager.get_info(mirror_name, "ctx")
             n = kwargs.get("n", 0)
             n = kwargs.get("n", 0)
             if n == 0:
             if n == 0:
-                res = job_ctx.get("log_file", "/dev/null")
+                res = job_ctx.get(
+                    "log_link",
+                    job_ctx.get("log_file", "/dev/null"),
+                )
             else:
             else:
                 import os
                 import os
                 log_file = job_ctx.get("log_file", None)
                 log_file = job_ctx.get("log_file", None)