diff --git a/firstboot/os-net-config-mappings.yaml b/firstboot/os-net-config-mappings.yaml index 7cab34687e..3cb4f2a8ec 100644 --- a/firstboot/os-net-config-mappings.yaml +++ b/firstboot/os-net-config-mappings.yaml @@ -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 " diff --git a/puppet/extraconfig/pre_deploy/per_node.yaml b/puppet/extraconfig/pre_deploy/per_node.yaml index 5e79748108..3cc046c822 100644 --- a/puppet/extraconfig/pre_deploy/per_node.yaml +++ b/puppet/extraconfig/pre_deploy/per_node.yaml @@ -32,6 +32,10 @@ resources: node_id=$(dmidecode --s system-uuid | awk 'match($0, \ /[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}/) \ { print substr($0, RSTART, RLENGTH) }' | tr '[:upper:]' '[:lower:]') + # thanks to dmidecode 3.1, we have to handle both the upper case + # and lower case versions of the UUID from dmidecode. LP#1816652 + # upper for dmidecode < 3.1 and lower for dmidecode >= 3.1 + node_id_upper=$(echo $node_id | tr '[:lower:]' '[:upper:]') # needed to handle where python lives function get_python() { @@ -47,6 +51,14 @@ resources: cnt = json.loads(input) print json.dumps(cnt.get('${node_id}', {})) " > /etc/puppet/hieradata/${node_id}.json + # handle upper case node id LP#1816652 + echo $node_lookup | $(get_python) -c " + import json + import sys + input = sys.stdin.readline() or '{}' + cnt = json.loads(input) + print json.dumps(cnt.get('${node_id_upper}', {})) + " > /etc/puppet/hieradata/${node_id_upper}.json NodeSpecificDeployment: type: OS::Heat::SoftwareDeployment