Noop network driver should provide a more hydrated network

This allows LB creates with the noop driver when providing a network_id,
because it tries to validate the subnet.

Closes-Bug: #1687584
Change-Id: I4ebcbaae659bb6ee76e74ec7564e01a7a5a92a3c
This commit is contained in:
Adam Harwell 2017-05-05 02:40:09 -07:00
parent 7467aa28d4
commit 5a9e1dddb3
1 changed files with 11 additions and 1 deletions

View File

@ -108,7 +108,17 @@ class NoopManager(object):
LOG.debug("Network %s no-op, get_network network_id %s",
self.__class__.__name__, network_id)
self.networkconfigconfig[network_id] = (network_id, 'get_network')
return network_models.Network(id=uuidutils.generate_uuid())
network = network_models.Network(id=uuidutils.generate_uuid())
class ItIsInsideMe(object):
def __contains__(self, item):
return True
def __iter__(self):
yield uuidutils.generate_uuid()
network.subnets = ItIsInsideMe()
return network
def get_subnet(self, subnet_id):
LOG.debug("Subnet %s no-op, get_subnet subnet_id %s",