Merge pull request #15061 from cfergeau/always-true
machine: Fix check which is always true
This commit is contained in:
commit
a298909dec
|
@ -670,11 +670,11 @@ func (v *MachineVM) Start(name string, _ machine.StartOptions) error {
|
||||||
// because / is immutable, we have to monkey around with permissions
|
// because / is immutable, we have to monkey around with permissions
|
||||||
// if we dont mount in /home or /mnt
|
// if we dont mount in /home or /mnt
|
||||||
args := []string{"-q", "--"}
|
args := []string{"-q", "--"}
|
||||||
if !strings.HasPrefix(mount.Target, "/home") || !strings.HasPrefix(mount.Target, "/mnt") {
|
if !strings.HasPrefix(mount.Target, "/home") && !strings.HasPrefix(mount.Target, "/mnt") {
|
||||||
args = append(args, "sudo", "chattr", "-i", "/", ";")
|
args = append(args, "sudo", "chattr", "-i", "/", ";")
|
||||||
}
|
}
|
||||||
args = append(args, "sudo", "mkdir", "-p", mount.Target)
|
args = append(args, "sudo", "mkdir", "-p", mount.Target)
|
||||||
if !strings.HasPrefix(mount.Target, "/home") || !strings.HasPrefix(mount.Target, "/mnt") {
|
if !strings.HasPrefix(mount.Target, "/home") && !strings.HasPrefix(mount.Target, "/mnt") {
|
||||||
args = append(args, ";", "sudo", "chattr", "+i", "/", ";")
|
args = append(args, ";", "sudo", "chattr", "+i", "/", ";")
|
||||||
}
|
}
|
||||||
err = v.SSH(name, machine.SSHOptions{Args: args})
|
err = v.SSH(name, machine.SSHOptions{Args: args})
|
||||||
|
|
Loading…
Reference in New Issue