def __init__(self, *args, **kwargs): super(MetadataManager, self).__init__(*args, **kwargs) if not utils.is_neutron(): # NOTE(mikal): we only add iptables rules if we're running # under nova-network. This code should go away when the # deprecation of nova-network is complete. self.network_driver = driver.load_network_driver() self.network_driver.metadata_accept()
def setUp(self): super(LinuxNetworkTestCase, self).setUp() self.driver = driver.load_network_driver() self.driver.db = db self.context = context.RequestContext("testuser", "testproject", is_admin=True) def get_vifs(_context, instance_uuid): return [vif for vif in vifs if vif["instance_uuid"] == instance_uuid] def get_instance(_context, instance_id): return instances[instance_id] self.stubs.Set(db, "virtual_interface_get_by_instance", get_vifs) self.stubs.Set(db, "instance_get", get_instance) self.stubs.Set(db, "network_get_associated_fixed_ips", get_associated)
def setUp(self): super(LinuxNetworkTestCase, self).setUp() self.driver = driver.load_network_driver() self.driver.db = db self.context = context.RequestContext('testuser', 'testproject', is_admin=True) def get_vifs(_context, instance_uuid): return [vif for vif in vifs if vif['instance_uuid'] == instance_uuid] def get_instance(_context, instance_id): return instances[instance_id] self.stubs.Set(db, 'virtual_interface_get_by_instance', get_vifs) self.stubs.Set(db, 'instance_get', get_instance) self.stubs.Set(db, 'network_get_associated_fixed_ips', get_associated)
def setUp(self): super(LinuxNetworkTestCase, self).setUp() self.driver = driver.load_network_driver() self.driver.db = db self.context = context.RequestContext('testuser', 'testproject', is_admin=True) def get_vifs(_context, instance_uuid, use_slave): return [vif for vif in vifs if vif['instance_uuid'] == instance_uuid] def get_instance(_context, instance_id): return instances[instance_id] self.stubs.Set(db, 'virtual_interface_get_by_instance', get_vifs) self.stubs.Set(db, 'instance_get', get_instance) self.stubs.Set(db, 'network_get_associated_fixed_ips', get_associated)
def __init__(self, *args, **kwargs): super(MetadataManager, self).__init__(*args, **kwargs) self.network_driver = driver.load_network_driver() self.network_driver.metadata_accept()
def __init__(self, *args, **kwargs): super(MetadataManager, self).__init__(*args, **kwargs) self.network_driver = driver.load_network_driver()