def test_network_not_mapped_to_nics_w_template(self):
        # delete and restore management network to break the default
        # networks to interfaces mapping
        resp = self.app.get(
            reverse('NetworkGroupCollectionHandler',
                    kwargs=self.cluster),
            headers=self.default_headers,
            expect_errors=False
        )
        management = None
        for ng in jsonutils.loads(resp.body):
            if ng['name'] == 'management':
                management = ng
                break
        self.app.delete(
            reverse(
                'NetworkGroupHandler',
                kwargs={'obj_id': management.pop('id')}
            ),
            headers=self.default_headers
        )
        self.app.post(
            reverse('NetworkGroupCollectionHandler'),
            jsonutils.dumps(management),
            headers=self.default_headers,
            expect_errors=False,
        )
        resp = self.app.get(
            reverse('NetworkGroupCollectionHandler',
                    kwargs=self.cluster),
            headers=self.default_headers,
            expect_errors=False
        )
        # management network is not mapped to any interfaces in DB now
        cluster_db = self.db.query(models.Cluster).get(self.cluster['id'])
        objects.Cluster.prepare_for_deployment(cluster_db)
        serializer = get_serializer_for_cluster(cluster_db)
        self.serialized_for_astute = serializer(
            AstuteGraph(cluster_db)).serialize(cluster_db, cluster_db.nodes)

        network_roles = [
            'management',
            'swift/api',
            'neutron/api',
            'sahara/api',
            'ceilometer/api',
            'cinder/api',
            'keystone/api',
            'glance/api',
            'heat/api',
            'nova/api',
            'murano/api',
            'horizon',
            'mgmt/memcache',
            'mgmt/database',
            'mgmt/messaging',
            'neutron/mesh',
            'mgmt/vip',
            'mgmt/corosync',
            'mongo/db',
            'nova/migration'
        ]
        for node_data in self.serialized_for_astute:
            for n in node_data['nodes']:
                n_db = objects.Node.get_by_uid(n['uid'])
                if n_db.roles in 'controller':
                    self.assertIn('internal_address', n)
                    self.assertIn('internal_netmask', n)
                    self.assertIn('public_address', n)
                    self.assertIn('public_netmask', n)
                    self.assertNotIn('storage_address', n)
                    self.assertNotIn('storage_netmask', n)
                else:
                    self.assertIn('internal_address', n)
                    self.assertIn('internal_netmask', n)
                    self.assertNotIn('public_address', n)
                    self.assertNotIn('public_netmask', n)
                    self.assertIn('storage_address', n)
                    self.assertIn('storage_netmask', n)
            nodes = node_data['network_metadata']['nodes']
            for node_name, node_attrs in nodes.items():
                # IPs must be serialized for these roles which are tied to
                # management network
                for role in network_roles:
                    self.assertIsNotNone(node_attrs['network_roles'][role])
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/integration/test_orchestrator_serializer_70.py/TestNetworkTemplateSerializer70.test_network_not_mapped_to_nics_w_template/swapped operands of `in`