From 578a69011eadda14e51c2ca83f9206f58b9a6243 Mon Sep 17 00:00:00 2001 From: antima-gupta Date: Fri, 8 May 2020 17:56:56 +0530 Subject: Fixed cron resource weekday property. Implemented same weekday functionality for cron_d resource. Fixed rspec failure. Added cron helper for weekday functionality Added spec for cron helper. Signed-off-by: antima-gupta --- lib/chef/provider/cron.rb | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'lib/chef/provider') diff --git a/lib/chef/provider/cron.rb b/lib/chef/provider/cron.rb index a5669b0a4a..8abecfa698 100644 --- a/lib/chef/provider/cron.rb +++ b/lib/chef/provider/cron.rb @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - require_relative "../log" require_relative "../provider" @@ -27,8 +26,6 @@ class Chef SPECIAL_TIME_VALUES = %i{reboot yearly annually monthly weekly daily midnight hourly}.freeze CRON_ATTRIBUTES = %i{minute hour day month weekday time command mailto path shell home environment}.freeze - WEEKDAY_SYMBOLS = %i{sunday monday tuesday wednesday thursday friday saturday}.freeze - CRON_PATTERN = %r{\A([-0-9*,/]+)\s([-0-9*,/]+)\s([-0-9*,/]+)\s([-0-9*,/]+|[a-zA-Z]{3})\s([-0-9*,/]+|[a-zA-Z]{3})\s(.*)}.freeze SPECIAL_PATTERN = /\A(@(#{SPECIAL_TIME_VALUES.join('|')}))\s(.*)/.freeze ENV_PATTERN = /\A(\S+)=(\S*)/.freeze @@ -288,15 +285,6 @@ class Chef newcron.join("\n") end - - def weekday_in_crontab - weekday_in_crontab = WEEKDAY_SYMBOLS.index(new_resource.weekday) - if weekday_in_crontab.nil? - new_resource.weekday - else - weekday_in_crontab.to_s - end - end end end end -- cgit v1.2.1