summaryrefslogtreecommitdiff
path: root/virt-xml
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2017-03-06 21:32:32 -0500
committerCole Robinson <crobinso@redhat.com>2017-03-06 22:15:46 -0500
commit38c10f70f81d82f5075d7a6be47c5915db963a61 (patch)
tree20d11857c297e2c0651694284821fa71063abe46 /virt-xml
parent405b5ea804f328dbc74bebb1f3c7743079bec54b (diff)
downloadvirt-manager-38c10f70f81d82f5075d7a6be47c5915db963a61.tar.gz
virt-xml: Only print message if changes are applied
Diffstat (limited to 'virt-xml')
-rwxr-xr-xvirt-xml8
1 files changed, 5 insertions, 3 deletions
diff --git a/virt-xml b/virt-xml
index 93201f89..cfe37965 100755
--- a/virt-xml
+++ b/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: