Merge "Correct _ensure_console_log_for_instance implementation"

This commit is contained in:
Jenkins 2017-05-29 16:37:58 +00:00 committed by Gerrit Code Review
commit 7916941571
2 changed files with 2 additions and 2 deletions

View File

@ -10991,7 +10991,7 @@ class LibvirtConnTestCase(test.NoDBTestCase):
with test.nested(
mock.patch.object(drvr, '_get_console_log_path'),
mock.patch.object(fake_libvirt_utils, 'file_open',
side_effect=IOError(errno.EPERM, 'exc'))
side_effect=IOError(errno.EACCES, 'exc'))
) as (mock_path, mock_open):
drvr._ensure_console_log_for_instance(mock.ANY)
mock_path.assert_called_once()

View File

@ -3010,7 +3010,7 @@ class LibvirtDriver(driver.ComputeDriver):
# NOTE(sfinucan): We can safely ignore permission issues here and
# assume that it is libvirt that has taken ownership of this file.
except IOError as ex:
if ex.errno != errno.EPERM:
if ex.errno != errno.EACCES:
raise
LOG.debug('Console file already exists: %s.', console_file)