diff options
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/provider/breakpoint.rb | 38 | ||||
-rw-r--r-- | lib/chef/providers.rb | 1 | ||||
-rw-r--r-- | lib/chef/resource/breakpoint.rb | 15 |
3 files changed, 15 insertions, 39 deletions
diff --git a/lib/chef/provider/breakpoint.rb b/lib/chef/provider/breakpoint.rb deleted file mode 100644 index 9f8b8a6467..0000000000 --- a/lib/chef/provider/breakpoint.rb +++ /dev/null @@ -1,38 +0,0 @@ -# -# Author:: Daniel DeLeo (<dan@kallistec.com>) -# Copyright:: Copyright 2008-2017, Chef Software Inc. -# License:: Apache License, Version 2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -class Chef - class Provider - class Breakpoint < Chef::Provider - - provides :breakpoint - - def load_current_resource - end - - def action_break - if defined?(Shell) && Shell.running? - run_context.resource_collection.iterator.pause - new_resource.updated_by_last_action(true) - run_context.resource_collection.iterator - end - end - - end - end -end diff --git a/lib/chef/providers.rb b/lib/chef/providers.rb index 41de44a1d6..0ea1786594 100644 --- a/lib/chef/providers.rb +++ b/lib/chef/providers.rb @@ -19,7 +19,6 @@ require "chef/provider/apt_update" require "chef/provider/apt_repository" require "chef/provider/batch" -require "chef/provider/breakpoint" require "chef/provider/cookbook_file" require "chef/provider/cron" require "chef/provider/cron/solaris" diff --git a/lib/chef/resource/breakpoint.rb b/lib/chef/resource/breakpoint.rb index a5eed0da94..d059800e53 100644 --- a/lib/chef/resource/breakpoint.rb +++ b/lib/chef/resource/breakpoint.rb @@ -21,12 +21,27 @@ require "chef/resource" class Chef class Resource class Breakpoint < Chef::Resource + provides :breakpoint + resource_name :breakpoinst + default_action :break def initialize(action = "break", *args) super(caller.first, *args) end + def load_current_resource + end + + action :break do + if defined?(Shell) && Shell.running? + with_run_context :parent do + run_context.resource_collection.iterator.pause + new_resource.updated_by_last_action(true) + run_context.resource_collection.iterator + end + end + end end end end |