Commit 8a9c0f1f authored by Chih-Hsuan Kuo's avatar Chih-Hsuan Kuo Committed by Commit Bot

Fix 'NoneType' object has no attribute 'startswith'

When --fuchsia-out-dir is not specified, the variable is NoneType. It
will hit "'NoneType' object has no attribute 'startswith'" error when
trying to call os.path.expanduser() with it.

Bug: 1115450
Change-Id: Iaf920b47ceb664a6ad7cd4963a016d1dfb60147e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351934Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Chih-Hsuan Kuo <chkuo@google.com>
Auto-Submit: Chih-Hsuan Kuo <chkuo@google.com>
Cr-Commit-Position: refs/heads/master@{#798572}
parent 88425402
...@@ -85,7 +85,7 @@ class DeviceTarget(target.Target): ...@@ -85,7 +85,7 @@ class DeviceTarget(target.Target):
self._port = port if port else 22 self._port = port if port else 22
self._system_log_file = system_log_file self._system_log_file = system_log_file
self._host = host self._host = host
self._fuchsia_out_dir = os.path.expanduser(fuchsia_out_dir) self._fuchsia_out_dir = fuchsia_out_dir
self._node_name = node_name self._node_name = node_name
self._os_check = os_check self._os_check = os_check
self._amber_repo = None self._amber_repo = None
...@@ -98,6 +98,7 @@ class DeviceTarget(target.Target): ...@@ -98,6 +98,7 @@ class DeviceTarget(target.Target):
raise Exception('Only one of "--fuchsia-out-dir" or "--ssh_config" can ' raise Exception('Only one of "--fuchsia-out-dir" or "--ssh_config" can '
'be specified.') 'be specified.')
self._fuchsia_out_dir = os.path.expanduser(fuchsia_out_dir)
# Use SSH keys from the Fuchsia output directory. # Use SSH keys from the Fuchsia output directory.
self._ssh_config_path = os.path.join(self._fuchsia_out_dir, 'ssh-keys', self._ssh_config_path = os.path.join(self._fuchsia_out_dir, 'ssh-keys',
'ssh_config') 'ssh_config')
......
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