summaryrefslogtreecommitdiff
path: root/nova/tests/unit
diff options
context:
space:
mode:
authorKeigo Noha <knoha@redhat.com>2020-07-10 10:32:02 +0900
committermelanie witt <melwittt@gmail.com>2021-01-14 23:21:34 +0000
commited7767865f891d5a90915f3486d567e2ac649a7e (patch)
tree0ba85f8631401d4676ea6cc04fb27a6c97304c91 /nova/tests/unit
parentc9f50e98d26ae2efd8efdce2c47895cffa276dd3 (diff)
downloadnova-ed7767865f891d5a90915f3486d567e2ac649a7e.tar.gz
Change default num_retries for glance to 3
Previously, the default value of num_retries for glance is 0. It means that the request to glance is sent only one time. On the other hand, neutron and cinder clients set the default value to 3. To align the default value for retry to other components, we should change the default value to 3. Closes-Bug: #1888168 Change-Id: Ibbd4bd26408328b9e1a1128b3794721405631193 (cherry picked from commit 662af9fab6eacb46bcaee38d076d33c2c0f82b9b) (cherry picked from commit 1f9dd694b937cc55a81a64fdce442829f009afb3) (cherry picked from commit ca2fd8098a47cf2c38351dc4c8c65c7c5fe0afc3)
Diffstat (limited to 'nova/tests/unit')
-rw-r--r--nova/tests/unit/virt/xenapi/image/test_glance.py12
-rw-r--r--nova/tests/unit/virt/xenapi/test_vm_utils.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/nova/tests/unit/virt/xenapi/image/test_glance.py b/nova/tests/unit/virt/xenapi/image/test_glance.py
index 3994af1792..be49622e73 100644
--- a/nova/tests/unit/virt/xenapi/image/test_glance.py
+++ b/nova/tests/unit/virt/xenapi/image/test_glance.py
@@ -148,7 +148,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
mock_sr_path.assert_called_once_with(self.session)
mock_extra_header.assert_called_once_with(self.context)
mock_upload.assert_called_once_with(
- self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
+ self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
'fake_sr_path', 'fake_extra_header', **params)
@mock.patch.object(utils, 'get_auto_disk_config_from_instance')
@@ -169,7 +169,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
mock_sr_path.assert_called_once_with(self.session)
mock_extra_header.assert_called_once_with(self.context)
mock_upload.assert_called_once_with(
- self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
+ self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
'fake_sr_path', 'fake_extra_header', **params)
mock_disk_config.assert_called_once_with(self.instance)
@@ -190,7 +190,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
mock_sr_path.assert_called_once_with(self.session)
mock_extra_header.assert_called_once_with(self.context)
mock_upload.assert_called_once_with(
- self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
+ self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
'fake_sr_path', 'fake_extra_header', **params)
mock_disk_config.assert_called_once_with(self.instance)
@@ -211,7 +211,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
mock_sr_path.assert_called_once_with(self.session)
mock_extra_header.assert_called_once_with(self.context)
mock_upload.assert_called_once_with(
- self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
+ self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
'fake_sr_path', 'fake_extra_header', **params)
@mock.patch.object(common_glance, 'generate_identity_headers')
@@ -231,7 +231,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
mock_sr_path.assert_called_once_with(self.session)
mock_extra_header.assert_called_once_with(self.context)
mock_upload.assert_called_once_with(
- self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
+ self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
'fake_sr_path', 'fake_extra_header', **params)
@mock.patch.object(time, 'sleep')
@@ -330,5 +330,5 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
mock_sr_path.assert_called_once_with(self.session)
mock_extra_header.assert_called_once_with(self.context)
mock_upload.assert_called_once_with(
- self.session, 0, mock.ANY, mock.ANY, 'fake_image_uuid',
+ self.session, 3, mock.ANY, mock.ANY, 'fake_image_uuid',
'fake_sr_path', 'fake_extra_header', **params)
diff --git a/nova/tests/unit/virt/xenapi/test_vm_utils.py b/nova/tests/unit/virt/xenapi/test_vm_utils.py
index ef2d687e8f..ef29e27e36 100644
--- a/nova/tests/unit/virt/xenapi/test_vm_utils.py
+++ b/nova/tests/unit/virt/xenapi/test_vm_utils.py
@@ -258,7 +258,7 @@ class FetchVhdImageTestCase(VMUtilsTestBase):
self.mock_call_plugin.assert_called_once_with(
'glance.py',
'download_vhd2',
- 0,
+ 3,
mock.ANY,
mock.ANY,
extra_headers={'X-Auth-Token': 'auth_token',