From 6c30b3f26388b0494f765fe05547bf67764c40d9 Mon Sep 17 00:00:00 2001 From: Xingjian Zhang <44231913+THUzxj@users.noreply.github.com> Date: Tue, 11 Apr 2023 14:43:18 +0800 Subject: [PATCH] Add throwing error when specifying unsupported os in Vagrant (#9965) --- Vagrantfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Vagrantfile b/Vagrantfile index c60887c2c..0d507674e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -83,6 +83,13 @@ $playbook ||= "cluster.yml" host_vars = {} +# throw error if os is not supported +if ! SUPPORTED_OS.key?($os) + puts "Unsupported OS: #{$os}" + puts "Supported OS are: #{SUPPORTED_OS.keys.join(', ')}" + exit 1 +end + $box = SUPPORTED_OS[$os][:box] # if $inventory is not set, try to use example $inventory = "inventory/sample" if ! $inventory