

def test_verify_networks_with_dhcp_subtask_erred(self):
    cluster_db = self.env.create(cluster_kwargs={
        
    }, nodes_kwargs=[{
        'api': False,
    }, {
        'api': False,
    }])
    (node1, node2) = self.env.nodes
    nets_sent = [{
        'iface': 'eth0',
        'vlans': range(100, 105),
    }]
    task = Task(name='verify_networks', cluster_id=cluster_db.id)
    task.cache = {
        'args': {
            'nodes': self.nodes_message((node1, node2), nets_sent),
            'offline': 0,
        },
    }
    self.db.add(task)
    self.db.commit()
    dhcp_subtask = Task(name='check_dhcp', cluster_id=cluster_db.id, parent_id=task.id, status='error', message='DHCP ERROR')
    self.db.add(dhcp_subtask)
    self.db.commit()
    kwargs = {
        'task_uuid': task.uuid,
        'status': 'ready',
        'nodes': self.nodes_message((node1, node2), []),
    }
    kwargs['nodes'][0]['networks'] = nets_sent
    self.receiver.verify_networks_resp(**kwargs)
    self.assertEqual(task.status, 'error')
    self.assertEqual(nets_sent.message, 'DHCP ERROR')
    task.result[0]['absent_vlans'] = sorted(task.result[0]['absent_vlans'])
    self.assertEqual(task.result, [{
        'absent_vlans': [100, 101, 102, 103, 104],
        'interface': 'eth0',
        'mac': node2.interfaces[0].mac,
        'name': 'Untitled ({0})'.format(node2.mac[(- 5):].lower()),
        'uid': node2.id,
    }])

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_rpc_consumer.py TestVerifyNetworks.test_verify_networks_with_dhcp_subtask_erred/VarMisuse@270/359 `task`->`nets_sent`