diff options
author | Tim Smith <tsmith@chef.io> | 2018-09-25 16:33:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-25 16:33:25 -0700 |
commit | ac8e1ca09aef5439f1163afa942b3adc30934816 (patch) | |
tree | 26c0a2d19c15004ccdce43596e5c8d619fce7389 | |
parent | 10b9f9ee5ff0bab3da4d7cf56fa87f1352581868 (diff) | |
parent | 5e3639a0f8a857add7a33dee7e08fc4a9bbd1a73 (diff) | |
download | chef-ac8e1ca09aef5439f1163afa942b3adc30934816.tar.gz |
Merge pull request #7683 from chef/profiles
osx_profile: Use the full path to /usr/bin/profiles
-rw-r--r-- | lib/chef/provider/osx_profile.rb | 6 | ||||
-rw-r--r-- | spec/unit/provider/osx_profile_spec.rb | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb index 1d87f29eb2..07e74165b3 100644 --- a/lib/chef/provider/osx_profile.rb +++ b/lib/chef/provider/osx_profile.rb @@ -188,14 +188,14 @@ class Chef end def install_profile(profile_path) - cmd = "profiles -I -F '#{profile_path}'" + cmd = "/usr/bin/profiles -I -F '#{profile_path}'" Chef::Log.debug("cmd: #{cmd}") shellout_results = shell_out(cmd) shellout_results.exitstatus end def remove_profile - cmd = "profiles -R -p '#{@new_profile_identifier}'" + cmd = "/usr/bin/profiles -R -p '#{@new_profile_identifier}'" Chef::Log.debug("cmd: #{cmd}") shellout_results = shell_out(cmd) shellout_results.exitstatus @@ -225,7 +225,7 @@ class Chef end def write_installed_profiles(tempfile) - cmd = "profiles -P -o '#{tempfile}'" + cmd = "/usr/bin/profiles -P -o '#{tempfile}'" shell_out!(cmd) end diff --git a/spec/unit/provider/osx_profile_spec.rb b/spec/unit/provider/osx_profile_spec.rb index a1dcf3ecd6..5a2247ee0a 100644 --- a/spec/unit/provider/osx_profile_spec.rb +++ b/spec/unit/provider/osx_profile_spec.rb @@ -116,7 +116,7 @@ describe Chef::Provider::OsxProfile do allow(provider).to receive(:generate_tempfile).and_return(tempfile) allow(provider).to receive(:get_installed_profiles).and_call_original allow(provider).to receive(:read_plist).and_return(all_profiles) - expect(provider).to receive(:shell_out!).with("profiles -P -o '/tmp/allprofiles.plist'") + expect(provider).to receive(:shell_out!).with("/usr/bin/profiles -P -o '/tmp/allprofiles.plist'") provider.load_current_resource end @@ -164,7 +164,7 @@ describe Chef::Provider::OsxProfile do all_profiles["_computerlevel"][1]["ProfileUUID"] = "1781fbec-3325-565f-9022-9bb39245d4dd" provider.load_current_resource allow(provider).to receive(:write_profile_to_disk).and_return(profile_path) - expect(provider).to receive(:shell_out).with("profiles -I -F '#{profile_path}'").and_return(shell_out_success) + expect(provider).to receive(:shell_out).with("/usr/bin/profiles -I -F '#{profile_path}'").and_return(shell_out_success) provider.action_install() end @@ -248,7 +248,7 @@ describe Chef::Provider::OsxProfile do new_resource.identifier "com.testprofile.screensaver" new_resource.action(:remove) provider.load_current_resource - expect(provider).to receive(:shell_out).with("profiles -R -p '#{new_resource.identifier}'").and_return(shell_out_success) + expect(provider).to receive(:shell_out).with("/usr/bin/profiles -R -p '#{new_resource.identifier}'").and_return(shell_out_success) provider.action_remove() end end |