コード例 #1
0
    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()
コード例 #2
0
ファイル: test_linux_net.py プロジェクト: luisgarcc/nova
    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)
コード例 #3
0
    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)
コード例 #4
0
    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)
コード例 #5
0
 def __init__(self, *args, **kwargs):
     super(MetadataManager, self).__init__(*args, **kwargs)
     self.network_driver = driver.load_network_driver()
     self.network_driver.metadata_accept()
コード例 #6
0
 def __init__(self, *args, **kwargs):
     super(MetadataManager, self).__init__(*args, **kwargs)
     self.network_driver = driver.load_network_driver()