conf: Covert StrOpt -> PortOpt

...resolving the TODO in the process.

Change-Id: I076483c4a3aff369c0ba2e87abd91acafcd9f677
This commit is contained in:
Stephen Finucane 2016-11-07 12:03:36 +00:00
parent 8d0c195e00
commit c5a76f97e6
2 changed files with 4 additions and 8 deletions

View File

@ -425,9 +425,8 @@ Possible values:
* Any string that represents hostname/ip of Target.
"""),
# TODO(aunnam): This should be PortOpt
cfg.StrOpt('target_port',
default='3260',
cfg.PortOpt('target_port',
default=3260,
help="""
The iSCSI Target Port.

View File

@ -81,11 +81,8 @@ class ISCSIParametersTestCase(stubs.XenAPITestBaseNoDB):
self.assertIsNone(volume_utils._get_target_host(None))
def test_target_port(self):
self.assertEqual(volume_utils._get_target_port('host:port'),
'port')
self.assertEqual(volume_utils._get_target_port('host'),
'3260')
self.assertEqual(volume_utils._get_target_port('host:port'), 'port')
self.assertEqual(volume_utils._get_target_port('host'), 3260)
class IntroduceTestCase(stubs.XenAPITestBaseNoDB):