summaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-05-18 18:57:52 +0200
committerChristian Poessinger <christian@poessinger.com>2021-05-18 18:57:52 +0200
commitfa05e4267c17d93c4e9594a0ba32e66c7b2a1d61 (patch)
tree6440ea0d6142a536990912158dc307e8f9db4fb8 /src/etc
parent7de7a1b2d127df85d4224162116c1d4c984b022b (diff)
downloadvyos-1x-fa05e4267c17d93c4e9594a0ba32e66c7b2a1d61.tar.gz
vyos-1x-fa05e4267c17d93c4e9594a0ba32e66c7b2a1d61.zip
vmware: T3525: fix invocation of resume script
Commit dce67433 ("util: T2226: rewrite resume-vm to use run") changed the way in which the script executed system binaries in a way which could not be processes by the underlayin infrastructure (lists are not supported, only strings).
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py b/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py
index 111da5601..ec33906ba 100755
--- a/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py
+++ b/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py
@@ -26,15 +26,14 @@ def get_config():
interfaces = dict()
for intf in c.list_effective_nodes('interfaces ethernet'):
# skip interfaces that are disabled or is configured for dhcp
- check_disable = "interfaces ethernet {} disable".format(intf)
- check_dhcp = "interfaces ethernet {} address dhcp".format(intf)
+ check_disable = f'interfaces ethernet {intf} disable'
+ check_dhcp = f'interfaces ethernet {intf} address dhcp'
if c.exists_effective(check_disable):
continue
# get addresses configured on the interface
intf_addresses = c.return_effective_values(
- "interfaces ethernet {} address".format(intf)
- )
+ f'interfaces ethernet {intf} address')
interfaces[intf] = [addr.strip("'") for addr in intf_addresses]
return interfaces
@@ -44,16 +43,16 @@ def apply(config):
for intf, addresses in config.items():
# bring the interface up
- cmd = ["ip", "link", "set", "dev", intf, "up"]
+ cmd = f'ip link set dev {intf} up'
syslog.syslog(cmd)
run(cmd)
# add configured addresses to interface
for addr in addresses:
- if addr == "dhcp":
- cmd = ["dhclient", intf]
+ if addr == 'dhcp':
+ cmd = ['dhclient', intf]
else:
- cmd = ["ip", "address", "add", addr, "dev", intf]
+ cmd = f'ip address add {addr} dev {intf}'
syslog.syslog(cmd)
run(cmd)