mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-19 04:21:17 +00:00
wa create workload: better error reporting
Give more informative errors if Android SDK installed but no platform has been downloaded.
This commit is contained in:
parent
85eba9c37a
commit
a6d374bcff
@ -22,6 +22,7 @@ import textwrap
|
||||
import argparse
|
||||
import shutil
|
||||
import getpass
|
||||
import subprocess
|
||||
from collections import OrderedDict
|
||||
|
||||
import yaml
|
||||
@ -351,7 +352,12 @@ def create_uiauto_project(path, name, target='1'):
|
||||
package_name,
|
||||
target,
|
||||
path)
|
||||
try:
|
||||
check_output(command, shell=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
if 'is is not valid' in e.output:
|
||||
message = 'No Android SDK target found; have you run "{} update sdk" and download a platform?'
|
||||
raise CommandError(message.format(android_path))
|
||||
|
||||
build_script = os.path.join(path, 'build.sh')
|
||||
with open(build_script, 'w') as wfh:
|
||||
@ -390,5 +396,5 @@ def render_template(name, params):
|
||||
|
||||
|
||||
def touch(path):
|
||||
with open(path, 'w') as wfh: # pylint: disable=unused-variable
|
||||
with open(path, 'w') as _:
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user