diff options
-rw-r--r-- | rumba/ssh_support.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py index 3103811..2bc761b 100644 --- a/rumba/ssh_support.py +++ b/rumba/ssh_support.py @@ -324,14 +324,10 @@ def setup_vlans(testbed, node, vlans): return s else: def sudo(s): - return 'sudo ' + s + return "sudo sh -c '" + s + "'" - cmds = ["if [ -d /etc/udev/rules.d ] && " - "[ \"$(ls -A /etc/udev/rules.d)\" ]; " - "then sudo rm /etc/udev/rules.d/*; " - "type systemctl > /dev/null 2>&1; " - "if [ $? -eq 0 ]; then sudo systemctl " - "restart systemd-networkd; fi; fi"] + cmds = [sudo("for file in $(ls -d /etc/udev/rules.d/*); do rm $file; " + + "ln -s /dev/null $file; done")] for item in vlans: args = {'ifname': str(item[0]), 'vlan': str(item[1])} |