- # We're using this "| sudo tee" construct because redirecting
- # a sudo's output ("sudo echo xxx > /path/to/file") does not
- # work on most platforms...
- (ret, _, _) = \
- ssh.exec_command_lxc('echo "{0}" | sudo tee {1}'.
- format(self._vpp_config,
- self._vpp_config_filename), lxc_name)
-
- if ret != 0:
- raise RuntimeError('Writing config file failed in {0} to node {1}'.
- format(lxc_name, self._hostname))
-
- # Instead of restarting, we'll do separate start and stop
- # actions. This way we don't care whether VPP was running
- # to begin with.
- ssh.exec_command_lxc('service {0} stop'.
- format(self._vpp_service_name), lxc_name)
- (ret, _, _) = \
- ssh.exec_command_lxc('service {0} start'.
- format(self._vpp_service_name), lxc_name)
+ (ret, _, _) = ssh.exec_command('sudo cp {0} {1}'.
+ format(self._vpp_startup_conf_backup,
+ self._vpp_startup_conf))