Skip to content

Commit

Permalink
comments from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jsrain committed Jan 8, 2014
1 parent 4effdda commit 71a9f9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/clients/inst_disk_for_image.rb
Expand Up @@ -69,10 +69,10 @@ def main
def disks_to_use def disks_to_use
target_map = Storage.GetTargetMap target_map = Storage.GetTargetMap
Builtins.y2milestone("TM: %1", target_map) Builtins.y2milestone("TM: %1", target_map)
supported_types = [ :CT_DISK, :CT_DMRAID, :CT_DMMULTIPATH, :CT_MDPART ] # FIXME: move blacklist to Storage
used_by_blacklist = [ :CT_DMRAID, :CT_DMMULTIPATH, :CT_MDPART ] used_by_blacklist = [ :CT_DMRAID, :CT_DMMULTIPATH, :CT_MDPART ]
target_map.select { | key, value | target_map.select { | key, value |
(supported_types.include? value["type"]) && (! used_by_blacklist.include? value["used_by"]) Storage.IsDiskType(value["type"]) && (! used_by_blacklist.include? value["used_by"])
}.keys }.keys
end end


Expand All @@ -95,7 +95,7 @@ def disk_for_image_help_text


def show_disk_for_image_dialog def show_disk_for_image_dialog
Wizard.SetContents( Wizard.SetContents(
_("Hard Disk to Deploy To"), _("Hard Disk for Image Deployment"),
disk_for_image_dialog, disk_for_image_dialog,
disk_for_image_help_text, disk_for_image_help_text,
GetInstArgs.enable_back || @test_mode, GetInstArgs.enable_back || @test_mode,
Expand Down
9 changes: 5 additions & 4 deletions src/modules/ImageInstallation.rb
Expand Up @@ -482,19 +482,19 @@ def DeployDiskImage(id, target)
# Checking files for signatures # Checking files for signatures
image = Pkg.SourceProvideDigestedFile(@_repo, 1, file, false) image = Pkg.SourceProvideDigestedFile(@_repo, 1, file, false)


if image == nil if image.nil?
Builtins.y2error("File %1 not found on media", file) Builtins.y2error("File %1 not found on media", file)
return false return false
end end


Builtins.y2milestone("Copying the image") Builtins.y2milestone("Copying the image")
cmd = Builtins.sformat("dd if=%1 of=%2", image, target) cmd = Builtins.sformat("ud bs=1048576 if=%1 of=%2", image, target) #1MB of block size
out = Convert.to_map(SCR.Execute(path(".target.bash_output"), cmd)) out = SCR.Execute(path(".target.bash_output"), cmd)
Builtins.y2milestone("Executing %1 returned %2", cmd, out) Builtins.y2milestone("Executing %1 returned %2", cmd, out)


RemoveTemporaryImage(image) RemoveTemporaryImage(image)


Ops.get_integer(out, "exit", -1) == 0 out["exit"] == 0
end end


# Mount an image of the filesystem type # Mount an image of the filesystem type
Expand Down Expand Up @@ -1516,6 +1516,7 @@ def FreeInternalVariables
publish :function => :StoreAllChanges, :type => "void ()" publish :function => :StoreAllChanges, :type => "void ()"
publish :function => :RestoreAllChanges, :type => "boolean ()" publish :function => :RestoreAllChanges, :type => "boolean ()"
publish :function => :FreeInternalVariables, :type => "void ()" publish :function => :FreeInternalVariables, :type => "void ()"
publish :function => :PrepareOEMImage, :type => "void ()"
end end


ImageInstallation = ImageInstallationClass.new ImageInstallation = ImageInstallationClass.new
Expand Down

0 comments on commit 71a9f9d

Please sign in to comment.