From 705f456f8bbb296ed95fd55b9f2e46c670a84c12 Mon Sep 17 00:00:00 2001 From: Andrei Veselov Date: Mon, 26 Feb 2018 11:15:15 +0100 Subject: [PATCH] Add delete_queue method for Template --- .../openstack/cloud_manager/template.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app/models/manageiq/providers/openstack/cloud_manager/template.rb b/app/models/manageiq/providers/openstack/cloud_manager/template.rb index 1aa894bf9..6aa7b8fe3 100644 --- a/app/models/manageiq/providers/openstack/cloud_manager/template.rb +++ b/app/models/manageiq/providers/openstack/cloud_manager/template.rb @@ -110,6 +110,22 @@ def update_image(options) raw_update_image(options) end + def delete_image_queue(userid) + task_opts = { + :action => "Deleting image for user #{userid}", + :userid => userid + } + queue_opts = { + :class_name => "ManageIQ::Providers::Openstack::CloudManager::Template", + :method_name => 'delete_image', + :instance_id => id, + :role => 'ems_operations', + :zone => ext_management_system.my_zone, + :args => [] + } + MiqTask.generic_action_with_callback(task_opts, queue_opts) + end + def raw_delete_image ext_management_system.with_provider_connection(:service => 'Image') do |service| service.delete_image(ems_ref)