Merge pull request #850 from Zexi/hotfix/sshpart-path-exists

fix: SSHPartition test symbolic file exists fail
This commit is contained in:
yunion-ci-robot
2019-05-18 19:45:17 +08:00
committed by GitHub
+2 -1
View File
@@ -106,7 +106,8 @@ func (p *SSHPartition) osRmDir(path string) error {
}
func (p *SSHPartition) osPathExists(path string) bool {
_, err := p.term.Run(fmt.Sprintf("test -e %s", path))
// test file or symbolic link exists
_, err := p.term.Run(fmt.Sprintf("test -e %s || test -L %s", path, path))
if err != nil {
return false
}