예제 #1
0
    def test_dhcp_options_for_instance(self):
        node = self._create_node()
        fake_bootfile = "pxelinux.0"
        self.mox.StubOutWithMock(pxe, 'get_pxe_bootfile_name')
        pxe.get_pxe_bootfile_name(mox.IgnoreArg()).AndReturn(fake_bootfile)
        self.mox.ReplayAll()
        expected = [{'opt_name': 'bootfile-name', 'opt_value': fake_bootfile},
                    {'opt_name': 'server-ip-address', 'opt_value': CONF.my_ip},
                    {'opt_name': 'tftp-server', 'opt_value': CONF.my_ip}]

        res = self.driver.dhcp_options_for_instance(node['instance'])
        self.assertEqual(expected.sort(), res.sort())
        self.mox.VerifyAll()
예제 #2
0
    def test_dhcp_options_for_instance(self):
        node = self._create_node()
        fake_bootfile = "pxelinux.0"
        self.mox.StubOutWithMock(pxe, 'get_pxe_bootfile_name')
        pxe.get_pxe_bootfile_name(mox.IgnoreArg()).AndReturn(fake_bootfile)
        self.mox.ReplayAll()
        expected = [{'opt_name': 'bootfile-name', 'opt_value': fake_bootfile},
                    {'opt_name': 'server-ip-address', 'opt_value': CONF.my_ip},
                    {'opt_name': 'tftp-server', 'opt_value': CONF.my_ip}]

        res = self.driver.dhcp_options_for_instance(node['instance'])
        self.assertEqual(expected.sort(), res.sort())
        self.mox.VerifyAll()
예제 #3
0
파일: test_driver.py 프로젝트: slagle/nova
    def test_dhcp_options_for_instance(self):
        node = self._create_node()
        fake_bootfile = "pxelinux.0"
        self.mox.StubOutWithMock(pxe, "get_pxe_bootfile_name")
        pxe.get_pxe_bootfile_name(mox.IgnoreArg()).AndReturn(fake_bootfile)
        self.mox.ReplayAll()
        expected = [
            {"opt_name": "bootfile-name", "opt_value": fake_bootfile},
            {"opt_name": "server-ip-address", "opt_value": CONF.my_ip},
            {"opt_name": "tftp-server", "opt_value": CONF.my_ip},
        ]

        res = self.driver.dhcp_options_for_instance(node["instance"])
        self.assertEqual(expected.sort(), res.sort())
        self.mox.VerifyAll()
예제 #4
0
파일: driver.py 프로젝트: BigFire/nova-1
    def dhcp_options_for_instance(self, instance):
        # NOTE(deva): This only works for PXE driver currently:
        # If not running the PXE driver, you should not enable
        # DHCP updates in nova.conf.
        bootfile_name = pxe.get_pxe_bootfile_name(instance)

        opts = [
            {"opt_name": "bootfile-name", "opt_value": bootfile_name},
            {"opt_name": "server-ip-address", "opt_value": CONF.my_ip},
            {"opt_name": "tftp-server", "opt_value": CONF.my_ip},
        ]

        return opts
예제 #5
0
    def dhcp_options_for_instance(self, instance):
        # NOTE(deva): This only works for PXE driver currently:
        # If not running the PXE driver, you should not enable
        # DHCP updates in nova.conf.
        bootfile_name = pxe.get_pxe_bootfile_name(instance)

        opts = [{'opt_name': 'bootfile-name',
                 'opt_value': bootfile_name},
                {'opt_name': 'server-ip-address',
                 'opt_value': CONF.my_ip},
                {'opt_name': 'tftp-server',
                 'opt_value': CONF.my_ip}
               ]

        return opts