In backend NICs arrive with netinfo filled. If nic.network is not None
nic.netinfo is not too. Thus all the info is derived from HooksDict()
and nic.network must not be checked.
---
lib/backend.py | 5 -----
1 file changed, 5 deletions(-)
diff --git a/lib/backend.py b/lib/backend.py
index cf28d4f..569a616 100644
--- a/lib/backend.py
+++ b/lib/backend.py
@@ -2501,11 +2501,6 @@ def OSEnvironment(instance, inst_os, debug=0):
if nic.netinfo:
nobj = objects.Network.FromDict(nic.netinfo)
result.update(nobj.HooksDict("NIC_%d_" % idx))
- elif nic.network:
- # FIXME: broken network reference: the instance NIC specifies a network,
- # but the relevant network entry was not in the config. This should be
- # made impossible.
- result["INSTANCE_NIC%d_NETWORK" % idx] = nic.network
if constants.HV_NIC_TYPE in instance.hvparams:
result["NIC_%d_FRONTEND_TYPE" % idx] = \
instance.hvparams[constants.HV_NIC_TYPE]
--
1.7.10.4