lock_machine: specify python3 for swarming
swarming.py was being called with python2 which no longer exists in
chrotomation. This was later changed to make the invokaction call
swarming as an exexutable, however, this lead swarming.py to then
invoke the default `python` executable which also doesn't exist
in chrotomation and so a similar problem ensued.
BUG=b:221777277
TEST=manually verified
Change-Id: Ie6537b00a25fbc12cdeb95ada92d8095a609b291
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3553430
Reviewed-by: Luis Lozano <llozano@chromium.org>
Commit-Queue: Luis Lozano <llozano@chromium.org>
Tested-by: Luis Lozano <llozano@chromium.org>
diff --git a/lock_machine.py b/lock_machine.py
index 1a41290..c64d316 100755
--- a/lock_machine.py
+++ b/lock_machine.py
@@ -379,8 +379,8 @@
if os.path.exists(self.CROSFLEET_CREDENTIAL):
credential = '--auth-service-account-json %s' % self.CROSFLEET_CREDENTIAL
swarming = os.path.join(self.chromeos_root, self.SWARMING)
- cmd = (('%s query --swarming https://chromeos-swarming.appspot.com '
- "%s 'bots/list?is_dead=FALSE&dimensions=dut_name:%s'") %
+ cmd = (('python3 %s query --swarming https://chromeos-swarming.appspot.com'
+ " %s 'bots/list?is_dead=FALSE&dimensions=dut_name:%s'") %
(swarming, credential, machine.rstrip('.cros')))
exit_code, stdout, stderr = self.ce.RunCommandWOutput(cmd)
if exit_code: