summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-18 16:20:28 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-18 16:20:28 -0700
commit621caccc151dfbdddb29adfec57aef91ff3d06c5 (patch)
tree26f7ddbb619f1f0d5c9bebfd8d3f9d4509275e1a
parent97f8bc54bb76edbac93d7c53252f52866c648dbf (diff)
downloadchef-timezone.tar.gz
Make sure to not raise too earlytimezone
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/timezone.rb2
-rw-r--r--spec/unit/resource/timezone_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/resource/timezone.rb b/lib/chef/resource/timezone.rb
index 97aa738af9..7ed67860cd 100644
--- a/lib/chef/resource/timezone.rb
+++ b/lib/chef/resource/timezone.rb
@@ -74,7 +74,7 @@ class Chef
# @since 14.7
# @return [String] timezone id
def current_windows_tz
- tz_shellout = shell_out!("tzutil /g")
+ tz_shellout = shell_out("tzutil /g")
raise "There was an error running the tzutil command" if tz_shellout.exitstatus == 1
tz_shellout.stdout.strip
diff --git a/spec/unit/resource/timezone_spec.rb b/spec/unit/resource/timezone_spec.rb
index 8ba033f072..b48a69e103 100644
--- a/spec/unit/resource/timezone_spec.rb
+++ b/spec/unit/resource/timezone_spec.rb
@@ -21,7 +21,7 @@ describe Chef::Resource::Timezone do
let(:resource) { Chef::Resource::Timezone.new("fakey_fakerton") }
let(:shellout_tzutil) do
- double("shell_out!", stdout: "UTC\n", exitstatus: 0, error?: false)
+ double("shell_out", stdout: "UTC\n", exitstatus: 0, error?: false)
end
# note: This weird indention is correct
@@ -87,7 +87,7 @@ systemd-timesyncd.service active: yes
describe "#current_windows_tz?" do
it "returns the TZ" do
- expect(resource).to receive(:shell_out!).and_return(shellout_tzutil)
+ expect(resource).to receive(:shell_out).and_return(shellout_tzutil)
expect(resource.current_windows_tz).to eql("UTC")
end
end