if not os.path.exists(nativeSample.projectPath):
self._cloneSampleFromGerrit(nativeSample)
gitCommandList = ["git", "--git-dir=" + os.path.join(nativeSample.projectPath, ".git")]
- fetchOutput = subprocess.check_output(gitCommandList + ["fetch", "origin", "refs/changes/*:refs/remotes/origin/gerrit/*"], stderr=subprocess.STDOUT)
+ try:
+ fetchOutput = subprocess.check_output(gitCommandList + ["fetch", "origin", "refs/changes/*:refs/remotes/origin/gerrit/*"], stderr=subprocess.STDOUT)
+ except subprocess.CalledProcessError as error:
+ if error.returncode != 128:
+ print 'network or server error - trying to fetch next project'
+ else:
+ raise
if len(fetchOutput) > 0:
print fetchOutput
changeIds = re.findall("(?<=-> ).*", fetchOutput)
nativeSamples = ns.NativeSamples(rootBuildDir)
emailSender = ns.EmailSender(nativeSamples.config)
-
+stacktrace = None
try:
nativeSamples.pollForChanges()
nativeSamples.evaluatePendingChanges()
except KeyboardInterrupt:
raise
+except subprocess.CalledProcessError as error:
+ stacktrace = "Exception Info:\n\n" + traceback.format_exc() + error.output
+ traceback.print_exc()
except:
- subject = 'Tizen SAMPLE BUILD SYSTEM error: Something unexpected happened during build process'
stacktrace = "Exception Info:\n\n" + traceback.format_exc()
traceback.print_exc()
- emailSender.send(mailSubject = subject, mailText = stacktrace)
+if stacktrace is not None:
+ subject = 'Tizen SAMPLE BUILD SYSTEM error: Something unexpected happened during build process'
+ emailSender.send(mailSubject = subject, mailText = stacktrace)