fix(region): azure disk status

This commit is contained in:
ioito
2022-05-25 11:43:38 +08:00
parent ef4a321a1f
commit 398c7e2b0c
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -172,6 +172,10 @@ func (self *SDisk) GetTags() (map[string]string, error) {
}
func (self *SDisk) GetStatus() string {
// 为了不统计这种磁盘挂载率, 单独设置一个状态
if self.Properties.DiskState == "ActiveSAS" {
return self.Properties.DiskState
}
status := self.Properties.ProvisioningState
switch status {
case "Updating":
+1 -1
View File
@@ -185,7 +185,7 @@ func (self *SEipAddress) GetAssociationType() string {
return ""
}
if info := strings.Split(self.Properties.IPConfiguration.ID, "/"); len(info) > 7 {
resType := strings.ToLower(info[6])
resType := strings.ToLower(info[7])
if utils.IsInStringArray(resType, []string{"networkinterfaces"}) {
return api.EIP_ASSOCIATE_TYPE_SERVER
}