mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Handle setting of graphics options avoiding XML diff (#1577)
The attribute autoport="no" will be dropped, therefore ensure that when graphics_autoport should be disabled, default it to nil, which allows the existing code to exclude it from the domain template. Otherwise being set to no will result in an apparent difference due to the returned XML after update dropping the attribute.
This commit is contained in:
parent
cede7fff8b
commit
8f868b9b88
@ -210,6 +210,7 @@ module VagrantPlugins
|
||||
descr_changed = true
|
||||
graphics.attributes['autoport'] = config.graphics_autoport
|
||||
if config.graphics_autoport == 'no'
|
||||
graphics.attributes.delete('autoport')
|
||||
graphics.attributes['port'] = config.graphics_port
|
||||
end
|
||||
end
|
||||
|
@ -896,8 +896,7 @@ module VagrantPlugins
|
||||
@initrd = '' if @initrd == UNSET_VALUE
|
||||
@dtb = nil if @dtb == UNSET_VALUE
|
||||
@graphics_type = 'vnc' if @graphics_type == UNSET_VALUE
|
||||
@graphics_autoport = 'yes' if @graphics_port == UNSET_VALUE
|
||||
@graphics_autoport = 'no' if @graphics_port != UNSET_VALUE
|
||||
@graphics_autoport = @graphics_port == UNSET_VALUE ? 'yes' : nil
|
||||
if (@graphics_type != 'vnc' && @graphics_type != 'spice') ||
|
||||
@graphics_passwd == UNSET_VALUE
|
||||
@graphics_passwd = nil
|
||||
|
Loading…
Reference in New Issue
Block a user