Skip to content

Commit

Permalink
Refactor prog to use force flag
Browse files Browse the repository at this point in the history
  • Loading branch information
enescakir committed Feb 2, 2024
1 parent f86eee2 commit 3d55c71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions prog/download_boot_image.rb
Expand Up @@ -25,10 +25,7 @@ def blob_storage_client
end

label def wait_draining
unless vm_host.vms.empty?
nap 15
end
sshable.cmd("sudo rm -f /var/storage/images/#{image_name.shellescape}.raw")
nap 15 unless vm_host.vms.empty?
hop_download
end

Expand Down Expand Up @@ -72,6 +69,9 @@ def blob_storage_client
end

label def activate_host
# Verify that the image was downloaded
sshable.cmd("ls /var/storage/images/#{image_name}.raw")

vm_host.update(allocation_state: "accepting")

pop "#{image_name} downloaded"
Expand Down
2 changes: 1 addition & 1 deletion rhizome/host/bin/download-boot-image
Expand Up @@ -11,4 +11,4 @@ custom_url = ARGV.shift
require_relative "../../common/lib/util"
require_relative "../lib/vm_setup"

VmSetup.new("").download_boot_image(boot_image, custom_url: custom_url)
VmSetup.new("").download_boot_image(boot_image, force: true, custom_url: custom_url)

0 comments on commit 3d55c71

Please sign in to comment.