1#!/usr/bin/env vpython3 2# Copyright 2023 The Chromium Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5"""Print the default service account's auth token to stdout.""" 6 7from __future__ import absolute_import 8import os 9import subprocess 10import sys 11 12sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), 13 'test'))) 14from common import DIR_SRC_ROOT 15 16sys.path.append(os.path.join(DIR_SRC_ROOT, 'build')) 17import find_depot_tools 18 19 20def main(): 21 luci_auth = os.path.join(find_depot_tools.DEPOT_TOOLS_PATH, 'luci-auth') 22 proc = subprocess.run([luci_auth, 'token'], encoding='utf-8') 23 return proc.returncode 24 25 26if __name__ == '__main__': 27 sys.exit(main()) 28