mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
ctyun get vm by id fix
This commit is contained in:
@@ -265,6 +265,10 @@ func (self *SRegion) GetVMs() ([]SInstance, error) {
|
||||
}
|
||||
|
||||
func (self *SRegion) GetVMById(vmId string) (*SInstance, error) {
|
||||
if len(vmId) == 0 {
|
||||
return nil, errors.Wrap(cloudprovider.ErrNotFound, "SRegion.GetVMById.EmptyVmID")
|
||||
}
|
||||
|
||||
vms, err := self.getVMs(vmId)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "SRegion.GetVMById")
|
||||
|
||||
Reference in New Issue
Block a user