From 991bf0a1c339f00fd46e91e67801cee74b46069c Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Fri, 17 Mar 2017 23:33:32 -0700 Subject: [PATCH] Fix ansible-test base branch handling on merge. (#22759) --- test/runner/lib/executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py index 75d95ec9f6f..2b1f39768f7 100644 --- a/test/runner/lib/executor.py +++ b/test/runner/lib/executor.py @@ -1136,9 +1136,12 @@ class SanityConfig(TestConfig): self.base_branch = args.base_branch # str elif is_shippable(): try: - self.base_branch = 'origin/%s' % os.environ['BASE_BRANCH'] # str + self.base_branch = os.environ['BASE_BRANCH'] # str except KeyError as ex: raise MissingEnvironmentVariable(name=ex.args[0]) + + if self.base_branch: + self.base_branch = 'origin/%s' % self.base_branch else: self.base_branch = ''