Method: Chef::Resource::Timezone#current_macos_tz
- Defined in:
- lib/chef/resource/timezone.rb
#current_macos_tz ⇒ String
detect the current TZ on darwin hosts
62 63 64 65 66 67 68 69 |
# File 'lib/chef/resource/timezone.rb', line 62 def current_macos_tz tz_shellout = shell_out!(["systemsetup", "-gettimezone"]) if /You need administrator access/.match?(tz_shellout.stdout) raise "The timezone resource requires administrative privileges to run on macOS hosts!" else /Time Zone: (.*)/.match(tz_shellout.stdout)[1] end end |