diff options
author | Zhou Hao <zhouhao@fujitsu.com> | 2021-11-09 15:42:07 +0800 |
---|---|---|
committer | Zhou Hao <zhouhao@fujitsu.com> | 2021-11-10 14:51:57 +0800 |
commit | fc24275ba328f2a83e40c7bafadaa12d89c9c6e1 (patch) | |
tree | d977e57fce2304b3b39eeab63a54e53b3c0e88b0 /ironic/drivers/modules/irmc/common.py | |
parent | b1d08ae80542b6b3aa9fab99cdc64b449d113115 (diff) | |
download | ironic-fc24275ba328f2a83e40c7bafadaa12d89c9c6e1.tar.gz |
[iRMC] Convert the type of irmc_port to int
When using the node managed by the `irmc` hardware type,
if the port number of the bmc address is manually specified,
the following error will occur:
```
Value '443' is not supported for 'irmc_port'
```
However iRMC supports 80 and 443 ports, and default to 443.
The reason for this error is that the type of irmc_port is not converted to int.
Story: #2009671
Task: #43915
Signed-off-by: Zhou Hao <zhouhao@fujitsu.com>
Change-Id: I4e9274de09758fdb468382a7f88298a279f43e92
Diffstat (limited to 'ironic/drivers/modules/irmc/common.py')
-rw-r--r-- | ironic/drivers/modules/irmc/common.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ironic/drivers/modules/irmc/common.py b/ironic/drivers/modules/irmc/common.py index 0027bab97..24adf0da8 100644 --- a/ironic/drivers/modules/irmc/common.py +++ b/ironic/drivers/modules/irmc/common.py @@ -20,6 +20,7 @@ from oslo_utils import importutils from ironic.common import exception from ironic.common.i18n import _ +from ironic.common import utils from ironic.conf import CONF scci = importutils.try_import('scciclient.irmc.scci') @@ -84,6 +85,8 @@ def parse_driver_info(node): opt = {param: info.get(param, CONF.irmc.get(param[len('irmc_'):])) for param in OPTIONAL_PROPERTIES} d_info = dict(req, **opt) + d_info['irmc_port'] = utils.validate_network_port( + d_info['irmc_port'], 'irmc_port') error_msgs = [] if (d_info['irmc_auth_method'].lower() not in ('basic', 'digest')): |