Author: aschnell
Date: Thu Mar 18 11:44:43 2010
New Revision: 61370
URL: http://svn.opensuse.org/viewcvs/yast?rev=61370&view=rev
Log:
- rewrote generation of proposal_name
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/modules/Storage.ycp
trunk/storage/storage/src/modules/StorageDevices.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=61370&r1=61369&r2=61370&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Thu Mar 18 11:44:43 2010
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Mar 18 11:29:58 CET 2010 - aschnell@suse.de
+
+- fixed proposal name for DM and MD RAIDs
+
+-------------------------------------------------------------------
Tue Mar 16 13:07:13 CET 2010 - aschnell@suse.de
- handle udev names for partition with installation source (bnc
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=61370&r1=61369&r2=61370&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Thu Mar 18 11:44:43 2010
@@ -3197,6 +3197,74 @@
}
+map AddProposalName(map target_map)
+{
+ integer ide_disk_count = 0;
+ integer scsi_disk_count = 0;
+ integer generic_disk_count = 0;
+ integer dm_raid_count = 0;
+ integer md_raid_count = 0;
+
+ return mapmap(string device, map disk, target_map, {
+
+ string s = Storage::KByteToHumanString(disk["size_k"]:0);
+
+ switch (disk["type"]:`CT_UNKNOWN)
+ {
+ case `CT_DISK:
+ {
+ string proposal_name = "";
+
+ string bus = disk["bus"]:"";
+ if (bus == "IDE") {
+ ide_disk_count = ide_disk_count + 1;
+ proposal_name = sformat("%1. ", ide_disk_count) + _("IDE Disk");
+ } else if (bus == "SCSI") {
+ scsi_disk_count = scsi_disk_count + 1;
+ proposal_name = sformat("%1. ", scsi_disk_count) + _("SCSI Disk");
+ } else {
+ generic_disk_count = generic_disk_count + 1;
+ proposal_name = sformat("%1. ", generic_disk_count) + _("Disk");
+ }
+
+ proposal_name = proposal_name + ", " + s + ", " + device + ", ";
+
+ if (!isempty(disk["vendor"]:""))
+ proposal_name = proposal_name + disk["vendor"]:"" + "-";
+ proposal_name = proposal_name + disk["model"]:"";
+
+ disk["proposal_name"] = proposal_name;
+ }
+ break;
+
+ case `CT_DMRAID:
+ {
+ dm_raid_count = dm_raid_count + 1;
+ string proposal_name = sformat("%1. ", dm_raid_count) + _("DM RAID");
+
+ proposal_name = proposal_name + ", " + s + ", " + device;
+
+ disk["proposal_name"] = proposal_name;
+ }
+ break;
+
+ case `CT_MDPART:
+ {
+ md_raid_count = md_raid_count + 1;
+ string proposal_name = sformat("%1. ", md_raid_count) + _("MD RAID");
+
+ proposal_name = proposal_name + ", " + s + ", " + device;
+
+ disk["proposal_name"] = proposal_name;
+ }
+ break;
+ }
+
+ return $[ device : disk ];
+ });
+}
+
+
/**
* Returns a system target map.
*
@@ -3270,29 +3338,16 @@
{
probe_done = true;
changed = true;
- foreach( string dev, map disk, tmp,
- ``{
- disk = getDiskInfo( dev, disk );
- integer s = disk["size_k"]:0 * 1024;
- string proposal_name = disk["dname"]:"" +
- Storage::ByteToHumanString( s ) + ", " +
- disk["device"]:"" + ", ";
- if( size( disk["vendor"]:"")>0 )
- proposal_name = proposal_name + disk["vendor"]:"" + "-";
- proposal_name = proposal_name + disk["model"]:"";
- disk["proposal_name"] = proposal_name;
- if( haskey( disk, "dname" ))
- disk = remove( disk, "dname" );
- tmp[dev] = disk;
+ foreach (string dev, map disk, tmp, {
+ tmp[dev] = getDiskInfo(dev, disk);
if( disk["dasdfmt"]:false )
Storage::InitializeDisk( dev, true );
});
- foreach( map c, conts,
- ``{
+ foreach (map c, conts, {
if( c["type"]:`CT_UNKNOWN!=`CT_DISK )
tmp[c["device"]:""] = getContainerInfo( c );
});
- if( size(bios_id_raid)>0 )
+ if (!isempty(bios_id_raid))
{
y2milestone( "bios_id_raid:%1", bios_id_raid );
foreach( string dm, string bios, bios_id_raid, {
@@ -3313,6 +3368,8 @@
});
});
}
+ if (Stage::initial())
+ tmp = AddProposalName(tmp);
StorageMap[targets_key] = tmp;
}
}
Modified: trunk/storage/storage/src/modules/StorageDevices.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/StorageDevices.ycp?rev=61370&r1=61369&r2=61370&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/StorageDevices.ycp (original)
+++ trunk/storage/storage/src/modules/StorageDevices.ycp Thu Mar 18 11:44:43 2010
@@ -464,55 +464,12 @@
if( no_disk )
continue;
- string bus = disk["bus"]:"?";
- string dname = "";
- integer i = 0;
-
// write out data for hardware status check
HwStatus::Set (disk["unique_key"]:"", `yes);
target["unique"] = disk["unique_key"]:"";
- // ------------------------------------------------------
- // check bus, count disks per bus
-
- if (bus == "IDE")
- {
- ide_count = ide_count + 1;
- i = ide_count;
- }
- else if (bus == "SCSI")
- {
- scsi_count = scsi_count + 1;
- i = scsi_count;
- }
- else if (bus == "RAID")
- {
- raid_count = raid_count + 1;
- i = raid_count;
- }
- else
- {
- other_count = other_count + 1;
- i = other_count;
- }
-
- target["bus"] = bus;
-
- // ------------------------------------------------------
- // construct disk name for user
-
- dname = ""+i+". ";
- if( bus != "None" )
- {
- dname = dname + bus;
- }
- else
- {
- dname = dname + "Disk";
- }
- dname = dname + ", ";
- target["dname"] = dname;
+ target["bus"] = disk["bus"]:"?";
// needed also later as key
string ddevice = disk["dev_name"]:"";
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org