fix capital letters in MAC address
Prod-Related: PROD-26440
Change-Id: I46237acbbd15739baf86cb6749f7dcb8d70007df
(cherry picked from commit b844b07eeaf9e3f096e8ed634e48482674c43f78)
diff --git a/_modules/maas.py b/_modules/maas.py
index 3c6fce9..0152eba 100644
--- a/_modules/maas.py
+++ b/_modules/maas.py
@@ -548,10 +548,10 @@
def _get_nic_id_by_mac(self, machine, req_mac=None):
data = {}
for nic in machine['interface_set']:
- data[nic['mac_address']] = nic['id']
+ data[nic['mac_address'].lower()] = nic['id']
if req_mac:
- if req_mac in data.keys():
- return data[req_mac]
+ if req_mac.lower() in data.keys():
+ return data[req_mac.lower()]
else:
raise Exception('NIC with mac:{} not found at '
'node:{}'.format(req_mac, machine['fqdn']))