Skip to content

Commit

Permalink
fix-autoinst-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Nov 27, 2017
1 parent 93c95a9 commit 4d14cbb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/modules/AutoinstStorage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ def main
#
# @param settings [Array<Hash>] Profile settings (list of drives for custom partitioning)
# @return [Boolean] success
def Import(settings)
log.info "entering Import with #{settings.inspect}"
build_proposal(preprocessed_settings(settings))
def Import(original_settings)
log.info "entering Import with #{original_settings.inspect}"
settings = preprocessed_settings(settings)
return false unless settings

build_proposal(settings)
end

# Import settings from the general/storage section
Expand Down
8 changes: 8 additions & 0 deletions test/autoinst_storage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@
subject.Import([{ "device" => "ask" }])
end

context "when settings are not preprocessed successfully" do
let(:settings) { nil }

it "returns false" do
expect(subject.Import({})).to eq(false)
end
end

context "when the proposal is valid" do
let(:valid?) { true }

Expand Down

0 comments on commit 4d14cbb

Please sign in to comment.