Don't send exception when already stopped container can't be stopped again

This commit is contained in:
Simon Fels 2017-01-03 09:13:06 +01:00
commit 7e80f282a0

View file

@ -201,8 +201,7 @@ void LxcContainer::start(const Configuration &configuration) {
void LxcContainer::stop() {
if (not container_ || not container_->is_running(container_))
BOOST_THROW_EXCEPTION(
std::runtime_error("Cannot stop container as it is not running"));
return;
if (not container_->stop(container_))
BOOST_THROW_EXCEPTION(std::runtime_error("Failed to stop container"));