Skip to content

Fixes #38973 - SSH API of BMC now resolves FQDN to IP#933

Open
sakasusu0919 wants to merge 1 commit intotheforeman:developfrom
sakasusu0919:fix_38973
Open

Fixes #38973 - SSH API of BMC now resolves FQDN to IP#933
sakasusu0919 wants to merge 1 commit intotheforeman:developfrom
sakasusu0919:fix_38973

Conversation

@sakasusu0919
Copy link

Description:
This PR is a prerequisite for Foreman PR #10842 which fixes #38972. Applying #10842 without this accompanying PR will lead to issue #38973. Therefore, both PRs must be applied simultaneously.
Bug #38973 is caused by the following:

When Foreman specified an FQDN in the :host parameter for the Smart Proxy's BMC API, the smart-proxy's SSH API of BMC returned the FQDN itself directly to Foreman during IP address acquisition.
This resulted in a bug where the FQDN was displayed in the "IP" field within the Foreman UI.

This PR fixes this item.

Modifications in this PR
Fixed an issue where IP addresses could not be obtained when using SSH API of BMC if an FQDN was specified for the :host parameter in the BMC API.
When Foreman uses Fixed an issue where IP addresses could not be obtained when using SSH API of BMC if an FQDN was specified for the :host parameter in the BMC API.
To obtain an IP address, the ip() method in modules/bmc/ssh.rb, executed by smart-proxy, was implemented to directly return the :host specified in the BMC API's :host parameter to Foreman.
This has been corrected. Now, :host is returned directly to Foreman only if it is an IP address. Otherwise, :host is treated as an FQDN, resolved to an IP address, and then returned to Foreman.

Verification Contents:
After configuring the FQDN and SSH in the BMC interface settings via the Foreman Web UI, I verified that the IP address was displayed in the IP field by accessing the BMC tab in the Host Details (Legacy UI).

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick read this looks correct.

Previously, Smart Proxy's ip() method for SSH API of BMC directly
returned the :host parameter to Foreman. Now, if :host is an FQDN,
it is resolved to an IP address before being returned. If :host
is already an IP, it's returned directly.

Co-Authored-By: Yusuke Hirota <hirota.yusuke@fujitsu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments