X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=tools%2Fvagrant%2Fdestroy.rb;h=d6915b0b441ba07007c58dbfbe58a9424d26a2d4;hb=HEAD;hp=672d362609aae723d3416bca95123718323f67ce;hpb=f056a7ebac7dae36cee4f9bfd4869e9de76ad6f7;p=icn.git diff --git a/tools/vagrant/destroy.rb b/tools/vagrant/destroy.rb index 672d362..d6915b0 100755 --- a/tools/vagrant/destroy.rb +++ b/tools/vagrant/destroy.rb @@ -6,12 +6,12 @@ site = ENV['ICN_SITE'] || 'vm' Dir.chdir(File.join(__dir__, '../../')) system('vagrant destroy -f jump') -Dir.glob("deploy/site/#{site}/*.yaml") do |file| +Dir.glob("deploy/site/#{site}/deployment/*.yaml") do |file| YAML.load_stream(File.read(file)) do |document| values = document.fetch('spec', {}).fetch('values', {}) next if values['machineName'].nil? || values['bootMACAddress'].nil? machine_name = values['machineName'] - system("virsh -c qemu:///system destroy vm-#{machine_name}") - system("virsh -c qemu:///system undefine --nvram --remove-all-storage vm-#{machine_name}") + system("virsh -c qemu:///system destroy #{site}-#{machine_name}") + system("virsh -c qemu:///system undefine --nvram --remove-all-storage #{site}-#{machine_name}") end end