Add in --network so we can specify gce network at the cmdline.
Bug: 113535553
Test: acloud create --network avd-vpc
acloud create_cf --network avd-vpc
acloud create
acloud create_cf ...
acloud delete
atest acloud_test
Change-Id: I10a867f1acb1e58623ca50d33fb19b7011b6ba1c
diff --git a/create/create_args.py b/create/create_args.py
index 45c119a..bd6dd63 100644
--- a/create/create_args.py
+++ b/create/create_args.py
@@ -78,6 +78,12 @@
help="Report internal ip of the created instance instead of external "
"ip. Using the internal ip is used when connecting from another "
"GCE instance.")
+ parser.add_argument(
+ "--network",
+ type=str,
+ dest="network",
+ required=False,
+ help="Set the network the GCE instance will utilize.")
def GetCreateArgParser(subparser):
diff --git a/public/config.py b/public/config.py
index 080478c..e9d8bcd 100755
--- a/public/config.py
+++ b/public/config.py
@@ -216,6 +216,9 @@
if parsed_args.which == create_args.CMD_CREATE and not self.hw_property:
self.hw_property = self.common_hw_property_map.get(
parsed_args.flavor, "")
+ if parsed_args.which in [create_args.CMD_CREATE, "create_cf"]:
+ if parsed_args.network:
+ self.network = parsed_args.network
def Verify(self):
"""Verify configuration fields."""