Don't send exception when already stopped container can't be stopped again
This commit is contained in:
parent
d11a281d6c
commit
7e80f282a0
1 changed files with 1 additions and 2 deletions
|
|
@ -201,8 +201,7 @@ void LxcContainer::start(const Configuration &configuration) {
|
||||||
|
|
||||||
void LxcContainer::stop() {
|
void LxcContainer::stop() {
|
||||||
if (not container_ || not container_->is_running(container_))
|
if (not container_ || not container_->is_running(container_))
|
||||||
BOOST_THROW_EXCEPTION(
|
return;
|
||||||
std::runtime_error("Cannot stop container as it is not running"));
|
|
||||||
|
|
||||||
if (not container_->stop(container_))
|
if (not container_->stop(container_))
|
||||||
BOOST_THROW_EXCEPTION(std::runtime_error("Failed to stop container"));
|
BOOST_THROW_EXCEPTION(std::runtime_error("Failed to stop container"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue