[virt-manager PATCH 4/9] cli: add fail helper for 2 conflicting cli options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It will avoid repeating the same message in different places.

Signed-off-by: Pino Toscano <ptoscano@xxxxxxxxxx>
---
 virtinst/cli.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/virtinst/cli.py b/virtinst/cli.py
index 8a06e8b2..91f40f31 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -474,6 +474,16 @@ def get_domain_and_guest(conn, domstr):
     return (domain, inactive_xmlobj, active_xmlobj)
 
 
+def fail_conflicting(option1, option2):
+    # translators: option1 and option2 are command line options,
+    # e.g. -a or --disk
+    msg = _("Cannot use %(option1)s and %(option2)s at the same time") % {
+        "option1": option1,
+        "option2": option2,
+    }
+    fail(msg)
+
+
 ###########################
 # bash completion helpers #
 ###########################
-- 
2.26.2




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux