Hello community, here is the log from the commit of package autoyast2 for openSUSE:13.1 checked in at 2013-09-29 17:47:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:13.1/autoyast2 (Old) and /work/SRC/openSUSE:13.1/.autoyast2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "autoyast2" Changes: -------- --- /work/SRC/openSUSE:13.1/autoyast2/autoyast2.changes 2013-09-23 10:47:34.000000000 +0200 +++ /work/SRC/openSUSE:13.1/.autoyast2.new/autoyast2.changes 2013-09-29 17:47:47.000000000 +0200 @@ -1,0 +2,18 @@ +Thu Sep 26 17:53:18 CEST 2013 - f...@suse.de + +- fixed profile lookup by IP or MAC address (bnc#842560) + +------------------------------------------------------------------- +Wed Sep 25 15:06:46 CEST 2013 - f...@suse.de + +- version 3.0.6 +- add code to support named raids (fate#315590) +- add tag "install_recommended" to prevent install of recommended + packages to software section + +------------------------------------------------------------------- +Thu Sep 19 11:41:58 CEST 2013 - f...@suse.de + +- make usage of whole disk as PVs in LVM VGs possible + +------------------------------------------------------------------- Old: ---- autoyast2-3.0.5.tar.bz2 New: ---- autoyast2-3.0.6.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ autoyast2.spec ++++++ --- /var/tmp/diff_new_pack.zD7cC2/_old 2013-09-29 17:47:47.000000000 +0200 +++ /var/tmp/diff_new_pack.zD7cC2/_new 2013-09-29 17:47:47.000000000 +0200 @@ -17,7 +17,7 @@ Name: autoyast2 -Version: 3.0.5 +Version: 3.0.6 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -38,7 +38,7 @@ Requires: yast2-core Requires: yast2-country Requires: yast2-schema -Requires: yast2-storage >= 3.0.2 +Requires: yast2-storage >= 3.0.5 Requires: yast2-transfer >= 2.21.0 Requires: yast2-xml ++++++ autoyast2-3.0.5.tar.bz2 -> autoyast2-3.0.6.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/VERSION new/autoyast2-3.0.6/VERSION --- old/autoyast2-3.0.5/VERSION 2013-09-17 15:11:48.000000000 +0200 +++ new/autoyast2-3.0.6/VERSION 2013-09-25 17:30:07.000000000 +0200 @@ -1 +1 @@ -3.0.5 +3.0.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/configure new/autoyast2-3.0.6/configure --- old/autoyast2-3.0.5/configure 2013-09-17 15:12:03.000000000 +0200 +++ new/autoyast2-3.0.6/configure 2013-09-26 17:57:02.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for autoyast2 3.0.5. +# Generated by GNU Autoconf 2.69 for autoyast2 3.0.6. # # Report bugs to <http://bugs.opensuse.org/>. # @@ -579,8 +579,8 @@ # Identity of this package. PACKAGE_NAME='autoyast2' PACKAGE_TARNAME='autoyast2' -PACKAGE_VERSION='3.0.5' -PACKAGE_STRING='autoyast2 3.0.5' +PACKAGE_VERSION='3.0.6' +PACKAGE_STRING='autoyast2 3.0.6' PACKAGE_BUGREPORT='http://bugs.opensuse.org/' PACKAGE_URL='' @@ -1249,7 +1249,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures autoyast2 3.0.5 to adapt to many kinds of systems. +\`configure' configures autoyast2 3.0.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1320,7 +1320,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of autoyast2 3.0.5:";; + short | recursive ) echo "Configuration of autoyast2 3.0.6:";; esac cat <<\_ACEOF @@ -1400,7 +1400,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -autoyast2 configure 3.0.5 +autoyast2 configure 3.0.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1417,7 +1417,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by autoyast2 $as_me 3.0.5, which was +It was created by autoyast2 $as_me 3.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2356,7 +2356,7 @@ # Define the identity of the package. PACKAGE='autoyast2' - VERSION='3.0.5' + VERSION='3.0.6' cat >>confdefs.h <<_ACEOF @@ -2479,7 +2479,7 @@ -VERSION="3.0.5" +VERSION="3.0.6" RPMNAME="autoyast2" MAINTAINER="Thomas Fehr <f...@suse.de>" @@ -3436,7 +3436,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by autoyast2 $as_me 3.0.5, which was +This file was extended by autoyast2 $as_me 3.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -3489,7 +3489,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -autoyast2 config.status 3.0.5 +autoyast2 config.status 3.0.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/configure.ac new/autoyast2-3.0.6/configure.ac --- old/autoyast2-3.0.5/configure.ac 2013-09-17 15:11:59.000000000 +0200 +++ new/autoyast2-3.0.6/configure.ac 2013-09-26 17:56:59.000000000 +0200 @@ -3,7 +3,7 @@ dnl -- This file is generated by y2autoconf 3.0.5 - DO NOT EDIT! -- dnl (edit configure.ac.in or configure.in.in instead) -AC_INIT(autoyast2, 3.0.5, http://bugs.opensuse.org/, autoyast2) +AC_INIT(autoyast2, 3.0.6, http://bugs.opensuse.org/, autoyast2) dnl Check for presence of file 'RPMNAME' AC_CONFIG_SRCDIR([RPMNAME]) @@ -18,7 +18,7 @@ AM_INIT_AUTOMAKE(tar-ustar -Wno-portability) dnl Important YaST2 variables -VERSION="3.0.5" +VERSION="3.0.6" RPMNAME="autoyast2" MAINTAINER="Thomas Fehr <f...@suse.de>" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/autoyast-rnc/partitioning.rnc new/autoyast2-3.0.6/src/autoyast-rnc/partitioning.rnc --- old/autoyast2-3.0.5/src/autoyast-rnc/partitioning.rnc 2013-07-30 13:01:30.000000000 +0200 +++ new/autoyast2-3.0.6/src/autoyast-rnc/partitioning.rnc 2013-09-25 17:30:07.000000000 +0200 @@ -94,8 +94,9 @@ opt_raid = element opt_raid { option_str, option_value } opt_reserved_blocks = element opt_reserved_blocks { option_str, option_value } +part_raid_name = element raid_name { text } -part_raid_options = element raid_options { persistent_superblock? & chunk_size? & parity_algorithm? & raid_type? & device_order? } +part_raid_options = element raid_options { persistent_superblock? & chunk_size? & parity_algorithm? & raid_type? & device_order? & part_raid_name? } persistent_superblock = element persistent_superblock { BOOLEAN } raid_type = element raid_type { text } chunk_size = element chunk_size { text } @@ -121,7 +122,6 @@ element option_blank { BOOLEAN } option_str = element option_str { text } option_value = element option_value { text } -part_raid_name = element raid_name { text } part_raid_type = element raid_type { text } part_partition_nr = element partition_nr { INTEGER } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/autoyast-rnc/software.rnc new/autoyast2-3.0.6/src/autoyast-rnc/software.rnc --- old/autoyast2-3.0.5/src/autoyast-rnc/software.rnc 2013-07-30 13:01:30.000000000 +0200 +++ new/autoyast2-3.0.6/src/autoyast-rnc/software.rnc 2013-09-25 15:11:50.000000000 +0200 @@ -14,6 +14,7 @@ products? & remove-products? & element do_online_update { BOOLEAN }? & + element install_recommended { BOOLEAN }? & element instsource {text}? } patterns = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/include/autoinstall/autopart.rb new/autoyast2-3.0.6/src/include/autoinstall/autopart.rb --- old/autoyast2-3.0.5/src/include/autoinstall/autopart.rb 2013-07-30 13:01:30.000000000 +0200 +++ new/autoyast2-3.0.6/src/include/autoinstall/autopart.rb 2013-09-23 13:45:19.000000000 +0200 @@ -1320,7 +1320,7 @@ deep_copy(conf) end def get_perfect_list(ps, g) - ps = deep_copy(ps) + ps = ps.reject { |p| p.fetch("partition_nr",1)==0 } g = deep_copy(g) Builtins.y2milestone("requested partitions %1", ps) Builtins.y2milestone("calculated gaps %1", g) @@ -1470,8 +1470,7 @@ new_ps, free_pnr ) - if Ops.greater_than(Builtins.size(Ops.get_list(g, "gap", [])), 0) && - Ops.less_or_equal(new_ps, free_pnr) + if new_ps>0 && g.fetch("gap", []).size>0 && new_ps<=free_pnr lg = Builtins.eval(g) # prepare local gap var @@ -1502,12 +1501,10 @@ add_prim, Builtins.size(Ops.get_list(g, "free_pnr", [])) ) - if Ops.get_boolean(g, "extended_possible", false) && - Ops.greater_than(Builtins.size(Ops.get_list(g, "free_pnr", [])), 0) && - Ops.less_than( - add_prim, - Builtins.size(Ops.get_list(g, "free_pnr", [])) - ) + if g.fetch("extended_possible",false) && + g.fetch("free_pnr",[]).size>0 && + add_prim<g.fetch("free_pnr",[]).size && + new_ps>add_prim Builtins.y2milestone("creating extended") index = 0 Builtins.foreach(Ops.get_list(lg, "gap", [])) do |e| @@ -1549,10 +1546,14 @@ end end ret = {} - if Ops.greater_than(Builtins.size(@cur_gap), 0) - Ops.set(ret, "weight", @cur_weight) - Ops.set(ret, "solution", Builtins.eval(@cur_gap)) - Ops.set(ret, "partitions", Builtins.eval(ps)) + if @cur_gap.size>0 + ret["weight"] = @cur_weight + ret["solution"] = @cur_gap + ret["partitions"] = ps + elsif ps.size==0 + ret["weight"] = 0 + ret["solution"] = [] + ret["partitions"] = [] end Builtins.y2milestone( "ret weight %1", @@ -1873,41 +1874,11 @@ # } # gindex = gindex + 1; # }); - Builtins.foreach(Ops.get_list(g, "gap", [])) do |e| - if !Ops.get_boolean(e, "exists", false) && - Ops.greater_than(Builtins.size(Ops.get_list(e, "added", [])), 1) - Builtins.y2milestone( - "normalize_gaps old added %1", - Ops.get_list(e, "added", []) - ) - nums = Builtins.maplist(Ops.get_list(e, "added", [])) do |l| - Ops.get_integer(l, 1, -1) - end - Builtins.y2milestone("normalize_gaps old nums %1", nums) - sdd = Builtins.sort(Ops.get_list(e, "added", [])) do |a, b| - ba = Ops.get_string( - ps, - [Ops.get_integer(a, 0, 0), "partition_type"], - "" - ) == "primary" - bb = Ops.get_string( - ps, - [Ops.get_integer(b, 0, 0), "partition_type"], - "" - ) == "primary" - Builtins.y2milestone("ba:%1 bb:%2", ba, bb) - if ba && !bb - next true - else - next false - end - end - idx = 0 - Builtins.foreach( - Convert.convert(sdd, :from => "list", :to => "list <list>") - ) do |e2| - Ops.set(sdd, [idx, 1], Ops.get_integer(nums, idx, 0)) - idx = Ops.add(idx, 1) + Builtins.foreach(g.fetch("gap",[])) do |e| + if !e.fetch("exists",false) && e.fetch("added",[]).size>1 + Builtins.y2milestone( "normalize_gaps old added %1", e.fetch("added",[])) + sdd = Builtins.sort(e.fetch("added",[])) do |a, b| + a.fetch(1,0)<=b.fetch(1,0) end Ops.set(g, ["gap", gindex, "added"], sdd) Builtins.y2milestone( @@ -1915,7 +1886,7 @@ Ops.get_list(g, ["gap", gindex, "added"], []) ) end - gindex = Ops.add(gindex, 1) + gindex += 1 end Builtins.y2milestone("normalize_gaps ret %1", g) deep_copy(g) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/modules/AutoInstallRules.rb new/autoyast2-3.0.6/src/modules/AutoInstallRules.rb --- old/autoyast2-3.0.5/src/modules/AutoInstallRules.rb 2013-08-28 16:51:45.000000000 +0200 +++ new/autoyast2-3.0.6/src/modules/AutoInstallRules.rb 2013-09-26 17:56:48.000000000 +0200 @@ -151,9 +151,14 @@ def getMAC tmpmac = "" if Stage.initial - tmpmac = Convert.to_string(SCR.Read(path(".etc.install_inf.HWAddr"))) - end - cleanmac = Builtins.deletechars(tmpmac != nil ? tmpmac : "", ":") + cmd = 'ip link show | grep link/ether | head -1 | sed -e "s:^.*link/ether.::" -e "s: .*::"' + ret = SCR.Execute(path(".target.bash_output"), cmd ) + Builtins.y2milestone("mac Addr ret:%1", ret) + tmpmac = ret.fetch("stdout","") + end + Builtins.y2milestone("mac Addr tmp:%1", tmpmac) + cleanmac = Builtins.deletechars(tmpmac != nil ? tmpmac : "", ":\n") + Builtins.y2milestone("mac Addr mac:%1", cleanmac) cleanmac end @@ -161,6 +166,11 @@ # Return host id (hex ip ) # @return [String] host ID def getHostid + if Stage.initial + @hostaddress = Convert.to_string(SCR.Read(path(".etc.install_inf.IP"))) + else + @hostaddress = "192.168.1.1" # FIXME + end hex = IP.ToHex(@hostaddress) hex end @@ -275,11 +285,6 @@ # # Network # - if Stage.initial - @hostaddress = Convert.to_string(SCR.Read(path(".etc.install_inf.IP"))) - else - @hostaddress = "192.168.1.1" # FIXME - end Ops.set(@ATTR, "hostaddress", @hostaddress) # @@ -1105,6 +1110,7 @@ def AutoInstallRules @mac = getMAC @hostid = getHostid + Builtins.y2milestone("init mac:%1 histid:%2", @mac, @hostid) nil end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/modules/AutoinstClone.rb new/autoyast2-3.0.6/src/modules/AutoinstClone.rb --- old/autoyast2-3.0.5/src/modules/AutoinstClone.rb 2013-08-28 16:41:44.000000000 +0200 +++ new/autoyast2-3.0.6/src/modules/AutoinstClone.rb 2013-09-24 13:41:49.000000000 +0200 @@ -42,7 +42,6 @@ # aditional configuration resources o be cloned @additional = [] - AutoinstClone() end # Detects whether the current system uses multipath @@ -220,7 +219,6 @@ publish :variable => :Profile, :type => "map" publish :variable => :base, :type => "list <string>" publish :variable => :additional, :type => "list <string>" - publish :function => :AutoinstClone, :type => "void ()" publish :function => :General, :type => "map ()" publish :function => :createClonableList, :type => "list ()" publish :function => :Process, :type => "void ()" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/modules/AutoinstPartPlan.rb new/autoyast2-3.0.6/src/modules/AutoinstPartPlan.rb --- old/autoyast2-3.0.5/src/modules/AutoinstPartPlan.rb 2013-07-30 13:01:30.000000000 +0200 +++ new/autoyast2-3.0.6/src/modules/AutoinstPartPlan.rb 2013-09-25 17:30:07.000000000 +0200 @@ -339,9 +339,12 @@ StorageDevices.InitDone _StorageMap = Builtins.eval(Storage.GetTargetMap) - _StorageMap = Builtins.filter(_StorageMap) do |d, p| - d != "/dev/evms" && d != "/dev/nfs" && - Ops.greater_than(Builtins.size(Ops.get_list(p, "partitions", [])), 0) + _StorageMap = _StorageMap.select do |d, p| + ok = d != "/dev/evms" && d != "/dev/nfs" + if( ok && p.fetch("partitions", []).size==0 ) + ok = p.fetch("used_by_type",:UB_NONE)==:UB_LVM + end + ok end Builtins.y2milestone("Storagemap %1", _StorageMap) # list evms_vgs = []; @@ -567,22 +570,13 @@ end if k == "/dev/md" raid_options = {} - Ops.set( - raid_options, - "persistent_superblock", - Ops.get_boolean(pe, "persistent_superblock", false) - ) - Ops.set( - raid_options, - "raid_type", - Ops.get_string(pe, "raid_type", "raid0") - ) - Ops.set( - raid_options, - "device_order", - Ops.get_list(pe, "devices", []) - ) - Ops.set(new_pe, "raid_options", raid_options) + raid_options["persistent_superblock"] = pe.fetch("persistent_superblock",false) + raid_options["raid_type"] = pe.fetch("raid_type", "raid0") + raid_options["device_order"] = pe.fetch("devices",[]) + if pe["device"].start_with?("/dev/md/") + raid_options["raid_name"] = pe["device"] + end + new_pe["raid_options"]=raid_options end if !skipwin && Ops.get_integer(new_pe, "partition_id", 0) != 15 partitions = Builtins.add(partitions, new_pe) @@ -600,6 +594,13 @@ deep_copy(m) end end + if( v.fetch("used_by_type",:UB_NONE)==:UB_LVM && partitions.empty? ) + partitions = [{ "partition_nr" => 0, "create" => false, + "lvm_group" => v.fetch("used_by_device", "")[5..-1], + "size" => "max" }] + Builtins.y2milestone( "lvm full disk v:%1", v ) + Builtins.y2milestone( "lvm full disk p:%1", partitions ) + end Ops.set(drive, "partitions", partitions) if Arch.s390 && Ops.get_symbol(v, "type", :CT_DISK) == :CT_DISK Ops.set( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/modules/AutoinstPartition.rb new/autoyast2-3.0.6/src/modules/AutoinstPartition.rb --- old/autoyast2-3.0.5/src/modules/AutoinstPartition.rb 2013-07-30 13:01:30.000000000 +0200 +++ new/autoyast2-3.0.6/src/modules/AutoinstPartition.rb 2013-09-25 17:30:07.000000000 +0200 @@ -331,11 +331,6 @@ "raid_name", Ops.get_string(part, "raid_name", "") ) - newPart = set( - newPart, - "raid_type", - Ops.get_string(part, "raid_type", "raid0") - ) end if Builtins.haskey(part, "raid_options") newPart = set( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/modules/AutoinstRAID.rb new/autoyast2-3.0.6/src/modules/AutoinstRAID.rb --- old/autoyast2-3.0.5/src/modules/AutoinstRAID.rb 2013-07-30 13:01:30.000000000 +0200 +++ new/autoyast2-3.0.6/src/modules/AutoinstRAID.rb 2013-09-25 17:30:07.000000000 +0200 @@ -169,11 +169,11 @@ _RaidList = Builtins.maplist(raid_partitions) do |md| use = Ops.get_string(@raid, ["/dev/md", "use"], "none") - dev = Builtins.sformat( - "/dev/md%1", - Ops.get_integer(md, "partition_nr", 0) - ) - Ops.set(md, "device", dev) + dev = md.fetch("raid_options",{})["raid_name"] + if !dev || dev.empty? + dev = "/dev/md"+md.fetch("partition_nr", 0).to_s + end + md["device"] = dev if Ops.get_symbol(md, "enc_type", :none) != :none Storage.SetCryptPwd(dev, Ops.get_string(md, "crypt_key", "")) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/modules/AutoinstSoftware.rb new/autoyast2-3.0.6/src/modules/AutoinstSoftware.rb --- old/autoyast2-3.0.5/src/modules/AutoinstSoftware.rb 2013-09-17 15:11:48.000000000 +0200 +++ new/autoyast2-3.0.6/src/modules/AutoinstSoftware.rb 2013-09-25 15:11:50.000000000 +0200 @@ -797,15 +797,13 @@ ok = true Packages.Init(true) - Pkg.SetSolverFlags({ "ignoreAlreadyRecommended" => Mode.normal }) + sw_settings = Profile.current.fetch("software",{}) + Pkg.SetSolverFlags({ "ignoreAlreadyRecommended" => Mode.normal, + "onlyRequires" => !sw_settings.fetch("install_recommended",true) }) failed = [] # switch for recommended patterns installation (workaround for our very weird pattern design) - if Ops.get_boolean( - Profile.current, - ["software", "install_recommended"], - false - ) == false + if sw_settings.fetch("install_recommended",false) == false # set SoftLock to avoid the installation of recommended patterns (#159466) Builtins.foreach(Pkg.ResolvableProperties("", :pattern, "")) do |p| Pkg.ResolvableSetSoftLock(Ops.get_string(p, "name", ""), :pattern) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/autoyast2-3.0.5/src/modules/AutoinstStorage.rb new/autoyast2-3.0.6/src/modules/AutoinstStorage.rb --- old/autoyast2-3.0.5/src/modules/AutoinstStorage.rb 2013-07-30 13:01:30.000000000 +0200 +++ new/autoyast2-3.0.6/src/modules/AutoinstStorage.rb 2013-09-25 17:30:07.000000000 +0200 @@ -265,13 +265,15 @@ Ops.get_list(p, ["raid_options", "device_order"], []) != [] counter = Ops.get_integer(p, "partition_nr", counter) order = Ops.get_list(p, ["raid_options", "device_order"], []) + dev = "/dev/md"+counter.to_s; + if p["raid_options"] && p["raid_options"].has_key?("raid_name") && + !p["raid_options"]["raid_name"].empty? + dev = p["raid_options"]["raid_name"] + end Builtins.y2milestone( - "found device_order %1 in raidoptions for /dev/md%2", - order, - counter - ) - Ops.set(@raid2device, Builtins.sformat("/dev/md%1", counter), order) - Ops.set(already_mapped, Builtins.sformat("/dev/md%1", counter), true) + "found device_order %1 in raidoptions for %2", order, dev) + @raid2device[dev] = order + already_mapped[dev] = true end counter = Ops.add(counter, 1) end @@ -1091,38 +1093,36 @@ Builtins.y2milestone("AutoTargetMap: %1", @AutoTargetMap) # return list of available devices - disk_devices = Builtins.maplist(Builtins.filter(Storage.GetTargetMap) do |l, f| - Storage.IsRealDisk(f) - end) { |k, e| k } - + disk_devices = initial_target_map.select do |l, f| + Storage.IsRealDisk(f) + end.keys Builtins.y2milestone("disk_devices: %1", disk_devices) result = false - + changed = false Builtins.foreach(@AutoTargetMap) do |device, data| - if Storage.IsRealDisk(data) && - Ops.get_boolean(data, "initialize", false) == true + if Storage.IsRealDisk(data) && data.fetch("initialize", false) Ops.set(initial_target_map, [device, "delete"], true) - if Builtins.haskey(data, "disklabel") + changed = true + if data.has_key?("disklabel") Ops.set( initial_target_map, [device, "disklabel"], - Ops.get_string(data, "disklabel", "msdos") + data.fetch("disklabel", "msdos") ) end - Storage.SetTargetMap(initial_target_map) end end - Builtins.y2milestone( - "Target map after initialzing disk: %1", - Storage.GetTargetMap - ) + if changed + Storage.SetTargetMap(initial_target_map) if changed + Builtins.y2milestone( "Target map after initializing disk: %1", Storage.GetTargetMap) + end Builtins.foreach(@AutoTargetMap) do |device, data| if Ops.greater_than( - Builtins.size(Builtins.filter(Ops.get_list(data, "partitions", [])) do |e| - Ops.get_string(e, "mount", "") == Partitions.BootMount || - Ops.get_integer(e, "partition_id", 0) == Partitions.FsidBoot && + Builtins.size(Builtins.filter(data.fetch("partitions",[])) do |e| + e.fetch("mount","") == Partitions.BootMount || + e.fetch("partition_id",0) == Partitions.FsidBoot && Partitions.FsidBoot != 131 end), 0 @@ -1133,9 +1133,10 @@ end Builtins.y2milestone("plan has boot: %1", @planHasBoot) + tm = Storage.GetTargetMap + changed = false Builtins.foreach(@AutoTargetMap) do |device, data| - if !Builtins.haskey(Storage.GetTargetMap, device) && - Ops.get_symbol(data, "type", :CT_DISK) == :CT_DISK + if !tm.has_key?(device) && data.fetch("type",:CT_DISK)==:CT_DISK Report.Error( Builtins.sformat( _("device '%1' not found by storage backend"), @@ -1145,24 +1146,22 @@ Builtins.y2milestone("device %1 not found in TargetMap", device) end if Storage.IsRealDisk(data) - @ZeroNewPartitions = Ops.get_boolean( - data, - "zero_new_partitions", - true - ) # that's not really nice. Just an undocumented fallback which should never be used + @ZeroNewPartitions = data.fetch("zero_new_partitions",true) + # that's not really nice. Just an undocumented fallback which should never be used Builtins.y2milestone("Creating partition plans for %1", device) - sol = find_matching_disk([device], Storage.GetTargetMap, data) - result = true if Ops.greater_than(Builtins.size(sol), 0) + sol = find_matching_disk([device], tm, data) + result = true if sol.size>0 Builtins.y2milestone("solutions: %1", sol) - tm = Storage.GetTargetMap - Ops.set(tm, device, process_partition_data(device, sol)) - + Builtins.y2milestone("disk: %1", tm[device]) + tm[device] = process_partition_data(device, sol) + changed = true SearchRaids(tm) - Storage.SetTargetMap(tm) + Builtins.y2milestone("disk: %1", tm[device]) end end + Storage.SetTargetMap(tm) if changed if Builtins.haskey(@AutoTargetMap, "/dev/nfs") Builtins.y2milestone("nfs:%1", Ops.get(@AutoTargetMap, "/dev/nfs", {})) -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org