Skip to content

Commit

Permalink
fixes from Ihno
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed May 2, 2014
1 parent 9394f8c commit fb86296
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 867 deletions.
6 changes: 2 additions & 4 deletions src/clients/inst_reipl.rb
Expand Up @@ -46,8 +46,7 @@ def main
Yast.include self, "reipl/dialogs.rb"

# The main ()
Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("Reipl module started")
Builtins.y2milestone("Reipl module started ----------------------------------------")

@args = GetInstArgs.argmap

Expand All @@ -64,8 +63,7 @@ def main
@ret = Convert.to_symbol(ConfigureDialog())

# Finish
Builtins.y2milestone("Reipl module finished")
Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("Reipl module finished ----------------------------------------")

@ret

Expand Down
20 changes: 5 additions & 15 deletions src/clients/inst_reiplauto.rb
Expand Up @@ -43,13 +43,7 @@ def main
Yast.import "Confirm"
Yast.import "Storage"
# The main ()
Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("inst_reiplauto started")

if !Reipl.SanityCheck
Builtins.y2milestone("SanityCheck failed!")
return :cancel
end
Builtins.y2milestone("inst_reiplauto started ----------------------------------------")

@args = GetInstArgs.argmap

Expand All @@ -63,21 +57,17 @@ def main

@configuration = Reipl.ReadState

if @configuration != nil
@configuration = Reipl.ModifyReiplWithBootPartition(@configuration)

if @configuration != nil
Reipl.WriteState(@configuration)
else
if @configuration != nil

if Reipl.IPL_from_boot_zipl == false
Builtins.y2error("Could not modify reipl configuration")
end
else
Builtins.y2error("Could not read reipl configuration")
end

# Finish
Builtins.y2milestone("inst_reiplauto finished")
Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("inst_reiplauto finished ----------------------------------------")

:next

Expand Down
6 changes: 2 additions & 4 deletions src/clients/reipl.rb
Expand Up @@ -38,8 +38,7 @@ def main
textdomain "reipl"

# The main ()
Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("Reipl module started")
Builtins.y2milestone("Reipl module started ----------------------------------------")

Yast.import "Progress"
Yast.import "Report"
Expand Down Expand Up @@ -89,8 +88,7 @@ def main
Builtins.y2debug("ret=%1", @ret)

# Finish
Builtins.y2milestone("Reipl module finished")
Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("Reipl module finished ----------------------------------------")

deep_copy(@ret)

Expand Down
6 changes: 2 additions & 4 deletions src/clients/reipl_auto.rb
Expand Up @@ -42,8 +42,7 @@ def main

textdomain "reipl"

Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("Reipl auto started")
Builtins.y2milestone("Reipl auto started ----------------------------------------")

Yast.import "Reipl"
Yast.include self, "reipl/wizards.rb"
Expand Down Expand Up @@ -111,8 +110,7 @@ def main
end

Builtins.y2debug("ret=%1", @ret)
Builtins.y2milestone("Reipl auto finished")
Builtins.y2milestone("----------------------------------------")
Builtins.y2milestone("Reipl auto finished ----------------------------------------")

deep_copy(@ret)

Expand Down
76 changes: 23 additions & 53 deletions src/clients/reipl_bootloader_finish.rb
Expand Up @@ -28,88 +28,64 @@ def main
# Other architectures do not support it
if Arch.s390
@oldConfiguration = Reipl.ReadState
@newConfiguration = Reipl.ReadState

if @oldConfiguration != nil
@newConfiguration = Reipl.ModifyReiplWithBootPartition(
@newConfiguration
)
if Reipl.IPL_from_boot_zipl == false
@newConfiguration = Reipl.ReadState

@oldCcwMap = Ops.get_map(@oldConfiguration, "ccw")
@newCcwMap = Ops.get_map(@newConfiguration, "ccw")
@oldFcpMap = Ops.get_map(@oldConfiguration, "fcp")
@newFcpMap = Ops.get_map(@newConfiguration, "fcp")

