Define ShouldRun for GcpTaskRunner and add --force for setup.
Skip the GCP setup task if the config already has fields set. And add
--force for setup args if user wants to re-initialize their config with
new values.
The checked fields are just for remote CF use right now.
Bug: 112615679
Test: acloud setup --gcp_init with config that has required fields defined
acloud setup --gcp_init --force still goes through setup steps.
atest acloud_test
Change-Id: I3fc27d556d828423da253237d570070f25f94bb9
diff --git a/setup/setup.py b/setup/setup.py
index ca34487..f7cf18e 100644
--- a/setup/setup.py
+++ b/setup/setup.py
@@ -53,7 +53,7 @@
task_queue.append(gcp_runner)
for subtask in task_queue:
- subtask.Run()
+ subtask.Run(force_setup=args.force)
# 3.Print the usage hints.
_PrintUsage()