Fix record error data in metrics if acloud create failed.
Bug: 147022086
Test: acloud create --boot-timeout 10
acloud-dev create --report-file test.json --wait-for-ins-stable 10
Change-Id: I278ed3a31308cb88aaf82ecec9c17428f5a82357
diff --git a/create/create.py b/create/create.py
index c69b71f..37b7351 100644
--- a/create/create.py
+++ b/create/create.py
@@ -215,6 +215,9 @@
Args:
args: Namespace object from argparse.parse_args.
+
+ Returns:
+ A Report instance.
"""
if not args.skip_pre_run_check:
PreRunCheck(args)
@@ -224,5 +227,4 @@
spec.image_source)
avd_creator = avd_creator_class()
report = avd_creator.Create(spec, args.no_prompt)
- if report and args.report_file:
- report.Dump(args.report_file)
+ return report