diff options
author | Tim Smith <tsmith@chef.io> | 2018-08-10 12:08:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-10 12:08:09 -0700 |
commit | 519a41ca8de5c1e451fef0eebf3e4f87d0ab2735 (patch) | |
tree | 00a3905d6e6045767f18a01c06a745aa31d02dff | |
parent | 1cc286d839129950dea85d3f25b960e8fb470f4f (diff) | |
parent | 573ab5a5a8e3f2ebfbf18d81738962dd93c1b2a9 (diff) | |
download | chef-519a41ca8de5c1e451fef0eebf3e4f87d0ab2735.tar.gz |
Merge pull request #7539 from chef/osx_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 66b5c26137..531d822334 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 ] logger.trace("cmd: #{cmd.join(" ")}") 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 ] logger.trace("cmd: #{cmd.join(" ")}") shellout_results = shell_out(*cmd) shellout_results.exitstatus @@ -225,7 +225,7 @@ class Chef end def write_installed_profiles(tempfile) - shell_out!( "profiles", "-P", "-o", tempfile ) + shell_out!( "/usr/bin/profiles", "-P", "-o", tempfile ) end def read_plist(xml_file) diff --git a/spec/unit/provider/osx_profile_spec.rb b/spec/unit/provider/osx_profile_spec.rb index 08d2eebdc4..8f99ad6817 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_compacted!).with("profiles", "-P", "-o", "/tmp/allprofiles.plist") + expect(provider).to receive(:shell_out_compacted!).with("/usr/bin/profiles", "-P", "-o", "/tmp/allprofiles.plist") provider.load_current_resource end @@ -166,7 +166,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_compacted).with("profiles", "-I", "-F", profile_path).and_return(shell_out_success) + expect(provider).to receive(:shell_out_compacted).with("/usr/bin/profiles", "-I", "-F", profile_path).and_return(shell_out_success) provider.action_install() end @@ -250,7 +250,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_compacted).with("profiles", "-R", "-p", new_resource.identifier).and_return(shell_out_success) + expect(provider).to receive(:shell_out_compacted).with("/usr/bin/profiles", "-R", "-p", new_resource.identifier).and_return(shell_out_success) provider.action_remove() end end |