From 139088bef3bbdb0a2a4d8a7e4e92a53c73565ed5 Mon Sep 17 00:00:00 2001 From: bigeagle Date: Tue, 19 May 2015 14:03:10 +0800 Subject: [PATCH] return if n=0 --- tunasync/mirror_provider.py | 2 +- tunasync/tunasync.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tunasync/mirror_provider.py b/tunasync/mirror_provider.py index 6f36c16..7da145a 100644 --- a/tunasync/mirror_provider.py +++ b/tunasync/mirror_provider.py @@ -124,7 +124,7 @@ class TwoStageRsyncProvider(RsyncProvider): def set_stage1_profile(self, profile): 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] diff --git a/tunasync/tunasync.py b/tunasync/tunasync.py index 9076058..192a016 100644 --- a/tunasync/tunasync.py +++ b/tunasync/tunasync.py @@ -235,7 +235,10 @@ class TUNASync(object): job_ctx = self.status_manager.get_info(mirror_name, "ctx") n = kwargs.get("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: import os log_file = job_ctx.get("log_file", None)