Skip to content

Commit

Permalink
Removes OpenStack Cinder event Workers
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Cheal committed Jan 8, 2019
1 parent 235e67c commit 79f08c0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class RemoveCinderManagerEventWorkerRows < ActiveRecord::Migration[5.0]
class MiqWorker < ActiveRecord::Base
self.inheritance_column = :_type_disabled
end

def up
# ManageIQ::Providers::StorageManager::CinderManager::EventCatcher was removed in 772bdc283360e99f9cf2209184297d1827f3a9e6
# https://github.com/ManageIQ/manageiq/pull/14962
MiqWorker.where(:type => "ManageIQ::Providers::StorageManager::CinderManager::EventCatcher").delete_all
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require_migration

describe RemoveCinderManagerEventWorkerRows do
migration_context :up do
let(:miq_worker) { migration_stub(:MiqWorker) }

it "deletes Openstack Cinder event workers" do
miq_worker.create!(:type => "MiqWorker")
miq_worker.create!(:type => "ManageIQ::Providers::StorageManager::CinderManager::EventCatcher")

migrate

expect(miq_worker.count).to eq(1)
expect(miq_worker.first.type).to eq("MiqWorker")
end
end
end

0 comments on commit 79f08c0

Please sign in to comment.