mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
Merge pull request #1302 in YUNIONIO/onecloud from ~WANYAOQI/onecloud:bugfix/wyq/minor-fix-0321 to release/2.6.0
* commit 'a004e163a4edc7ad92787657818ed956d8427f63': fix deploy file
This commit is contained in:
@@ -4,7 +4,7 @@ import "net"
|
||||
|
||||
type SSHConfig struct {
|
||||
Username string `json:"username,omitempty"`
|
||||
RemoteIP string `json:"ip"`
|
||||
RemoteIP string `json:"remote_ip"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
|
||||
@@ -32,19 +32,22 @@ func (d *sGuestRootFsDriver) DeployFiles(deploys []jsonutils.JSONObject) error {
|
||||
}
|
||||
sPath, err := deploy.GetString("path")
|
||||
if err != nil {
|
||||
log.Errorln(err)
|
||||
return err
|
||||
}
|
||||
dirname := filepath.Dir(sPath)
|
||||
if !d.GetPartition().Exists(sPath, caseInsensitive) {
|
||||
if !d.GetPartition().Exists(dirname, caseInsensitive) {
|
||||
modeRWXOwner := syscall.S_IRUSR | syscall.S_IWUSR | syscall.S_IXUSR
|
||||
err := d.GetPartition().Mkdir(dirname, modeRWXOwner, caseInsensitive)
|
||||
if err != nil {
|
||||
log.Errorln(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
if content, err := deploy.GetString("content"); err != nil {
|
||||
if content, err := deploy.GetString("content"); err == nil {
|
||||
err := d.GetPartition().FilePutContents(sPath, content, modAppend, caseInsensitive)
|
||||
if err != nil {
|
||||
log.Errorln(err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ func (p *SKVMGuestDiskPartition) Mount() bool {
|
||||
|
||||
func (p *SKVMGuestDiskPartition) mount(readonly bool) error {
|
||||
if _, err := procutils.NewCommand("mkdir", "-p", p.mountPath).Run(); err != nil {
|
||||
log.Errorln(err)
|
||||
return err
|
||||
}
|
||||
var cmds = []string{"mount", "-t"}
|
||||
|
||||
@@ -28,6 +28,9 @@ func (f *SLocalGuestFS) SupportSerialPorts() bool {
|
||||
}
|
||||
|
||||
func (f *SLocalGuestFS) GetLocalPath(sPath string, caseInsensitive bool) string {
|
||||
if sPath == "." {
|
||||
sPath = ""
|
||||
}
|
||||
var fullPath = f.mountPath
|
||||
pathSegs := strings.Split(sPath, "/")
|
||||
for _, seg := range pathSegs {
|
||||
|
||||
Reference in New Issue
Block a user