summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-12-02 19:49:48 +0000
committerGerrit Code Review <review@openstack.org>2016-12-02 19:49:48 +0000
commita23ad11958ac23b042facedd4dde9281c4a353fd (patch)
tree1a709adf7f7bc6581ff357605448ab6cecbebfb1
parentf0348b0d7aed8985edc91b3ab9229891c598cfa5 (diff)
parent06d4d088adcceb6076017fb2a58b5a339232a6a3 (diff)
Merge "No longer hard coding to a specifc network interface name."
-rw-r--r--firstboot/os-net-config-mappings.yaml4
1 files changed, 2 insertions, 2 deletions
diff --git a/firstboot/os-net-config-mappings.yaml b/firstboot/os-net-config-mappings.yaml
index 833c3bc2..a513120d 100644
--- a/firstboot/os-net-config-mappings.yaml
+++ b/firstboot/os-net-config-mappings.yaml
@@ -38,7 +38,7 @@ resources:
str_replace:
template: |
#!/bin/sh
- eth_addr=$(/sbin/ifconfig eth0 | grep ether | awk '{print $2}')
+ eth_addr=$(cat /sys/class/net/*/address | tr '\n' ',')
mkdir -p /etc/os-net-config
# Create an os-net-config mapping file, note this defaults to
@@ -51,7 +51,7 @@ resources:
input = sys.stdin.readline() or '{}'
data = json.loads(input)
for node in data:
- if '${eth_addr}' in data[node].values():
+ if any(x in '$eth_addr'.split(',') for x in data[node].values()):
interface_mapping = {'interface_mapping': data[node]}
with open('/etc/os-net-config/mapping.yaml', 'w') as f:
yaml.safe_dump(interface_mapping, f, default_flow_style=False)