lib/nifty/backends/utils/opennebula/image_handler.rb in nifty-0.2.4 vs lib/nifty/backends/utils/opennebula/image_handler.rb in nifty-0.2.5
- old
+ new
@@ -73,13 +73,13 @@
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.info! }
logger.debug("Deleting image with id #{id.inspect}")
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.delete }
- Timeout::timeout(Nifty::API_CALL_TIMEOUT) do
+ Timeout::timeout(Nifty::Backends::Utils::Opennebula::Handler.api_call_timeout) do
while(image_exist?(id))
- sleep(Nifty::API_POLLING_WAIT)
+ sleep(Nifty::Backends::Utils::Opennebula::Handler::API_POLLING_WAIT)
end
end
rescue Timeout::Error
fail Nifty::Errors::ApiCallTimeoutError, "Image with id #{id.inspect} was not deleted within timeout"
end
@@ -103,13 +103,13 @@
end
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.disable }
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.info! }
- Timeout::timeout(Nifty::API_CALL_TIMEOUT) do
+ Timeout::timeout(Nifty::Backends::Utils::Opennebula::Handler.api_call_timeout) do
until(image.state_str == IMAGE_STATE_DISABLED)
- sleep(Nifty::API_POLLING_WAIT)
+ sleep(Nifty::Backends::Utils::Opennebula::Handler::API_POLLING_WAIT)
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.info! }
end
end
end
@@ -169,14 +169,14 @@
logger.debug("Registering image with template\n#{template}")
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.allocate(template, datastore.id) }
begin
- Timeout::timeout(Nifty::API_CALL_TIMEOUT) do
+ Timeout::timeout(Nifty::Backends::Utils::Opennebula::Handler.api_call_timeout) do
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.info! }
until(image.state_str == IMAGE_STATE_READY)
- sleep(Nifty::API_POLLING_WAIT)
+ sleep(Nifty::Backends::Utils::Opennebula::Handler::API_POLLING_WAIT)
Nifty::Backends::Utils::Opennebula::Helper.handle_opennebula_error { image.info! }
end
end
image