diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-04-20 10:36:33 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-04-20 10:36:33 +0000 |
commit | f674255080794ac4b9780abade83dcc7a6ac0e05 (patch) | |
tree | a1b03220a13a96ba0b9f35edb024e4c1d2e51a10 | |
parent | f0ddb0052d4be481c9ab585c892af880fccb21c6 (diff) | |
parent | beb84a2275ed32a0e99922f1bf6a869eeed42821 (diff) | |
download | acloud-f674255080794ac4b9780abade83dcc7a6ac0e05.tar.gz |
Merge "Deprecate "create_cf" command"
-rw-r--r-- | internal/lib/cvd_compute_client.py | 2 | ||||
-rw-r--r-- | public/acloud_main.py | 48 |
2 files changed, 2 insertions, 48 deletions
diff --git a/internal/lib/cvd_compute_client.py b/internal/lib/cvd_compute_client.py index cdedbe2e..e4245e76 100644 --- a/internal/lib/cvd_compute_client.py +++ b/internal/lib/cvd_compute_client.py @@ -56,7 +56,7 @@ _METADATA_TO_UNSET = ["cvd_01_launch", "cvd_01_fetch_kernel_bid", "cvd_01_fetch_kernel_build_target"] - +# TODO(228405515): Delete CvdComputeClient class. class CvdComputeClient(android_compute_client.AndroidComputeClient): """Client that manages Anadroid Virtual Device.""" diff --git a/public/acloud_main.py b/public/acloud_main.py index 12cf2580..96648d6e 100644 --- a/public/acloud_main.py +++ b/public/acloud_main.py @@ -70,9 +70,7 @@ Try $acloud [cmd] --help for further details. from __future__ import print_function import argparse import logging -import os import sys -import sysconfig import traceback if sys.version_info.major == 2: @@ -106,7 +104,6 @@ from acloud.create import create_args from acloud.delete import delete from acloud.delete import delete_args from acloud.internal import constants -from acloud.internal.lib import utils from acloud.reconnect import reconnect from acloud.reconnect import reconnect_args from acloud.list import list as list_instances @@ -117,7 +114,6 @@ from acloud.powerwash import powerwash_args from acloud.public import acloud_common from acloud.public import config from acloud.public import report -from acloud.public.actions import create_cuttlefish_action from acloud.public.actions import create_goldfish_action from acloud.pull import pull from acloud.pull import pull_args @@ -136,12 +132,10 @@ NO_ERROR_MESSAGE = "" PROG = "acloud" # Commands -CMD_CREATE_CUTTLEFISH = "create_cf" CMD_CREATE_GOLDFISH = "create_gf" # Config requires fields. _CREATE_REQUIRE_FIELDS = ["project", "zone", "machine_type"] -_CREATE_CF_REQUIRE_FIELDS = ["resolution"] # show contact info to user. _CONTACT_INFO = ("If you have any question or need acloud team support, " "please feel free to contact us by email at " @@ -179,13 +173,6 @@ def _ParseArgs(args): subparsers = parser.add_subparsers(metavar="{" + usage + "}") subparser_list = [] - # Command "create_cf", create cuttlefish instances - create_cf_parser = subparsers.add_parser(CMD_CREATE_CUTTLEFISH) - create_cf_parser.required = False - create_cf_parser.set_defaults(which=CMD_CREATE_CUTTLEFISH) - create_args.AddCommonCreateArgs(create_cf_parser) - subparser_list.append(create_cf_parser) - # Command "create_gf", create goldfish instances # In order to create a goldfish device we need the following parameters: # 1. The emulator build we wish to use, this is the binary that emulates @@ -282,10 +269,6 @@ def _VerifyArgs(parsed_args): create_args.VerifyArgs(parsed_args) if parsed_args.which == setup_args.CMD_SETUP: setup_args.VerifyArgs(parsed_args) - if parsed_args.which == CMD_CREATE_CUTTLEFISH: - if not parsed_args.build_id and not parsed_args.branch: - raise errors.CommandArgError( - "Must specify --build_id or --branch") if parsed_args.which == CMD_CREATE_GOLDFISH: if not parsed_args.emulator_build_id and not parsed_args.build_id and ( not parsed_args.emulator_branch and not parsed_args.branch): @@ -301,9 +284,7 @@ def _VerifyArgs(parsed_args): "--system-* args are not supported for AVD type: %s" % constants.TYPE_GF) - if parsed_args.which in [ - create_args.CMD_CREATE, CMD_CREATE_CUTTLEFISH, CMD_CREATE_GOLDFISH - ]: + if parsed_args.which in [create_args.CMD_CREATE, CMD_CREATE_GOLDFISH]: if (parsed_args.serial_log_file and not parsed_args.serial_log_file.endswith(".tar.gz")): raise errors.CommandArgError( @@ -323,8 +304,6 @@ def _ParsingConfig(args, cfg): missing_fields = [] if args.which == create_args.CMD_CREATE and args.local_instance is None: missing_fields = cfg.GetMissingFields(_CREATE_REQUIRE_FIELDS) - if args.which == CMD_CREATE_CUTTLEFISH: - missing_fields.extend(cfg.GetMissingFields(_CREATE_CF_REQUIRE_FIELDS)) if missing_fields: return ( "Config file (%s) missing required fields: %s, please add these " @@ -422,31 +401,6 @@ def main(argv=None): constants.ACLOUD_UNKNOWN_ARGS_ERROR) elif args.which == create_args.CMD_CREATE: reporter = create.Run(args) - elif args.which == CMD_CREATE_CUTTLEFISH: - # Set ports offset when base_instance_num is specified - utils.SetCvdPorts(args.base_instance_num) - - reporter = create_cuttlefish_action.CreateDevices( - cfg=cfg, - build_target=args.build_target, - build_id=args.build_id, - branch=args.branch, - kernel_build_id=args.kernel_build_id, - kernel_branch=args.kernel_branch, - kernel_build_target=args.kernel_build_target, - system_branch=args.system_branch, - system_build_id=args.system_build_id, - system_build_target=args.system_build_target, - bootloader_branch=args.bootloader_branch, - bootloader_build_id=args.bootloader_build_id, - bootloader_build_target=args.bootloader_build_target, - gpu=args.gpu, - num=args.num, - serial_log_file=args.serial_log_file, - autoconnect=args.autoconnect, - report_internal_ip=args.report_internal_ip, - boot_timeout_secs=args.boot_timeout_secs, - ins_timeout_secs=args.ins_timeout_secs) elif args.which == CMD_CREATE_GOLDFISH: reporter = create_goldfish_action.CreateDevices( cfg=cfg, |