summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorThomas Mangin <thomas.mangin@exa.net.uk>2020-03-23 22:47:19 +0000
committerThomas Mangin <thomas.mangin@exa.net.uk>2020-03-23 23:04:18 +0000
commit8f39784c847801c0b766a0c9289da0976ffd0604 (patch)
treef99c84bbf2a78aa3e9278f276a18336cad047520 /python
parent71561a27a0338cba7c54ea8ae9bf14b75006ddbd (diff)
downloadvyos-1x-8f39784c847801c0b766a0c9289da0976ffd0604.tar.gz
vyos-1x-8f39784c847801c0b766a0c9289da0976ffd0604.zip
ifconfig: T2154: fixing failure to start-stop-daemon
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/ethernet.py2
-rw-r--r--python/vyos/ifconfig/interface.py20
2 files changed, 16 insertions, 6 deletions
diff --git a/python/vyos/ifconfig/ethernet.py b/python/vyos/ifconfig/ethernet.py
index 8b6b6d9db..30e3a3bef 100644
--- a/python/vyos/ifconfig/ethernet.py
+++ b/python/vyos/ifconfig/ethernet.py
@@ -120,7 +120,7 @@ class EthernetIf(VLANIf):
try:
# An exception will be thrown if the settings are not changed
return self._cmd(cmd)
- except CalledProcessError:
+ except RuntimeError:
pass
def set_speed_duplex(self, speed, duplex):
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 18256cf99..4f72271c9 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -680,8 +680,11 @@ class Interface(Control):
with open(self._dhcp_cfg_file, 'w') as f:
f.write(dhcp_text)
- cmd = 'start-stop-daemon --start --quiet --pidfile ' + \
- self._dhcp_pid_file
+ cmd = 'start-stop-daemon'
+ cmd += ' --start '
+ cmd += ' --quiet'
+ cmd += ' --oknodo'
+ cmd += ' --pidfile ' + self._dhcp_pid_file
cmd += ' --exec /sbin/dhclient --'
# now pass arguments to dhclient binary
cmd += ' -4 -nw -cf {} -pf {} -lf {} {}'.format(
@@ -765,8 +768,11 @@ class Interface(Control):
.format(self.config['ifname']), 0)
# assemble command-line to start DHCPv6 client (dhclient)
- cmd = 'start-stop-daemon --start --quiet --pidfile ' + \
- self._dhcpv6_pid_file
+ cmd = 'start-stop-daemon'
+ cmd += ' --start '
+ cmd += ' --quiet'
+ cmd += ' --oknodo'
+ cmd += ' --pidfile ' + self._dhcpv6_pid_file
cmd += ' --exec /sbin/dhclient --'
# now pass arguments to dhclient binary
cmd += ' -6 -nw -cf {} -pf {} -lf {}'.format(
@@ -802,7 +808,11 @@ class Interface(Control):
return None
# stop dhclient
- cmd = 'start-stop-daemon --stop --quiet --pidfile {}'.format(self._dhcpv6_pid_file)
+ cmd = 'start-stop-daemon'
+ cmd += ' --stop'
+ cmd += ' --oknodo'
+ cmd += ' --quiet'
+ cmd += ' --pidfile ' + self._dhcpv6_pid_file
self._cmd(cmd)
# accept router announcements on this interface