diff options
author | Georgy Redkozubov <georgy.redkozubov@linaro.org> | 2013-04-24 17:39:34 +0400 |
---|---|---|
committer | Georgy Redkozubov <georgy.redkozubov@linaro.org> | 2013-04-24 17:39:34 +0400 |
commit | 65945534bb49dc20b234b6786de0c424e50c1462 (patch) | |
tree | 5b1a2d30713123ef32d54e6f4b49af0e33338b35 /scripts | |
parent | 6af9211a06b09b07221d586c6a09a7cd02a2311e (diff) |
Rewritten code to use exceptions.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/publish_to_snapshots.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/publish_to_snapshots.py b/scripts/publish_to_snapshots.py index c1d5662..90ac902 100755 --- a/scripts/publish_to_snapshots.py +++ b/scripts/publish_to_snapshots.py @@ -62,6 +62,11 @@ class PublisherArgumentException(Exception): pass +class BuildInfoException(Exception): + """BUILD-INFO.txt is absent.""" + pass + + class SnapshotsPublisher(object): # Files that need no sanitization even when publishing to staging. @@ -380,9 +385,8 @@ class SnapshotsPublisher(object): bi_dirs.append(path) if not bi_dirs: - return FAIL - - return PASS + raise BuildInfoException( + "BUILD-INFO.txt is not present for build being published.") def main(): @@ -404,10 +408,7 @@ def main(): if build_dir_path is None or target_dir_path is None: print "Problem with build/target path, move failed" return FAIL - ret = publisher.check_buildinfo(build_dir_path, target_dir_path) - if ret != PASS: - print "BUILD-INFO.txt is not present for build being published" - return FAIL + publisher.check_buildinfo(build_dir_path, target_dir_path) ret = publisher.move_artifacts(args, build_dir_path, target_dir_path) if ret != PASS: print "Move Failed" |