Bug 1729026

Summary: [RHEL7.7] Redfish-finder reports an error if the string "Redfish Service Hostname" is empty
Product: Red Hat Enterprise Linux 7 Reporter: Adrian Huang <ahuang12>
Component: redfish-finderAssignee: John Shortt <jshortt>
Status: CLOSED ERRATA QA Contact: Rachel Sibley <rasibley>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.7CC: bhu, rvr, smeisner
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-29 19:58:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1713151, 1781947    

Description Adrian Huang 2019-07-11 08:45:26 UTC
Description of problem:
Redfish Host Interface Specification defines the field "Redfish
Service Hostname" as "Varies", which means it can be empty. Moreover,
this field is not mandatory for well-defined configuration (a valid
string).

The original design assumes that this field is non-empty string shown
as follows:

-------------------------------------------------------------------
        self.hostname = cursor.split()[0]
-------------------------------------------------------------------

This leads to the exception, and the "self.hostname" is not configured.
Here is the error output:

-------------------------------------------------------------------
redfish-finder: Getting dmidecode info
redfish-finder: Unexpected error parsing ServiceConfig
redfish-finder: Building NetworkManager connection info
redfish-finder: Obtaining OS config info
redfish-finder: Converting SMBIOS Host Config to NetworkManager Connection info
redfish-finder: Applying NetworkManager connection configuration changes
Error: 'enp6s0f3u2u3c2' is not an active connection.
Error: no active connection provided.
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/5)
redfish-finder: Adding redfish host info to OS config
Traceback (most recent call last):
  File "./redfish-finder", line 526, in <module>
    main()
  File "./redfish-finder", line 520, in main
    svc.update_redfish_info()
  File "./redfish-finder", line 349, in update_redfish_info
    if h.find(self.sconf.hostname) != -1:
AttributeError: ServiceConfig instance has no attribute 'hostname'
-------------------------------------------------------------------

Here is the dump info for SMBIOS type 42:
-----------------------------------------------------------
[root@localhost redfish-finder-master]# dmidecode -t 42
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.2.0 present.

Handle 0x002E, DMI type 42, 12 bytes
Management Controller Host Interface

Handle 0x006C, DMI type 42, 129 bytes
Management Controller Host Interface
        Host Interface Type: Network
        Device Type: USB
                idVendor: 0x046b
                idProduct: 0xffb0
                Protocol ID: 04 (Redfish over IP)
                        Service UUID: 3ce1a1c7-e776-8a04-0010-580d60c9773b
                        Host IP Assignment Type: Static
                        Host IP Address Format: IPv4
                        IPv4 Address: 169.254.0.18
                        IPv4 Mask: 255.255.240.0
                        Redfish Service IP Discovery Type: Static
                        Redfish Service IP Address Format: IPv4
                        IPv4 Redfish Service Address: 169.254.0.17
                        IPv4 Redfish Service Mask: 255.255.240.0
                        Redfish Service Port: 443
                        Redfish Service Vlan: 0
                        Redfish Service Hostname:
-----------------------------------------------------------

The field "Redfish Service Hostname" is empty.

There is a patch to fix the above-mentioned issue: https://github.com/AdrianHuang/redfish-finder/commit/373c481a89333f992951785988a17d5e23d1e5e5

If you're okay, I can create a pull request.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Run redfish-finder in command prompt
2.
3.

Actual results:
Fail -> AttributeError: ServiceConfig instance has no attribute 'hostname'

Expected results:
The utility can be run without any failure

Additional info:

Comment 2 Neil Horman 2019-07-11 19:13:35 UTC
did you mean to only open this for RHEL7?  I would have though there would be another bz for RHEL8 somewhere.  I can clone it if you didn't do that

Comment 3 Adrian Huang 2019-07-12 01:58:04 UTC
(In reply to Neil Horman from comment #2)
> did you mean to only open this for RHEL7?  I would have though there would
> be another bz for RHEL8 somewhere.  I can clone it if you didn't do that

Ah, we need another bz for RHEL8. I'll do that.

Comment 4 Neil Horman 2019-07-17 15:37:51 UTC
Ok, it looks like this is the result of being run on a system that has no redfish bmc support at all.  I can fix this, but just so that you are aware, the fix will result in redfish-finder exiting indicating that the system has no redfish capabilities.

Comment 5 Neil Horman 2019-07-17 15:39:18 UTC
sorry, scratch that last update, meant for a different bz

Comment 6 Neil Horman 2019-07-30 17:15:37 UTC
comitted for rhel-7.8, waiting on errata tool to open for 7.8 filing

Comment 8 Neil Horman 2019-09-04 12:27:53 UTC
sorry for the late reply here steve, the work on this bug has been done and comitted for some time, but it appears that redfish-finder isn't on the ACL for 7.8, so this will likely need to get bumped to 7.9, or closed wontfix.

Comment 10 Beth Uptagrafft 2020-01-13 20:05:28 UTC
setting back to assigned for further review

Comment 16 errata-xmlrpc 2020-09-29 19:58:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (redfish-finder bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3935