Add safeguard when running create_instances.py without args
# See the License for the specific language governing permissions and
# limitations under the License.
+import itertools
import queue
import sys
import threading
@@ -167,6 +168,10 @@ def main(argv=None):
if argv is None:
argv = sys.argv[1:]
+ if not argv:
+ print("Usage: create_instances.py {}".format(" ".join(INSTANCE_GROUPS.keys())))
+ return 1
+
# Put VM creation instructions into the work queue.
for instance_group_name, params in INSTANCE_GROUPS.items():
# If the user specified instance (group) names on the command-line, we process only these