@different = Ops.get_string(@oldConfiguration, "method", "a") !=
Ops.get_string(@newConfiguration, "method", "b") ||
Ops.get_string(@oldCcwMap, "device", "a") !=
Ops.get_string(@newCcwMap, "device", "b") ||
Ops.get_string(@oldCcwMap, "loadparm", "a") !=
Ops.get_string(@newCcwMap, "loadparm", "b") ||
Ops.get_string(@oldCcwMap, "parm", "a") !=
Ops.get_string(@newCcwMap, "parm", "b") ||
Ops.get_string(@oldFcpMap, "device", "a") !=
Ops.get_string(@newFcpMap, "device", "b") ||
Ops.get_string(@oldFcpMap, "wwpn", "a") !=
Ops.get_string(@newFcpMap, "wwpn", "b") ||
Ops.get_string(@oldFcpMap, "lun", "a") !=
Ops.get_string(@newFcpMap, "lun", "b") ||
Ops.get_string(@oldFcpMap, "bootprog", "a") !=
Ops.get_string(@newFcpMap, "bootprog", "b") ||
Ops.get_string(@oldFcpMap, "br_lba", "a") !=
Ops.get_string(@newFcpMap, "br_lba", "b")
@different = Ops.get_string(@oldConfiguration, "method", "a") != Ops.get_string(@newConfiguration, "method", "b") ||
Ops.get_string(@oldCcwMap, "device", "a") != Ops.get_string(@newCcwMap, "device", "b") ||
Ops.get_string(@oldCcwMap, "loadparm", "a") != Ops.get_string(@newCcwMap, "loadparm", "b") ||
Ops.get_string(@oldCcwMap, "parm", "a") != Ops.get_string(@newCcwMap, "parm", "b") ||
Ops.get_string(@oldFcpMap, "device", "a") != Ops.get_string(@newFcpMap, "device", "b") ||
Ops.get_string(@oldFcpMap, "wwpn", "a") != Ops.get_string(@newFcpMap, "wwpn", "b") ||
Ops.get_string(@oldFcpMap, "lun", "a") != Ops.get_string(@newFcpMap, "lun", "b") ||
Ops.get_string(@oldFcpMap, "bootprog", "a") != Ops.get_string(@newFcpMap, "bootprog", "b") ||
Ops.get_string(@oldFcpMap, "br_lba", "a") != Ops.get_string(@newFcpMap, "br_lba", "b")

Builtins.y2milestone(
"(oldConfiguration['method']:'a' != newConfiguration['method']:'b') = %1",
Ops.get_string(@oldConfiguration, "method", "a") !=
Ops.get_string(@newConfiguration, "method", "b")
Ops.get_string(@oldConfiguration, "method", "a") != Ops.get_string(@newConfiguration, "method", "b")
)
Builtins.y2milestone(
"(oldCcwMap['device']:'a' != newCcwMap['device']:'b') = %1",
Ops.get_string(@oldCcwMap, "device", "a") !=
Ops.get_string(@newCcwMap, "device", "b")
Ops.get_string(@oldCcwMap, "device", "a") != Ops.get_string(@newCcwMap, "device", "b")
)
Builtins.y2milestone(
"(oldCcwMap['loadparm']:'a' != newCcwMap['loadparm']:'b') = %1",
Ops.get_string(@oldCcwMap, "loadparm", "a") !=
Ops.get_string(@newCcwMap, "loadparm", "b")
Ops.get_string(@oldCcwMap, "loadparm", "a") != Ops.get_string(@newCcwMap, "loadparm", "b")
)
Builtins.y2milestone(
"(oldCcwMap['parm']:'a' != newCcwMap['parm']:'b') = %1",
Ops.get_string(@oldCcwMap, "parm", "a") !=
Ops.get_string(@newCcwMap, "parm", "b")
Ops.get_string(@oldCcwMap, "parm", "a") != Ops.get_string(@newCcwMap, "parm", "b")
)
Builtins.y2milestone(
"(oldFcpMap['device']:'a' != newFcpMap['device']:'b') = %1",
Ops.get_string(@oldFcpMap, "device", "a") !=
Ops.get_string(@newFcpMap, "device", "b")
Ops.get_string(@oldFcpMap, "device", "a") != Ops.get_string(@newFcpMap, "device", "b")
)
Builtins.y2milestone(
"(oldFcpMap['wwpn']:'a' != newFcpMap['wwpn']:'b') = %1",
Ops.get_string(@oldFcpMap, "wwpn", "a") !=
Ops.get_string(@newFcpMap, "wwpn", "b")
Ops.get_string(@oldFcpMap, "wwpn", "a") != Ops.get_string(@newFcpMap, "wwpn", "b")
)
Builtins.y2milestone(
"(oldFcpMap['lun']:'a' != newFcpMap['lun']:'b') = %1",
Ops.get_string(@oldFcpMap, "lun", "a") !=
Ops.get_string(@newFcpMap, "lun", "b")
Ops.get_string(@oldFcpMap, "lun", "a") != Ops.get_string(@newFcpMap, "lun", "b")
)
Builtins.y2milestone(
"(oldFcpMap['bootprog']:'a' != newFcpMap['bootprog']:'b') = %1",
Ops.get_string(@oldFcpMap, "bootprog", "a") !=
Ops.get_string(@newFcpMap, "bootprog", "b")
Ops.get_string(@oldFcpMap, "bootprog", "a") != Ops.get_string(@newFcpMap, "bootprog", "b")
)
Builtins.y2milestone(
"(oldFcpMap['br_lba']:'a' != newFcpMap['br_lba']:'b') = %1",
Ops.get_string(@oldFcpMap, "br_lba", "a") !=
Ops.get_string(@newFcpMap, "br_lba", "b")
Ops.get_string(@oldFcpMap, "br_lba", "a") != Ops.get_string(@newFcpMap, "br_lba", "b")
)
Builtins.y2milestone("different = %1", @different)

