Merge pull request #651 in YUNIONIO/onecloud from release/2.3.0 to release/2.4.0

* commit '818c2af8c7ff09b193f8bec30b527df312102cc3':
  避免id为空时返回其他机器
  aws security group add tags
  aws security group fix
This commit is contained in:
邱剑
2018-12-04 17:52:56 +08:00
+3
View File
@@ -243,6 +243,9 @@ func (self *SHost) GetIStorages() ([]cloudprovider.ICloudStorage, error) {
}
func (self *SHost) GetIVMById(gid string) (cloudprovider.ICloudVM, error) {
if len(gid) == 0 {
return nil, cloudprovider.ErrNotFound
}
parts, _, err := self.zone.region.GetInstances(self.zone.Zone, []string{gid}, 0, 1)
if err != nil {
return nil, err