summaryrefslogtreecommitdiffstats
path: root/deploy/adapters
diff options
context:
space:
mode:
authorQiLiang <liangqi1@huawei.com>2017-03-16 10:07:45 +0800
committerQiLiang <liangqi1@huawei.com>2017-03-16 10:31:47 +0800
commit532b1906b0644d836cb5f54f32a888ada35a89fb (patch)
tree20939a70e5f89680338abc3ea4139bceffdbac7a /deploy/adapters
parente1bcc84781b51e8078387d071c24eeead2700cb9 (diff)
Fix preseed MAC address fetch method
JIRA: - e.g.: root@host1:~# ip link show eth4 6: eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether ec:38:8f:79:fa:5c brd ff:ff:ff:ff:ff:ff root@host1:~# echo $(echo $@ | cut -d' ' -f17) ec:38:8f:79:fa:5c root@host4:~# ip link show eth4 6: eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop portid 0100000000000000000000000000003000 state DOWN mode DEFAULT group default qlen 1000 link/ether e0:36:76:d2:34:73 brd ff:ff:ff:ff:ff:ff root@host4:~# echo $(echo $@ | cut -d' ' -f17) 1000 root@host4:~# echo $(echo $@ | cut -d' ' -f19) e0:36:76:d2:34:73 Change-Id: I916c19807da724e9ba471376f81f3c763b9340d5 Signed-off-by: QiLiang <liangqi1@huawei.com>
Diffstat (limited to 'deploy/adapters')
-rw-r--r--deploy/adapters/cobbler/snippets/preseed_post_install_network_config9
1 files changed, 1 insertions, 8 deletions
diff --git a/deploy/adapters/cobbler/snippets/preseed_post_install_network_config b/deploy/adapters/cobbler/snippets/preseed_post_install_network_config
index cb79c556..a2abbf71 100644
--- a/deploy/adapters/cobbler/snippets/preseed_post_install_network_config
+++ b/deploy/adapters/cobbler/snippets/preseed_post_install_network_config
@@ -50,14 +50,7 @@ echo "physical interfaces: \${physical_interfaces}" >> /tmp/network_log
# map physical interface to mac address
mac_names=""
for physical_interface in \${physical_interfaces}; do
- set \$(ip link show \${physical_interface})
-#if $osversion == "trusty"
- mac=\$(echo \$@ | cut -d' ' -f17)
-#elif $osversion == "xenial"
- mac=\$(echo \$@ | cut -d' ' -f17)
-#else
- mac=\$(echo \$@ | cut -d' ' -f13)
-#end if
+ mac=\$(ip link show \${physical_interface} | awk 'match(\$0,/link\/ether/) {print \$2}')
mac_name=\$(echo \${mac} |tr 'a-z' 'A-Z' | tr ':' '_')
if [ -z "\${mac_name}" ]; then
mac_names="\${mac_name}"