diff --git a/ci/flaky_test/process_xml.py b/ci/flaky_test/process_xml.py index e226ba626f618..e02bbb268af8d 100755 --- a/ci/flaky_test/process_xml.py +++ b/ci/flaky_test/process_xml.py @@ -190,11 +190,15 @@ def getGitInfo(CI_TARGET): ret += "\n" - output = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], encoding='utf-8') - ret += "Origin:\t\t{}".format(output.replace('.git', '')) + remotes = subprocess.check_output(['git', 'remote'], encoding='utf-8').splitlines() - output = subprocess.check_output(['git', 'remote', 'get-url', 'upstream'], encoding='utf-8') - ret += "Upstream:\t{}".format(output.replace('.git', '')) + if ("origin" in remotes): + output = subprocess.check_output(['git', 'remote', 'get-url', 'origin'], encoding='utf-8') + ret += "Origin:\t\t{}".format(output.replace('.git', '')) + + if ("upstream" in remotes): + output = subprocess.check_output(['git', 'remote', 'get-url', 'upstream'], encoding='utf-8') + ret += "Upstream:\t{}".format(output.replace('.git', '')) output = subprocess.check_output(['git', 'describe', '--all'], encoding='utf-8') ret += "Latest ref:\t{}".format(output)