Commit 52fdd1ff authored by Milad Fa's avatar Milad Fa Committed by LUCI CQ

Adding AIX

Change-Id: Ibf023a1f6b635872c849bda885b47ea1dbf7dda3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2410733Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
parent dd48130b
...@@ -589,7 +589,7 @@ def CheckCallAndFilter(args, print_stdout=False, filter_fn=None, ...@@ -589,7 +589,7 @@ def CheckCallAndFilter(args, print_stdout=False, filter_fn=None,
# If our stdout is a terminal, then pass in a psuedo-tty pipe to our # If our stdout is a terminal, then pass in a psuedo-tty pipe to our
# subprocess when filtering its output. This makes the subproc believe # subprocess when filtering its output. This makes the subproc believe
# it was launched from a terminal, which will preserve ANSI color codes. # it was launched from a terminal, which will preserve ANSI color codes.
if sys.stdout.isatty() and GetMacWinOrLinux() != 'win': if sys.stdout.isatty() and GetMacWinAixOrLinux() != 'win':
pipe_reader, pipe_writer = os.openpty() pipe_reader, pipe_writer = os.openpty()
else: else:
pipe_reader, pipe_writer = os.pipe() pipe_reader, pipe_writer = os.pipe()
...@@ -737,7 +737,7 @@ def FindFileUpwards(filename, path=None): ...@@ -737,7 +737,7 @@ def FindFileUpwards(filename, path=None):
path = new_path path = new_path
def GetMacWinOrLinux(): def GetMacWinAixOrLinux():
"""Returns 'mac', 'win', or 'linux', matching the current platform.""" """Returns 'mac', 'win', or 'linux', matching the current platform."""
if sys.platform.startswith(('cygwin', 'win')): if sys.platform.startswith(('cygwin', 'win')):
return 'win' return 'win'
...@@ -745,6 +745,8 @@ def GetMacWinOrLinux(): ...@@ -745,6 +745,8 @@ def GetMacWinOrLinux():
return 'linux' return 'linux'
elif sys.platform == 'darwin': elif sys.platform == 'darwin':
return 'mac' return 'mac'
elif sys.platform.startswith('aix'):
return 'aix'
raise Error('Unknown platform: ' + sys.platform) raise Error('Unknown platform: ' + sys.platform)
......
...@@ -216,7 +216,7 @@ class MetricsCollector(object): ...@@ -216,7 +216,7 @@ class MetricsCollector(object):
# Add metrics regarding environment information. # Add metrics regarding environment information.
self.add('timestamp', int(time.time())) self.add('timestamp', int(time.time()))
self.add('python_version', metrics_utils.get_python_version()) self.add('python_version', metrics_utils.get_python_version())
self.add('host_os', gclient_utils.GetMacWinOrLinux()) self.add('host_os', gclient_utils.GetMacWinAixOrLinux())
self.add('host_arch', detect_host_arch.HostArch()) self.add('host_arch', detect_host_arch.HostArch())
depot_tools_age = metrics_utils.get_repo_timestamp(DEPOT_TOOLS) depot_tools_age = metrics_utils.get_repo_timestamp(DEPOT_TOOLS)
......
...@@ -62,8 +62,8 @@ class MetricsCollectorTest(unittest.TestCase): ...@@ -62,8 +62,8 @@ class MetricsCollectorTest(unittest.TestCase):
TimeMock()).start() TimeMock()).start()
mock.patch('metrics.metrics_utils.get_python_version', mock.patch('metrics.metrics_utils.get_python_version',
lambda: '2.7.13').start() lambda: '2.7.13').start()
mock.patch('metrics.gclient_utils.GetMacWinOrLinux', mock.patch(
lambda: 'linux').start() 'metrics.gclient_utils.GetMacWinAixOrLinux', lambda: 'linux').start()
mock.patch('metrics.detect_host_arch.HostArch', mock.patch('metrics.detect_host_arch.HostArch',
lambda: 'x86').start() lambda: 'x86').start()
mock.patch('metrics_utils.get_repo_timestamp', mock.patch('metrics_utils.get_repo_timestamp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment