Use correct iscsi portal port in continue_deploy

We should set it to CONF.iscsi.portal_port by default.

Closes-Bug: #1585731

Change-Id: I34e1f2ff842b323fb390f16cca32309fb64cfea3
This commit is contained in:
Vladyslav Drok 2016-05-25 21:01:20 +03:00
parent 981223fcf1
commit cc54cea060
3 changed files with 10 additions and 1 deletions

View File

@ -202,7 +202,7 @@ def get_deploy_info(node, **kwargs):
params = {
'address': kwargs.get('address'),
'port': kwargs.get('port', '3260'),
'port': kwargs.get('port', CONF.iscsi.portal_port),
'iqn': kwargs.get('iqn'),
'lun': kwargs.get('lun', '1'),
'image_path': _get_image_file_path(node.uuid),

View File

@ -499,6 +499,11 @@ class IscsiDeployMethodsTestCase(db_base.DbTestCase):
ret_val = self._test_get_deploy_info()
self.assertNotIn('disk_label', ret_val)
def test_get_deploy_info_portal_port(self):
self.config(portal_port=3266, group='iscsi')
ret_val = self._test_get_deploy_info()
self.assertEqual(3266, ret_val['port'])
@mock.patch.object(iscsi_deploy, 'continue_deploy', autospec=True)
@mock.patch.object(iscsi_deploy, 'build_deploy_ramdisk_options',
autospec=True)

View File

@ -0,0 +1,4 @@
---
fixes:
- Fixed the default value of 'port' in iscsi_deploy.get_deploy_info to be set
to [iscsi]/portal_port option value, instead of hardcoding it to '3260'.