[Ovirt-devel] [PATCH server] BUG#460147 - Deleting a VM based on a Cobbler system does not delete

Scott Seago sseago at redhat.com
Fri Oct 24 16:28:38 UTC 2008


Darryl L. Pierce wrote:
> This patch addresses this issue, first calling Cobbler and deleting the
> system prior to deleting the VM. It also changes ovirt-server's dependence
> to since this is new functionality in the rubygem-cobbler package.
>
> Also, since there were several lines with trailing white spaces, this
> patch strips those out of the vm_controller.rb file.
>   
NACK. This works for the multi-VM deletion code path, but for the single 
VM deletion action (delete link on the details pane) the cobbler profile 
remains.

> diff --git a/src/app/controllers/vm_controller.rb b/src/app/controllers/vm_controller.rb
> index 585e524..5ab80f5 100644
> --- a/src/app/controllers/vm_controller.rb
> +++ b/src/app/controllers/vm_controller.rb
> @@ -144,6 +144,11 @@ class VmController < ApplicationController
>          vms = Vm.find(:all, :conditions => "id in (#{vm_ids.join(', ')})")
>          vms.each do |vm|
>            if vm.is_destroyable?
> +            # Destroy the Cobbler system first if it's defined
> +            if vm.uses_cobbler?
> +              system = Cobbler::System.find_one(vm.cobbler_system_name)
> +              system.remove if system
> +            end
>              vm.destroy
>            else
>              failure_list << vm.description
>   
This code also needs to be added into the vm_controller.destroy, since 
that's the action used for deleting a single VM. Once that's done it 
should all work properly.

Scott




More information about the ovirt-devel mailing list