mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 21:18:04 +03:00
virt-xml: Only print message if changes are applied
This commit is contained in:
parent
405b5ea804
commit
38c10f70f8
8
virt-xml
8
virt-xml
@ -257,7 +257,7 @@ def define_changes(conn, inactive_xmlobj, devs, action, confirm):
|
||||
if confirm:
|
||||
if not prompt_yes_or_no(
|
||||
_("Define '%s' with the changed XML?") % inactive_xmlobj.name):
|
||||
return
|
||||
return False
|
||||
|
||||
if action == "hotplug":
|
||||
for dev in devs:
|
||||
@ -265,6 +265,7 @@ def define_changes(conn, inactive_xmlobj, devs, action, confirm):
|
||||
|
||||
conn.defineXML(inactive_xmlobj.get_xml_config())
|
||||
print_stdout(_("Domain '%s' defined successfully.") % inactive_xmlobj.name)
|
||||
return True
|
||||
|
||||
|
||||
def update_changes(domain, devs, action, confirm):
|
||||
@ -461,8 +462,9 @@ def main(conn=None):
|
||||
update_changes(domain, devs, action, options.confirm)
|
||||
if options.define:
|
||||
devs, action = prepare_changes(inactive_xmlobj, options, parserclass)
|
||||
define_changes(conn, inactive_xmlobj, devs, action, options.confirm)
|
||||
if not options.update and active_xmlobj:
|
||||
applied = define_changes(conn, inactive_xmlobj,
|
||||
devs, action, options.confirm)
|
||||
if not options.update and active_xmlobj and applied:
|
||||
print_stdout(
|
||||
_("Changes will take effect after the next domain shutdown."))
|
||||
if not options.update and not options.define:
|
||||
|
Loading…
Reference in New Issue
Block a user