Skip to content

Commit

Permalink
Merge #465
Browse files Browse the repository at this point in the history
465: shell to machine in delayed-shutdown state r=saviq a=pekof

Fix bug #461 
ssh_info returns connection data if machine is still running

Co-authored-by: pekof <[email protected]>
  • Loading branch information
bors[bot] and pekof committed Oct 30, 2018
2 parents 6e0f992 + b88cff6 commit 90a7057
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/multipass/virtual_machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class VirtualMachine
virtual void wait_until_ssh_up(std::chrono::milliseconds timeout) = 0;
virtual void wait_for_cloud_init(std::chrono::milliseconds timeout) = 0;
virtual void update_state() = 0;
virtual bool is_running() { return current_state() == State::running || current_state() == State::delayed_shutdown; }

VirtualMachine::State state;
const SSHKeyProvider& key_provider;
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ try // clang-format on
"");
}

if (it->second->current_state() != mp::VirtualMachine::State::running)
if (!it->second->is_running())
{
return grpc::Status(grpc::StatusCode::FAILED_PRECONDITION,
fmt::format("instance \"{}\" is not running", name), "");
Expand Down

0 comments on commit 90a7057

Please sign in to comment.