Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong MAC addresses returned for NICs #64

Open
friggob opened this issue Jun 21, 2018 · 1 comment
Open

Wrong MAC addresses returned for NICs #64

friggob opened this issue Jun 21, 2018 · 1 comment

Comments

@friggob
Copy link

friggob commented Jun 21, 2018

When you use the redfish plug-in to get NIC information you only get the network Cards Physical MAC address, not the Virtual MAC address, ie. the one it is using right now. By using the following patch you can get both.
-Edit:
Seems like some systems (at least some Poweredge M630) presents the virtual MAC address with different spelling. So the following patch seems to work better:

diff --git a/utils/redfish_utils.py b/utils/redfish_utils.py
index 67f5490..a39eeb9 100644
--- a/utils/redfish_utils.py
+++ b/utils/redfish_utils.py
@@ -843,7 +843,11 @@ class RedfishUtils(object):
                 nic['IPv6'] = d[u'Address']
             for d in data[u'NameServers']:
                 nic['NameServers'] = d
-            nic['MACAddress'] = data[u'PermanentMACAddress']
+            nic['PermanentMACAddress'] = data[u'PermanentMACAddress']
+            try:
+                nic['MACAddress'] = data[u'MacAddress']
+            except:
+                nic['MACAddress'] = data[u'MACAddress']
             nic['SpeedMbps'] = data[u'SpeedMbps']
             nic['MTU'] = data[u'MTUSize']
             nic['AutoNeg'] = data[u'AutoNeg']

@jose-delarosa
Copy link
Contributor

@friggob, thank you for your contribution. I will take a look. I know this is a simple patch should be able to test in no time, but I'm a little backed up on other items so please give me a little time. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants