Skip to content

Commit

Permalink
Replace ec2_block_storage with specific ec2_ebs_storage
Browse files Browse the repository at this point in the history
Since we are now explicitly adding EBS provider, this patch changes the
name of the corresponding dependent block storage manager.

Signed-off-by: Gregor Berginc <[email protected]>
  • Loading branch information
gberginc committed Jan 17, 2017
1 parent 99efe4b commit b8f8ba1
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions app/models/manageiq/providers/amazon/cloud_manager.rb
Original file line number Diff line number Diff line change
@@ -47,15 +47,15 @@ class ManageIQ::Providers::Amazon::CloudManager < ManageIQ::Providers::CloudMana
:to => :network_manager,
:allow_nil => true

has_one :block_storage_manager,
has_one :ebs_storage_manager,
:foreign_key => :parent_ems_id,
:class_name => "ManageIQ::Providers::Amazon::StorageManager::Ebs",
:autosave => true,
:dependent => :destroy

delegate :cloud_volumes,
:cloud_volume_snapshots,
:to => :block_storage_manager,
:to => :ebs_storage_manager,
:allow_nil => true

before_create :ensure_managers
@@ -70,10 +70,10 @@ def ensure_managers
network_manager.zone_id = zone_id
network_manager.provider_region = provider_region

build_block_storage_manager unless block_storage_manager
block_storage_manager.name = "#{name} Block Storage Manager"
block_storage_manager.zone_id = zone_id
block_storage_manager.provider_region = provider_region
build_ebs_storage_manager unless ebs_storage_manager
ebs_storage_manager.name = "#{name} EBS Storage Manager"
ebs_storage_manager.zone_id = zone_id
ebs_storage_manager.provider_region = provider_region
end

def self.ems_type
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ class ManageIQ::Providers::Amazon::StorageManager::Ebs < ManageIQ::Providers::St
:allow_nil => true

def self.ems_type
@ems_type ||= "ec2_block_storage".freeze
@ems_type ||= "ec2_ebs_storage".freeze
end

def self.description
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
].each do |settings|
context "with settings #{settings}" do
before :each do
allow(Settings.ems_refresh).to receive(:ec2_block_storage).and_return(settings)
allow(Settings.ems_refresh).to receive(:ec2_ebs_storage).and_return(settings)
end

it "2 refreshes, first creates all entities, second updates all entitites" do
@@ -65,7 +65,7 @@ def refresh_spec
@ems.reload

with_aws_stubbed(stub_responses) do
EmsRefresh.refresh(@ems.block_storage_manager)
EmsRefresh.refresh(@ems.ebs_storage_manager)
end

@ems.reload
@@ -174,7 +174,7 @@ def assert_table_counts
end

def assert_ems
ems = @ems.block_storage_manager
ems = @ems.ebs_storage_manager

expect(ems).to have_attributes(:api_version => nil, # TODO: Should be 3.0
:uid_ems => nil)

0 comments on commit b8f8ba1

Please sign in to comment.