Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit e75856a

Browse files
committed
Fix virt-install to fail if it can't find a default connection.
1 parent 7aa8dc5 commit e75856a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

virtinst/cli.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@ def nice_exit():
113113
sys.exit(0)
114114

115115
def getConnection(connect):
116-
if connect is None or connect.lower()[0:3] == "xen":
116+
if connect and connect.lower()[0:3] == "xen":
117117
if os.geteuid() != 0:
118118
fail(_("Must be root to create Xen guests"))
119+
if connect is None:
120+
fail(_("Could not find usable default libvirt connection."))
119121

122+
logging.debug("Using libvirt URI connect '%s'" % connect)
120123
return libvirt.open(connect)
121124

122125
#

0 commit comments

Comments
 (0)