fix: 允许更改私有云region名称

This commit is contained in:
ioito
2019-08-20 21:18:21 +08:00
parent d0906806e5
commit 0ad5ff991d
2 changed files with 2 additions and 3 deletions
+1 -2
View File
@@ -396,7 +396,6 @@ func (self *SCloudregion) syncWithCloudRegion(ctx context.Context, userCred mccl
}
diff, err := db.UpdateWithLock(ctx, self, func() error {
self.Name = cloudRegion.GetName()
self.Status = cloudRegion.GetStatus()
self.SGeographicInfo = cloudRegion.GetGeographicInfo()
self.Provider = cloudRegion.GetProvider()
@@ -684,7 +683,7 @@ func (self *SCloudregion) isManaged() bool {
}
func (self *SCloudregion) ValidateUpdateCondition(ctx context.Context) error {
if len(self.ExternalId) > 0 {
if len(self.ExternalId) > 0 && len(self.ManagerId) == 0 {
return httperrors.NewConflictError("Cannot update external resource")
}
return self.SEnabledStatusStandaloneResourceBase.ValidateUpdateCondition(ctx)
+1 -1
View File
@@ -65,7 +65,7 @@ func (region *SRegion) GetGlobalId() string {
}
func (region *SRegion) IsEmulated() bool {
return true
return false
}
func (region *SRegion) GetProvider() string {