daemon: Check if devices are found when generating deployed scenario XML.

This commit is contained in:
Tom Goff 2015-10-13 11:02:08 -04:00
parent ec5635c4a4
commit f16f11c272

View file

@ -132,6 +132,10 @@ class CoreDeploymentWriter(object):
assert isinstance(obj, nodes.PyCoreNode)
el = self.add_host(parent, obj.name)
device = self.find_device(self.root.baseEle, obj.name)
if device is None:
self.session.warn('corresponding XML device not found for %s' %
(obj.name))
return
self.add_mapping(device, 'testHost', el.getAttribute('id'))
self.add_type(el, 'virtual')
for netif in obj.netifs():