diff options
author | antima-gupta <agupta@msystechnologies.com> | 2020-05-08 17:56:56 +0530 |
---|---|---|
committer | antima-gupta <agupta@msystechnologies.com> | 2020-06-10 10:51:40 +0530 |
commit | 578a69011eadda14e51c2ca83f9206f58b9a6243 (patch) | |
tree | 62ee4ddf2ef2fe7ce8fd94762a11fc08c033a0aa /lib/chef/provider | |
parent | 4be3d8d01e9b757444d8e374ac0a541a68f75dab (diff) | |
download | chef-578a69011eadda14e51c2ca83f9206f58b9a6243.tar.gz |
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 <agupta@msystechnologies.com>
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/cron.rb | 12 |
1 files changed, 0 insertions, 12 deletions
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 |