Merge pull request #860 from ioito/hotfix/qx-inject-password-by-cloud-init

Hotfix/qx inject password by cloud init
This commit is contained in:
yunion-ci-robot
2019-05-21 18:51:18 +08:00
committed by GitHub
9 changed files with 104 additions and 32 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ type SWriteFile struct {
type SUser struct {
Name string
Passwd string
LockPassword string
LockPasswd string
SshAuthorizedKeys []string
Sudo string
}
@@ -162,7 +162,7 @@ func (u *SUser) Password(passwd string) *SUser {
} else {
u.Passwd = hash
}
u.LockPassword = "false"
u.LockPasswd = "false"
}
return u
}
@@ -281,7 +281,7 @@ func (conf *SCloudConfig) MergeUser(u SUser) {
// replace conf user password with input
if len(u.Passwd) > 0 {
conf.Users[i].Passwd = u.Passwd
conf.Users[i].LockPassword = u.LockPassword
conf.Users[i].LockPasswd = u.LockPasswd
}
// find user, merge keys