Builtins.y2milestone(
"newConfiguration['method'] : %1",
Ops.get_string(@newConfiguration, "method", "ERROR")
)
Builtins.y2milestone("newConfiguration['method'] : %1", Ops.get_string(@newConfiguration, "method", "ERROR"))
if Ops.get_string(@newConfiguration, "method", "ERROR") == "ccw"
Builtins.y2milestone("making ccw ipl text")
@dev = Builtins.substring(
Expand Down Expand Up @@ -170,14 +146,8 @@ def main
end
end

Builtins.y2milestone(
"Configuration (reIPL) has been changed: %1",
@different
)
Builtins.y2milestone(
"Configuration (reIPL) generated shutdown dialog box message: %1",
@ipl_msg
)
Builtins.y2milestone("Configuration (reIPL) has been changed: %1", @different)
Builtins.y2milestone("Configuration (reIPL) generated shutdown dialog box message: %1", @ipl_msg)

@ret = { "different" => @different, "ipl_msg" => @ipl_msg }

Expand Down
67 changes: 22 additions & 45 deletions src/clients/reipl_finish.rb
Expand Up @@ -23,89 +23,66 @@ def main
# Other architectures do not support it
if Arch.s390
@oldConfiguration = Reipl.ReadState
@newConfiguration = Reipl.ReadState

if @oldConfiguration != nil
@newConfiguration = Reipl.ModifyReiplWithBootPartition(
@newConfiguration
)
if Reipl.IPL_from_boot_zipl == false

@newConfiguration = Reipl.ReadState

@oldCcwMap = Ops.get_map(@oldConfiguration, "ccw")
@newCcwMap = Ops.get_map(@newConfiguration, "ccw")
@oldFcpMap = Ops.get_map(@oldConfiguration, "fcp")
@newFcpMap = Ops.get_map(@newConfiguration, "fcp")

@different = Ops.get_string(@oldConfiguration, "method", "a") !=
Ops.get_string(@newConfiguration, "method", "b") ||
Ops.get_string(@oldCcwMap, "device", "a") !=
Ops.get_string(@newCcwMap, "device", "b") ||
Ops.get_string(@oldCcwMap, "loadparm", "a") !=
Ops.get_string(@newCcwMap, "loadparm", "b") ||
Ops.get_string(@oldCcwMap, "parm", "a") !=
Ops.get_string(@newCcwMap, "parm", "b") ||
Ops.get_string(@oldFcpMap, "device", "a") !=
Ops.get_string(@newFcpMap, "device", "b") ||
Ops.get_string(@oldFcpMap, "wwpn", "a") !=
Ops.get_string(@newFcpMap, "wwpn", "b") ||
Ops.get_string(@oldFcpMap, "lun", "a") !=
Ops.get_string(@newFcpMap, "lun", "b") ||
Ops.get_string(@oldFcpMap, "bootprog", "a") !=
Ops.get_string(@newFcpMap, "bootprog", "b") ||
Ops.get_string(@oldFcpMap, "br_lba", "a") !=
Ops.get_string(@newFcpMap, "br_lba", "b")
@different = Ops.get_string(@oldConfiguration, "method", "a") != Ops.get_string(@newConfiguration, "method", "b") ||
Ops.get_string(@oldCcwMap, "device", "a") != Ops.get_string(@newCcwMap, "device", "b") ||
Ops.get_string(@oldCcwMap, "loadparm", "a") != Ops.get_string(@newCcwMap, "loadparm", "b") ||
Ops.get_string(@oldCcwMap, "parm", "a") != Ops.get_string(@newCcwMap, "parm", "b") ||
Ops.get_string(@oldFcpMap, "device", "a") != Ops.get_string(@newFcpMap, "device", "b") ||
Ops.get_string(@oldFcpMap, "wwpn", "a") != Ops.get_string(@newFcpMap, "wwpn", "b") ||
Ops.get_string(@oldFcpMap, "lun", "a") != Ops.get_string(@newFcpMap, "lun", "b") ||
Ops.get_string(@oldFcpMap, "bootprog", "a") != Ops.get_string(@newFcpMap, "bootprog", "b") ||
Ops.get_string(@oldFcpMap, "br_lba", "a") != Ops.get_string(@newFcpMap, "br_lba", "b")

Builtins.y2milestone(
"(oldConfiguration['method']:'a' != newConfiguration['method']:'b') = %1",
Ops.get_string(@oldConfiguration, "method", "a") !=
Ops.get_string(@newConfiguration, "method", "b")
Ops.get_string(@oldConfiguration, "method", "a") != Ops.get_string(@newConfiguration, "method", "b")
)
Builtins.y2milestone(
"(oldCcwMap['device']:'a' != newCcwMap['device']:'b') = %1",
Ops.get_string(@oldCcwMap, "device", "a") !=
Ops.get_string(@newCcwMap, "device", "b")
Ops.get_string(@oldCcwMap, "device", "a") != Ops.get_string(@newCcwMap, "device", "b")
)
Builtins.y2milestone(
"(oldCcwMap['loadparm']:'a' != newCcwMap['loadparm']:'b') = %1",
Ops.get_string(@oldCcwMap, "loadparm", "a") !=
Ops.get_string(@newCcwMap, "loadparm", "b")
Ops.get_string(@oldCcwMap, "loadparm", "a") != Ops.get_string(@newCcwMap, "loadparm", "b")
)
Builtins.y2milestone(
"(oldCcwMap['parm']:'a' != newCcwMap['parm']:'b') = %1",
Ops.get_string(@oldCcwMap, "parm", "a") !=
Ops.get_string(@newCcwMap, "parm", "b")
Ops.get_string(@oldCcwMap, "parm", "a") != Ops.get_string(@newCcwMap, "parm", "b")
)
Builtins.y2milestone(
"(oldFcpMap['device']:'a' != newFcpMap['device']:'b') = %1",
Ops.get_string(@oldFcpMap, "device", "a") !=
Ops.get_string(@newFcpMap, "device", "b")
Ops.get_string(@oldFcpMap, "device", "a") != Ops.get_string(@newFcpMap, "device", "b")
)
Builtins.y2milestone(
"(oldFcpMap['wwpn']:'a' != newFcpMap['wwpn']:'b') = %1",
Ops.get_string(@oldFcpMap, "wwpn", "a") !=
Ops.get_string(@newFcpMap, "wwpn", "b")
Ops.get_string(@oldFcpMap, "wwpn", "a") != Ops.get_string(@newFcpMap, "wwpn", "b")
)
Builtins.y2milestone(
"(oldFcpMap['lun']:'a' != newFcpMap['lun']:'b') = %1",
Ops.get_string(@oldFcpMap, "lun", "a") !=
Ops.get_string(@newFcpMap, "lun", "b")
Ops.get_string(@oldFcpMap, "lun", "a") != Ops.get_string(@newFcpMap, "lun", "b")
)
Builtins.y2milestone(
"(oldFcpMap['bootprog']:'a' != newFcpMap['bootprog']:'b') = %1",
Ops.get_string(@oldFcpMap, "bootprog", "a") !=
Ops.get_string(@newFcpMap, "bootprog", "b")
Ops.get_string(@oldFcpMap, "bootprog", "a") != Ops.get_string(@newFcpMap, "bootprog", "b")
)
Builtins.y2milestone(
"(oldFcpMap['br_lba']:'a' != newFcpMap['br_lba']:'b') = %1",
Ops.get_string(@oldFcpMap, "br_lba", "a") !=
Ops.get_string(@newFcpMap, "br_lba", "b")
Ops.get_string(@oldFcpMap, "br_lba", "a") != Ops.get_string(@newFcpMap, "br_lba", "b")
)
Builtins.y2milestone("different = %1", @different)
end

Builtins.y2milestone(
"Configuration (reIPL) has been changed: %1",
@different
)
Builtins.y2milestone("Configuration (reIPL) has been changed: %1", @different)
end

@different
Expand Down

0 comments on commit fb86296

Please sign in to comment.