change chef linux provisioner to use user:group chown syntax

This commit is contained in:
Alice Sawatzky 2018-07-24 19:12:40 -05:00
parent a29403a96d
commit 15c65f981b
No known key found for this signature in database
GPG Key ID: 27ED9A652C46B0A2
2 changed files with 4 additions and 4 deletions

View File

@ -92,7 +92,7 @@ func (p *provisioner) linuxCreateConfigFiles(o terraform.UIOutput, comm communic
if err := p.runCommand(o, comm, fmt.Sprintf(chmod, hintsDir, 600)); err != nil {
return err
}
if err := p.runCommand(o, comm, "chown -R root.root "+hintsDir); err != nil {
if err := p.runCommand(o, comm, "chown -R root:root "+hintsDir); err != nil {
return err
}
}
@ -106,7 +106,7 @@ func (p *provisioner) linuxCreateConfigFiles(o terraform.UIOutput, comm communic
if err := p.runCommand(o, comm, fmt.Sprintf(chmod, linuxConfDir, 600)); err != nil {
return err
}
if err := p.runCommand(o, comm, "chown -R root.root "+linuxConfDir); err != nil {
if err := p.runCommand(o, comm, "chown -R root:root "+linuxConfDir); err != nil {
return err
}
}

View File

@ -193,10 +193,10 @@ func TestResourceProvider_linuxCreateConfigFiles(t *testing.T) {
"sudo " + fmt.Sprintf(chmod, path.Join(linuxConfDir, "ohai/hints"), 666): true,
"sudo chmod 755 " + path.Join(linuxConfDir, "ohai/hints"): true,
"sudo " + fmt.Sprintf(chmod, path.Join(linuxConfDir, "ohai/hints"), 600): true,
"sudo chown -R root.root " + path.Join(linuxConfDir, "ohai/hints"): true,
"sudo chown -R root:root " + path.Join(linuxConfDir, "ohai/hints"): true,
"sudo chmod 755 " + linuxConfDir: true,
"sudo " + fmt.Sprintf(chmod, linuxConfDir, 600): true,
"sudo chown -R root.root " + linuxConfDir: true,
"sudo chown -R root:root " + linuxConfDir: true,
},
Uploads: map[string]string{