diff options
author | Zuul <zuul@review.opendev.org> | 2021-03-25 05:26:07 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2021-03-25 05:26:07 +0000 |
commit | 4952f23bbcf72a10df95add7628552875dc383a7 (patch) | |
tree | 3606651124c6d0d12dce0b923f5a28820feb218f | |
parent | a086a88cd1d2d30557f0870fad9363ed1f7ec888 (diff) | |
parent | 020e46094a7871cd5fa42d18e53d18f21e47a8fa (diff) | |
download | nova-4952f23bbcf72a10df95add7628552875dc383a7.tar.gz |
Merge "[Arm64][libvirt] Fix read bytes from json files"
-rw-r--r-- | nova/tests/unit/virt/libvirt/test_host.py | 2 | ||||
-rw-r--r-- | nova/virt/libvirt/host.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/nova/tests/unit/virt/libvirt/test_host.py b/nova/tests/unit/virt/libvirt/test_host.py index 1abb0458ab..20279a91a2 100644 --- a/nova/tests/unit/virt/libvirt/test_host.py +++ b/nova/tests/unit/virt/libvirt/test_host.py @@ -1970,4 +1970,4 @@ class LoadersTestCase(test.NoDBTestCase): ]) mock_glob.assert_called_once_with( '/usr/share/qemu/firmware/*.json') - mock_open.assert_called_once_with('10_fake.json') + mock_open.assert_called_once_with('10_fake.json', 'rb') diff --git a/nova/virt/libvirt/host.py b/nova/virt/libvirt/host.py index 2321501be9..1de93137b5 100644 --- a/nova/virt/libvirt/host.py +++ b/nova/virt/libvirt/host.py @@ -108,7 +108,7 @@ def _get_loaders(): continue for spec_path in sorted(glob.glob(f'{path}/*.json')): - with open(spec_path) as fh: + with open(spec_path, 'rb') as fh: spec = jsonutils.load(fh) _loaders.append(spec) |