Activity log for bug #1475353

Date Who What changed Old value New value Message
2015-07-16 15:11:08 Andrea Rosa bug added bug
2015-07-16 15:11:15 Andrea Rosa nova: assignee Andrea Rosa (andrea-rosa-m)
2015-07-16 15:16:44 Andrea Rosa tags low-hanging-fruit
2015-07-16 15:18:09 OpenStack Infra nova: status New In Progress
2015-07-28 13:33:45 Andrea Rosa summary _get_host_sysinfo_serial_os fails if the machine-id file is empty _get_host_sysinfo_serial_os fails with different exceptions if the file is not present or if it is empty
2015-07-28 13:55:30 Andrea Rosa description the _get_host_sysinfo_serial_os method try to read the machine-id file to get an UUID for the host operating system. If the file is there but it is empty the code will raise an exception while it tries to parse the content of the file. To reproduce the issue just add this test to the nova/tests/unit/virt/libvirt/test_driver.py def test_get_guest_config_sysinfo_serial_os_empty_machine_id(self): self.flags(sysinfo_serial="os", group="libvirt") real_open = __builtin__.open with contextlib.nested( mock.patch.object(__builtin__, "open"), ) as (mock_open, ): theuuid = "" def fake_open(filename, *args, **kwargs): if filename == "/etc/machine-id": h = mock.MagicMock() h.read.return_value = theuuid h.__enter__.return_value = h return h return real_open(filename, *args, **kwargs) mock_open.side_effect = fake_open self._test_get_guest_config_sysinfo_serial(None) When the sysinfo_serial config parameter for the libvirt driver is set to 'os', the defined behavior is: - return the value found in /etc/machine-id file or - return an error if the file is not present. There is an additional scenario where the file is present but it is empty (https://bugs.launchpad.net/ubuntu/+source/nova/+bug/1413293) in that case we want nova to behave as if the file was missed. At the moment the missing file and an empty file return different exceptions: - IOError for a missing file - IndexError for an empty file Both of these errors are too general and don't give a big help in debugging the issue. Please note that we do not want to fix the issue about a missing/empty machine-id file, that is something related to a bad OS installation/configuration or a bad image, the proposed fix is just to keep nova behaves consistently and giving back to the user a more clear and precise error.
2015-07-28 13:55:54 Andrea Rosa summary _get_host_sysinfo_serial_os fails with different exceptions if the file is not present or if it is empty _get_host_sysinfo_serial_os fails with different exceptions if the machine-id file is not present or if it is empty
2015-08-03 13:52:21 OpenStack Infra nova: assignee Andrea Rosa (andrea-rosa-m) Alexis Lee (alexisl)
2015-08-14 13:24:26 Andrea Rosa nova: assignee Alexis Lee (alexisl) Andrea Rosa (andrea-rosa-m)
2015-08-14 22:44:54 OpenStack Infra nova: status In Progress Fix Committed
2015-09-03 11:51:37 Thierry Carrez nova: status Fix Committed Fix Released
2015-09-03 11:51:37 Thierry Carrez nova: milestone liberty-3
2015-10-15 09:02:11 Thierry Carrez nova: milestone liberty-3 12.0.0
2016-03-01 18:28:24 Matt Riedemann nova: importance Undecided High
2016-03-01 18:30:31 Matt Riedemann tags low-hanging-fruit libvirt low-hanging-fruit
2016-03-01 18:30:34 Matt Riedemann nova: importance High Medium