elastic cache auth_mode status & password reset bugfix

This commit is contained in:
TangBin
2019-11-19 10:17:42 +08:00
parent e2819408fa
commit f1e68528b0
4 changed files with 8 additions and 4 deletions
+4
View File
@@ -401,6 +401,10 @@ func (self *SRegion) syncSecgroupRules(secgroupId string, rules []secrules.Secur
for _, r := range DeleteRules {
if err := self.delSecurityGroupRule(secgroupId, &r); err != nil {
if strings.Contains(err.Error(), "InvalidPermission.NotFound") {
continue
}
log.Errorf("delSecurityGroupRule %v error: %s", r, err.Error())
return err
}
@@ -72,7 +72,7 @@ func (self *SElasticcacheAccount) ResetPassword(input cloudprovider.SCloudElasti
params := jsonutils.NewDict()
params.Set("old_password", jsonutils.NewString(*input.OldPassword))
params.Set("new_password", jsonutils.NewString(input.NewPassword))
err := DoUpdateWithSpec(self.cacheDB.region.ecsClient.Elasticcache.UpdateInContextWithSpec, self.GetId(), "password", params)
err := DoUpdateWithSpec(self.cacheDB.region.ecsClient.Elasticcache.UpdateInContextWithSpec, self.cacheDB.GetId(), "password", params)
if err != nil {
return errors.Wrap(err, "elasticcacheAccount.ResetPassword")
}
@@ -681,9 +681,9 @@ func (self *SElasticcache) UpdateAuthMode(noPwdAccess bool) error {
func (self *SElasticcache) GetAuthMode() string {
switch self.NoPasswordAccess {
case "true":
return "on"
default:
return "off"
default:
return "on"
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ const (
DIGITS = "23456789"
LETTERS = "abcdefghjkmnpqrstuvwxyz"
UPPERS = "ABCDEFGHJKMNPRSTUVWXYZ"
PUNC = "@%^-+="
PUNC = "@^-+="
ALL_DIGITS = "0123456789"
ALL_LETTERS = "abcdefghijklmnopqrstuvwxyz"