aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rumba/testbeds/jfed.py21
1 files changed, 8 insertions, 13 deletions
diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py
index 5fdde99..391ba10 100644
--- a/rumba/testbeds/jfed.py
+++ b/rumba/testbeds/jfed.py
@@ -264,16 +264,6 @@ class Testbed(mod.Testbed):
node_n.ssh_config.hostname = l_node.getAttribute("hostname")
- ssh_support.execute_command(
- self,
- node_n.ssh_config,
- "sudo locale-gen en_US.UTF-8 || true")
-
- ssh_support.execute_command(
- self,
- node_n.ssh_config,
- "sudo touch /var/lib/cloud/instance/locale-check.skip || true")
-
for intf in intfs:
aux_mac_address = intf.getAttribute("mac_address")
@@ -285,9 +275,14 @@ class Testbed(mod.Testbed):
mac = aux_mac_address
command = (
- 'echo "mac=\\"\$1\\"; cd / && ./sbin/ifconfig -a | '
- 'awk \'/^[a-z]/ { if ( \\"\'\\"\$mac\\"\'\\" == \$5 )'
- ' print \$1}\'" > mac2ifname.sh')
+ "echo '#!/usr/bin/env bash' > mac2ifname.sh; "
+ r"echo 'for i in $(ls /sys/class/net/); do "
+ r'addr="$(cat /sys/class/net/$i/address)"; '
+ r'if [[ "$addr" == "$1" ]]; then '
+ r'echo "$i"; '
+ r'fi; '
+ r"done' >> mac2ifname.sh"
+ )
ssh_support.execute_command(self, node_n.ssh_config, command)
ssh_support.execute_command(