mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
region: guests: sshable: only check sshable state when in running state
This commit is contained in:
@@ -72,6 +72,10 @@ func (guest *SGuest) GetDetailsSshable(
|
||||
userCred mcclient.TokenCredential,
|
||||
query jsonutils.JSONObject,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
if guest.Status != compute_api.VM_RUNNING {
|
||||
return nil, httperrors.NewBadRequestError("server sshable state can only be checked when in running state")
|
||||
}
|
||||
|
||||
tryData := &GuestSshableTryData{
|
||||
User: "cloudroot",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user