Bug 1264580

Summary: calculate_mac returns incorrect MAC address on system with more network interfaces
Product: Red Hat Satellite 5 Reporter: Jan Hutař <jhutar>
Component: MonitoringAssignee: Grant Gainey <ggainey>
Status: CLOSED WONTFIX QA Contact: Red Hat Satellite QA List <satellite-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 570CC: dyordano, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-28 18:20:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jan Hutař 2015-09-18 21:36:09 UTC
Description of problem:
Function calculate_mac probably (I'm not completely sure, please feel free to close this bug if it behaves as expected) returns incorrect MAC address on system with more network interfaces. File with that function is:


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

How reproducible:

Steps to Reproduce:
1. Have system with multiple network interfaces, with only first of them active:
2. Add this debug output to the function:

sub calculate_mac
    my $self = shift;

    my $mac = `/sbin/ip -o link`;
    $mac =~ s/.*\bUP\b.*ether (\S*).*/$1/s;
    my @nodes = split(/:/, $mac);
    $mac = sprintf("%02X:%02X:%02X:%02X:%02X:%02X",
                   hex($nodes[0]), hex($nodes[1]), hex($nodes[2]),
                   hex($nodes[3]), hex($nodes[4]), hex($nodes[5]));

    print ">>>>>>>>>> calculate_mac: $mac <<<<<<<<<<";

Actual results:
It was returning 2C:44:FD:84:51:C7 for me.

Expected results:
IMO it should return 2C:44:FD:84:51:C4

Additional info:
Found this when I have seen bug 1170064 again.

Comment 2 Grant Gainey 2017-04-28 18:20:50 UTC
Monitoring has a number of issues, and is being removed in the upcoming SATELLITE-5.8 release. Closing, WONTFIX