Skip to content

Commit

Permalink
Add create action for Image
Browse files Browse the repository at this point in the history
  • Loading branch information
andyvesel committed Sep 5, 2017
1 parent 3d019c3 commit f02a0de
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions app/models/manageiq/providers/openstack/cloud_manager/template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,23 @@ def has_proxy?
def requires_storage_for_scan?
false
end

def self.raw_create_image(ext_management_system, create_options)
ext_management_system.with_provider_connection(:service => 'Compute') do |service|
service.images.create(create_options)
end
rescue => err
_log.error("image=[#{name}], error=[#{err}]")
raise MiqException::MiqOpenstackApiRequestError, err.to_s, err.backtrace
end

def self.validate_create_image(ext_management_system, _options = {})
if ext_management_system
{:available => true, :message => nil}
else
{:available => false,
:message => _("The Image is not connected to an active %{table}") %
{:table => ui_lookup(:table => "ext_management_system")}}
end
end
end

0 comments on commit f02a0de

Please sign in to comment.