summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/common/test_pxe_utils.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2019-06-18 12:09:44 +0200
committerDmitry Tantsur <dtantsur@protonmail.com>2019-06-18 12:23:11 +0200
commit12e45f314a40e568752816f27ee3c7b3148582ca (patch)
treeac80db47e9484c31cce4084f53914938d22363d6 /ironic/tests/unit/common/test_pxe_utils.py
parentdcfb4f10f31c11afa350ef6418a0e12e6be6e5b2 (diff)
downloadironic-12e45f314a40e568752816f27ee3c7b3148582ca.tar.gz
Refactoring: flatten the glance service module
The current structure is designed to support several major versions. However, we only support V2 and in the future will use openstacksdk to abstract away major version differences. Change-Id: I99bcb0650ac609ae9f0a8bcff70429eb4a3b7274
Diffstat (limited to 'ironic/tests/unit/common/test_pxe_utils.py')
-rw-r--r--ironic/tests/unit/common/test_pxe_utils.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/ironic/tests/unit/common/test_pxe_utils.py b/ironic/tests/unit/common/test_pxe_utils.py
index b082a059a..15e3414b4 100644
--- a/ironic/tests/unit/common/test_pxe_utils.py
+++ b/ironic/tests/unit/common/test_pxe_utils.py
@@ -25,7 +25,7 @@ from oslo_utils import uuidutils
import six
from ironic.common import exception
-from ironic.common.glance_service import base_image_service
+from ironic.common.glance_service import image_service
from ironic.common import pxe_utils
from ironic.common import states
from ironic.common import utils
@@ -1126,8 +1126,7 @@ class PXEInterfacesTestCase(db_base.DbTestCase):
self.assertRaises(exception.MissingParameterValue,
pxe_utils.get_image_info, self.node)
- @mock.patch.object(base_image_service.BaseImageService, '_show',
- autospec=True)
+ @mock.patch.object(image_service.GlanceImageService, 'show', autospec=True)
def _test_get_instance_image_info(self, show_mock):
properties = {'properties': {u'kernel_id': u'instance_kernel_uuid',
u'ramdisk_id': u'instance_ramdisk_uuid'}}
@@ -1147,8 +1146,7 @@ class PXEInterfacesTestCase(db_base.DbTestCase):
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task:
image_info = pxe_utils.get_instance_image_info(task)
- show_mock.assert_called_once_with(mock.ANY, 'glance://image_uuid',
- method='get')
+ show_mock.assert_called_once_with(mock.ANY, 'glance://image_uuid')
self.assertEqual(expected_info, image_info)
# test with saved info
@@ -1183,8 +1181,7 @@ class PXEInterfacesTestCase(db_base.DbTestCase):
self.assertEqual({}, image_info)
boot_opt_mock.assert_called_once_with(task.node)
- @mock.patch.object(base_image_service.BaseImageService, '_show',
- autospec=True)
+ @mock.patch.object(image_service.GlanceImageService, 'show', autospec=True)
def test_get_instance_image_info_whole_disk_image(self, show_mock):
properties = {'properties': None}
show_mock.return_value = properties