diff options
author | Jose Asuncion <jose.asuncion@gmail.com> | 2017-09-26 15:34:13 -0700 |
---|---|---|
committer | Jose Asuncion <jose.asuncion@gmail.com> | 2017-09-26 15:34:29 -0700 |
commit | 2e94dd8d733b9bae92228f4eca2dcdb0c58594c3 (patch) | |
tree | 9fca3836bde207c955d77ce0516dfb4ec97e73c9 | |
parent | ed65b42bb5bf587495918cbf509a4aea871720ec (diff) | |
parent | a51cda521a6f9cc6371cddf3eeff64adf69630ae (diff) | |
download | chef-2e94dd8d733b9bae92228f4eca2dcdb0c58594c3.tar.gz |
Merge branch 'master' into feat/5556
Signed-off-by: Jose Asuncion <jeunito@gmail.com>
-rw-r--r-- | CHANGELOG.md | 8 | ||||
-rw-r--r-- | Gemfile.lock | 38 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | chef-config/lib/chef-config/version.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/windows_task.rb | 8 | ||||
-rw-r--r-- | lib/chef/version.rb | 2 | ||||
-rw-r--r-- | spec/functional/resource/windows_task_spec.rb | 9 | ||||
-rw-r--r-- | spec/unit/provider/windows_task_spec.rb | 10 |
8 files changed, 45 insertions, 34 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 04e681fb36..1741f90e79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,17 @@ <!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ --> -<!-- latest_release 13.4.33 --> -## [v13.4.33](https://github.com/chef/chef/tree/v13.4.33) (2017-09-25) +<!-- latest_release 13.4.35 --> +## [v13.4.35](https://github.com/chef/chef/tree/v13.4.35) (2017-09-26) #### Merged Pull Requests -- update expeditor labels [#6432](https://github.com/chef/chef/pull/6432) ([thommay](https://github.com/thommay)) +- Only accept MM/DD/YYYY for windows_task start_day [#6434](https://github.com/chef/chef/pull/6434) ([jaym](https://github.com/jaym)) <!-- latest_release --> <!-- release_rollup since=13.4.24 --> ### Changes since 13.4.24 release #### Merged Pull Requests +- Only accept MM/DD/YYYY for windows_task start_day [#6434](https://github.com/chef/chef/pull/6434) ([jaym](https://github.com/jaym)) <!-- 13.4.35 --> +- Update dependencies to pull in InSpec v1.39.1 [#6440](https://github.com/chef/chef/pull/6440) ([adamleff](https://github.com/adamleff)) <!-- 13.4.34 --> - update expeditor labels [#6432](https://github.com/chef/chef/pull/6432) ([thommay](https://github.com/thommay)) <!-- 13.4.33 --> - Fix Knife search ID only option to actually filter result set [#6438](https://github.com/chef/chef/pull/6438) ([dimsh99](https://github.com/dimsh99)) <!-- 13.4.32 --> - Add throttle and metalink options to yum_repository [#6431](https://github.com/chef/chef/pull/6431) ([tas50](https://github.com/tas50)) <!-- 13.4.31 --> diff --git a/Gemfile.lock b/Gemfile.lock index 5f086dceea..8bcec8e3ad 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/chef/chefstyle.git - revision: 4f1a175179965d53b9f2a068f2ea4c59090454a1 + revision: 4eb575a63ce5679d9166211d684c9e3fff168d2a branch: master specs: chefstyle (0.6.0) @@ -17,10 +17,10 @@ GIT PATH remote: . specs: - chef (13.4.33) + chef (13.4.35) addressable bundler (>= 1.10) - chef-config (= 13.4.33) + chef-config (= 13.4.35) chef-zero (>= 13.0) diff-lcs (~> 1.2, >= 1.2.4) erubis (~> 2.7) @@ -47,10 +47,10 @@ PATH specinfra (~> 2.10) syslog-logger (~> 1.6) uuidtools (~> 2.1.5) - chef (13.4.33-universal-mingw32) + chef (13.4.35-universal-mingw32) addressable bundler (>= 1.10) - chef-config (= 13.4.33) + chef-config (= 13.4.35) chef-zero (>= 13.0) diff-lcs (~> 1.2, >= 1.2.4) erubis (~> 2.7) @@ -92,7 +92,7 @@ PATH PATH remote: chef-config specs: - chef-config (13.4.33) + chef-config (13.4.35) addressable fuzzyurl mixlib-config (~> 2.0) @@ -104,6 +104,7 @@ GEM addressable (2.4.0) appbundler (0.10.0) mixlib-cli (~> 1.4) + mixlib-shellout (~> 2.0) ast (2.3.0) backports (3.8.0) binding_of_caller (0.7.2) @@ -121,7 +122,7 @@ GEM cheffish (13.0.0) chef-zero (~> 13.0) net-ssh - coderay (1.1.1) + coderay (1.1.2) crack (0.4.3) safe_yaml (~> 1.0.0) debug_inspector (0.0.3) @@ -133,7 +134,7 @@ GEM erubis (2.7.0) ethon (0.10.1) ffi (>= 1.3.0) - excon (0.58.0) + excon (0.59.0) faraday (0.13.1) multipart-post (>= 1.2, < 3) faraday_middleware (0.12.2) @@ -163,7 +164,7 @@ GEM htmlentities (4.3.4) httpclient (2.8.3) iniparse (1.4.4) - inspec (1.36.1) + inspec (1.39.1) addressable (~> 2.4) faraday (>= 0.9.0) hashie (~> 3.4) @@ -182,7 +183,7 @@ GEM sslshake (~> 1.2) thor (~> 0.19) toml (~> 0.1) - train (~> 0.26) + train (~> 0.28) ipaddress (0.8.3) iso8601 (0.9.1) json (2.1.0) @@ -243,10 +244,9 @@ GEM plist (3.3.0) powerpack (0.1.1) proxifier (1.0.3) - pry (0.10.4) + pry (0.11.0) coderay (~> 1.1.0) method_source (~> 0.8.1) - slop (~> 3.4) pry-byebug (3.5.0) byebug (~> 9.1) pry (~> 0.10) @@ -262,7 +262,7 @@ GEM rack (2.0.3) rainbow (2.2.2) rake - rake (12.0.0) + rake (12.1.0) rb-readline (0.5.5) rspec (3.6.0) rspec-core (~> 3.6.0) @@ -291,7 +291,7 @@ GEM ruby-progressbar (~> 1.7) unicode-display_width (~> 1.0, >= 1.0.1) ruby-prof (0.16.2) - ruby-progressbar (1.8.1) + ruby-progressbar (1.8.3) ruby-shadow (2.5.0) rubyntlm (0.6.2) rubyzip (1.2.1) @@ -306,13 +306,13 @@ GEM rspec-its specinfra (~> 2.68) sfl (2.3) - simplecov (0.15.0) + simplecov (0.15.1) docile (~> 1.1.0) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) slop (3.6.0) - specinfra (2.71.3) + specinfra (2.72.0) net-scp net-ssh (>= 2.7, < 5.0) net-telnet @@ -323,8 +323,8 @@ GEM thor (0.20.0) toml (0.1.2) parslet (~> 1.5.0) - tomlrb (1.2.4) - train (0.26.2) + tomlrb (1.2.5) + train (0.28.0) docker-api (~> 1.26) json (>= 1.8, < 3.0) mixlib-shellout (~> 2.0) @@ -379,7 +379,7 @@ GEM logging (>= 1.6.1, < 3.0) nori (~> 2.0) rubyntlm (~> 0.6.0, >= 0.6.1) - winrm-fs (1.0.1) + winrm-fs (1.0.2) erubis (~> 2.7) logging (>= 1.6.1, < 3.0) rubyzip (~> 1.1) @@ -1 +1 @@ -13.4.33
\ No newline at end of file +13.4.35
\ No newline at end of file diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb index 509d76cf8c..3e53f6a904 100644 --- a/chef-config/lib/chef-config/version.rb +++ b/chef-config/lib/chef-config/version.rb @@ -21,7 +21,7 @@ module ChefConfig CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__) - VERSION = "13.4.33" + VERSION = "13.4.35" end # diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb index 8703c30da9..b090a3c1d3 100644 --- a/lib/chef/provider/windows_task.rb +++ b/lib/chef/provider/windows_task.rb @@ -220,7 +220,7 @@ class Chef def start_day_updated? current_day = DateTime.strptime(current_resource.start_day, convert_system_date_format_to_ruby_date_format) - new_day = DateTime.parse(new_resource.start_day) + new_day = parse_day(new_resource.start_day) current_day != new_day end @@ -230,7 +230,7 @@ class Chef end def convert_user_date_to_system_date(date_in_string) - DateTime.parse(date_in_string).strftime(convert_system_date_format_to_ruby_long_date) + parse_day(date_in_string).strftime(convert_system_date_format_to_ruby_long_date) end def convert_system_date_format_to_ruby_long_date @@ -488,6 +488,10 @@ class Chef current_resource.idle_time(duration.minutes.atom.to_i) end + def parse_day(str) + Date.strptime(str, "%m/%d/%Y") + end + end end end diff --git a/lib/chef/version.rb b/lib/chef/version.rb index e30285d620..12196d7acf 100644 --- a/lib/chef/version.rb +++ b/lib/chef/version.rb @@ -23,7 +23,7 @@ require "chef/version_string" class Chef CHEF_ROOT = File.expand_path("../..", __FILE__) - VERSION = Chef::VersionString.new("13.4.33") + VERSION = Chef::VersionString.new("13.4.35") end # diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb index fbb5e4dd12..c2496c702f 100644 --- a/spec/functional/resource/windows_task_spec.rb +++ b/spec/functional/resource/windows_task_spec.rb @@ -36,15 +36,20 @@ describe Chef::Resource::WindowsTask, :windows_only do subject do new_resource = Chef::Resource::WindowsTask.new(task_name, run_context) new_resource.command task_name + # Make sure MM/DD/YYYY is accepted + new_resource.start_day "09/20/2017" new_resource end - it "creates a scheduled task to run every 1 hr" do + it "creates a scheduled task to run every 1 hr starting on 09/20/2017" do subject.run_action(:create) task_details = windows_task_provider.send(:load_task_hash, task_name) expect(task_details[:TaskName]).to eq("\\chef-client") expect(task_details[:TaskToRun]).to eq("chef-client") expect(task_details[:"Repeat:Every"]).to eq("1 Hour(s), 0 Minute(s)") + + # This test will not work across locales + expect(task_details[:StartDate]).to eq("9/20/2017") end end @@ -300,7 +305,7 @@ describe Chef::Resource::WindowsTask, :windows_only do context "when start_day is passed with frequency :onstart" do it "raises error" do subject.frequency :onstart - subject.start_day "mon" + subject.start_day "09/20/2017" expect { subject.after_created }.to raise_error("`start_day` property is not supported with frequency: onstart") end end diff --git a/spec/unit/provider/windows_task_spec.rb b/spec/unit/provider/windows_task_spec.rb index ec66cf2551..b18d842bfa 100644 --- a/spec/unit/provider/windows_task_spec.rb +++ b/spec/unit/provider/windows_task_spec.rb @@ -331,7 +331,7 @@ describe Chef::Provider::WindowsTask do new_resource.frequency_modifier 15 new_resource.user "SYSTEM" new_resource.execution_time_limit "PT72H" - new_resource.start_day "30-Mar-2017" + new_resource.start_day "03/30/2017" new_resource.start_time "13:12" end @@ -383,7 +383,7 @@ describe Chef::Provider::WindowsTask do new_resource.frequency_modifier 15 new_resource.user "SYSTEM" new_resource.execution_time_limit "PT72H" - new_resource.start_day "30-Mar-2017" + new_resource.start_day "03/30/2017" new_resource.start_time "13:12" end context "when start_day not changed" do @@ -429,9 +429,9 @@ describe Chef::Provider::WindowsTask do end describe "#convert_user_date_to_system_date" do - it "when current resource start date is '30-May-2017' then returns '05/30/2017'" do - allow(provider).to receive(:get_system_short_date_format).and_return("MM/dd/yyyy") - expect(provider.send(:convert_user_date_to_system_date, "30-May-2017")).to eq("05/30/2017") + it "when current resource start date is '05/30/2017' then returns '30/05/2017'" do + allow(provider).to receive(:get_system_short_date_format).and_return("dd/MM/yyyy") + expect(provider.send(:convert_user_date_to_system_date, "05/30/2017")).to eq("30/05/2017") end end |