Fix yum update --changelog stalled when non-root ssh user on CentOS #150

This commit is contained in:
kota kanbe
2016-08-18 16:20:01 +09:00
parent 8b264a564a
commit 1e33536205
2 changed files with 2 additions and 4 deletions

View File

@@ -299,6 +299,7 @@ func getSSHLogger(log ...*logrus.Entry) *logrus.Entry {
func decolateCmd(c conf.ServerInfo, cmd string, sudo bool) string {
if sudo && c.User != "root" && !c.IsContainer() {
cmd = fmt.Sprintf("sudo -S %s", cmd)
cmd = strings.Replace(cmd, "|", "| sudo ", -1)
}
if c.Family != "FreeBSD" {