From b75062faa5bb46dd9d47fdf6b578c30807711cc2 Mon Sep 17 00:00:00 2001 From: Joe Crobak Date: Tue, 11 Feb 2014 17:26:00 +0000 Subject: [PATCH] Fix CommandTimeout handling. The refactor broke CommandTimeout handling, which will result in a NameError. This fixes it by adding a new CommandTimeout exception in scope and removing the old classes. --- libraries/helpers.rb | 3 +++ providers/container.rb | 2 -- providers/image.rb | 2 -- providers/registry.rb | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libraries/helpers.rb b/libraries/helpers.rb index e82ed7bfb3..a1125b0ffa 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -22,6 +22,9 @@ def initialize(timeout) end end + # Exception to signify that the docker command timed out. + class CommandTimeout < RuntimeError; end + def cli_args(spec) cli_line = '' spec.each_pair do |arg, value| diff --git a/providers/container.rb b/providers/container.rb index bcd905cfed..bce218daac 100644 --- a/providers/container.rb +++ b/providers/container.rb @@ -1,7 +1,5 @@ include Helpers::Docker -class CommandTimeout < RuntimeError; end - def load_current_resource @current_resource = Chef::Resource::DockerContainer.new(new_resource) wait_until_ready! diff --git a/providers/image.rb b/providers/image.rb index b7055feaa1..8f8ab59aa7 100644 --- a/providers/image.rb +++ b/providers/image.rb @@ -1,7 +1,5 @@ include Helpers::Docker -class CommandTimeout < RuntimeError; end - def load_current_resource wait_until_ready! @current_resource = Chef::Resource::DockerImage.new(new_resource) diff --git a/providers/registry.rb b/providers/registry.rb index 9bd47d5445..f42a197f18 100644 --- a/providers/registry.rb +++ b/providers/registry.rb @@ -1,7 +1,5 @@ include Helpers::Docker -class CommandTimeout < RuntimeError; end - def load_current_resource @current_resource = Chef::Resource::DockerRegistry.new(new_resource) wait_until_ready!