Handle upper and lower case system uuids

We need to be able to handle when system uuids are upper or lower case
because newer versions of dmidecode have normalized to lower case. Users
who were on CentOS/RHEL 7.5 and older may have per-node customizations
with upper case which turn lowercase with an update to 7.6. This affects
hieradata customizations as well as os-net-config mapping files. This
change outputs both an upper and lowercase hieradata uuid file to handle
the both versions of the UUID. Additionally this change normalizes the
id comparison for os-net-config mappings to lower case.

Change-Id: I65f46056f8a908c60c99d1cee3738344a0bce6b7
Closes-Bug: #1816652
This commit is contained in:
Alex Schultz
2019-02-19 12:50:16 -07:00
parent 0c23792983
commit e2a8a494c5
2 changed files with 15 additions and 2 deletions

View File

@@ -105,9 +105,10 @@ resources:
if 'dmiString' in data[node] and 'id' in data[node]:
ps = Popen([ 'dmidecode',
'--string', data[node].get('dmiString') ],
stdout=PIPE)
stdout=PIPE, universal_newlines=True)
out, err = ps.communicate()
if data[node].get('id') == out.rstrip():
# See LP#1816652
if data[node].get('id').lower() == out.rstrip().lower():
write_mapping_file(lc_interface_mapping)
break
"