mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
uihelpers: Don't store network objs in combo model
Causes issues with trying to reap virConnect values
This commit is contained in:
parent
a52ad2eb37
commit
efee2bf7b2
@ -942,12 +942,15 @@ class vmmCreate(vmmGObjectUI):
|
||||
if not idx < 0:
|
||||
row = src.get_model()[idx]
|
||||
ntype = row[0]
|
||||
obj = row[6]
|
||||
key = row[6]
|
||||
|
||||
show_pxe_warn = (
|
||||
(ntype == virtinst.VirtualNetworkInterface.TYPE_USER or
|
||||
(ntype == virtinst.VirtualNetworkInterface.TYPE_VIRTUAL and
|
||||
not obj.can_pxe())))
|
||||
if ntype == virtinst.VirtualNetworkInterface.TYPE_USER:
|
||||
show_pxe_warn = True
|
||||
elif ntype != virtinst.VirtualNetworkInterface.TYPE_VIRTUAL:
|
||||
show_pxe_warn = False
|
||||
else:
|
||||
obj = self.conn.get_net(key)
|
||||
show_pxe_warn = not obj.can_pxe()
|
||||
|
||||
self.set_net_warn(show_pxe_warn and pxe_install,
|
||||
_("Network selection does not support PXE"), False)
|
||||
|
@ -360,10 +360,10 @@ def populate_network_list(net_list, conn, show_direct_interfaces=True):
|
||||
iface_dict = {}
|
||||
|
||||
def build_row(nettype, name, label, is_sensitive, is_running,
|
||||
manual_bridge=False, obj=None):
|
||||
manual_bridge=False, key=None):
|
||||
return [nettype, name, label,
|
||||
is_sensitive, is_running, manual_bridge,
|
||||
obj]
|
||||
key]
|
||||
|
||||
def set_active(idx):
|
||||
net_list.set_active(idx)
|
||||
@ -401,7 +401,7 @@ def populate_network_list(net_list, conn, show_direct_interfaces=True):
|
||||
netIdxLabel = label
|
||||
|
||||
vnet_dict[label] = build_row(nettype, net.get_name(), label, True,
|
||||
net.is_active(), obj=net)
|
||||
net.is_active(), key=net.get_uuid())
|
||||
|
||||
# Build a list of vnet bridges, so we know not to list them
|
||||
# in the physical interface list
|
||||
@ -448,7 +448,8 @@ def populate_network_list(net_list, conn, show_direct_interfaces=True):
|
||||
if hasShared and not brIdxLabel:
|
||||
brIdxLabel = label
|
||||
|
||||
row = build_row(nettype, bridge_name, label, sensitive, True, obj=br)
|
||||
row = build_row(nettype, bridge_name, label, sensitive, True,
|
||||
key=br.get_name())
|
||||
|
||||
if sensitive:
|
||||
bridge_dict[label] = row
|
||||
|
Loading…
Reference in New Issue
Block a user