Only run disk action if disk config present

This commit is contained in:
Brian Cain 2019-12-17 10:45:33 -08:00
parent 55994824a4
commit de61b307aa
No known key found for this signature in database
GPG Key ID: 9FC4639B2E4510A0
1 changed files with 7 additions and 5 deletions

View File

@ -12,12 +12,14 @@ module Vagrant
defined_disks = get_disks(machine, env) defined_disks = get_disks(machine, env)
# Call into providers machine implementation for disk management # Call into providers machine implementation for disk management
if !defined_disks.empty?
if machine.provider.capability?(:configure_disks) if machine.provider.capability?(:configure_disks)
machine.provider.capability(:configure_disks, defined_disks) machine.provider.capability(:configure_disks, defined_disks)
else else
env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported", env[:ui].warn(I18n.t("vagrant.actions.disk.provider_unsupported",
provider: machine.provider_name)) provider: machine.provider_name))
end end
end
# Continue On # Continue On
@app.call(env) @app.call(env)