mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-28 03:23:25 +08:00
temporary commit
This commit is contained in:
@@ -51,7 +51,7 @@ type SCloudprovider struct {
|
||||
|
||||
LastSync time.Time `get:"admin" list:"admin"` // = Column(DateTime, nullable=True)
|
||||
|
||||
// Version string `width:"32" charset:"ascii" nullable:"true" list:"admin"` // Column(VARCHAR(32, charset='ascii'), nullable=True)
|
||||
Version string `width:"32" charset:"ascii" nullable:"true" list:"admin"` // Column(VARCHAR(32, charset='ascii'), nullable=True)
|
||||
|
||||
Sysinfo jsonutils.JSONObject `get:"admin"` // Column(JSONEncodedDict, nullable=True)
|
||||
|
||||
@@ -138,6 +138,9 @@ func (self *SCloudprovider) getPassword() (string, error) {
|
||||
}
|
||||
|
||||
func (self *SCloudprovider) CanSync() bool {
|
||||
if ! self.Enabled {
|
||||
return false
|
||||
}
|
||||
if self.Status == CLOUD_PROVIDER_SYNCING {
|
||||
if self.LastSync.IsZero() || time.Now().Sub(self.LastSync) > 900*time.Second {
|
||||
return true
|
||||
@@ -215,7 +218,7 @@ func (self *SCloudprovider) PerformUpdateCredential(ctx context.Context, userCre
|
||||
}
|
||||
changed = true
|
||||
}
|
||||
if changed && self.CanSync() {
|
||||
if changed {
|
||||
self.SetStatus(userCred, CLOUD_PROVIDER_INIT, "Change credential")
|
||||
self.startSyncCloudProviderInfoTask(ctx, userCred, nil, "")
|
||||
}
|
||||
|
||||
@@ -834,7 +834,7 @@ func (manager *SNetworkManager) ValidateCreateData(ctx context.Context, userCred
|
||||
maskLen64 = int64(prefix.MaskLen)
|
||||
} else {
|
||||
ipStartStr, _ := data.GetString("guest_ip_start")
|
||||
ipEndStr, _ := data.GetString("guest_ip_start")
|
||||
ipEndStr, _ := data.GetString("guest_ip_end")
|
||||
startIp, err = netutils.NewIPV4Addr(ipStartStr)
|
||||
if err != nil {
|
||||
return nil, httperrors.NewInputParameterError("Invalid start ip: %s %s", ipStartStr, err)
|
||||
@@ -971,7 +971,7 @@ func (self *SNetwork) ValidateUpdateData(ctx context.Context, userCred mcclient.
|
||||
var err error
|
||||
|
||||
ipStartStr, _ := data.GetString("guest_ip_start")
|
||||
ipEndStr, _ := data.GetString("guest_ip_start")
|
||||
ipEndStr, _ := data.GetString("guest_ip_end")
|
||||
|
||||
if len(ipStartStr) > 0 || len(ipEndStr) > 0 {
|
||||
if self.isManaged() {
|
||||
|
||||
Reference in New Issue
Block a user