Fix bug with VM editing with file
Current config is needed for the diff but it was in a conditional.
This commit is contained in:
parent
5be968123f
commit
7dd17e71e7
|
@ -788,12 +788,12 @@ def vm_modify(domain, cfgfile, editor, restart, confirm_flag):
|
||||||
|
|
||||||
dom_name = vm_information.get('name')
|
dom_name = vm_information.get('name')
|
||||||
|
|
||||||
if editor is True:
|
|
||||||
# Grab the current config
|
# Grab the current config
|
||||||
current_vm_cfg_raw = vm_information.get('xml')
|
current_vm_cfg_raw = vm_information.get('xml')
|
||||||
xml_data = etree.fromstring(current_vm_cfg_raw)
|
xml_data = etree.fromstring(current_vm_cfg_raw)
|
||||||
current_vm_cfgfile = etree.tostring(xml_data, pretty_print=True).decode('utf8').strip()
|
current_vm_cfgfile = etree.tostring(xml_data, pretty_print=True).decode('utf8').strip()
|
||||||
|
|
||||||
|
if editor is True:
|
||||||
new_vm_cfgfile = click.edit(text=current_vm_cfgfile, require_save=True, extension='.xml')
|
new_vm_cfgfile = click.edit(text=current_vm_cfgfile, require_save=True, extension='.xml')
|
||||||
if new_vm_cfgfile is None:
|
if new_vm_cfgfile is None:
|
||||||
click.echo('Aborting with no modifications.')
|
click.echo('Aborting with no modifications.')
|
||||||
|
|
Loading…
Reference in New Issue