Author: aschnell
Date: Mon May 18 14:00:59 2009
New Revision: 57228
URL: http://svn.opensuse.org/viewcvs/yast?rev=57228&view=rev
Log:
- use used_by_device instead of used_by
- some cleanup
Modified:
trunk/storage/storage/src/modules/Storage.ycp
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=57228&r1=57227&r2=57228&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Mon May 18 14:00:59 2009
@@ -789,31 +789,29 @@
return ret;
}
-global define list GetDestroyedLvmVgs( map target )
- ``{
- list vgs = [];
- foreach(string diskdev, map disk, target,
- ``{
- foreach( map p, disk["partitions"]:[],
- ``{
+
+list<string> GetDestroyedLvmVgs(map target)
+{
+ list<string> vgs = [];
+ foreach(string diskdev, map disk, target, {
+ foreach( map p, disk["partitions"]:[], {
if( p["used_by_type"]:`UB_NONE==`UB_LVM && p["format"]:false )
- {
- vgs = union( vgs, [ p["used_by"]:"" ] );
- }
- });
- });
- vgs = sort( vgs );
+ {
+ vgs = add(vgs, p["used_by_device"]:"");
+ }
+ });
+ });
+ vgs = toset(vgs);
y2milestone( "GetDestroyedLvmVgs %1", vgs );
- return( vgs );
- }
+ return vgs;
+}
-global define map DeleteDestroyedLvmVgs( map target )
- ``{
- list<string> vgs = maplist( string s, (list<string>)GetDestroyedLvmVgs( target ),
- ``("/dev/"+s));
+
+global map DeleteDestroyedLvmVgs(map target)
+{
+ list<string> vgs = GetDestroyedLvmVgs(target);
y2milestone( "DeleteDestroyedLvmVgs %1", vgs );
- foreach( string dev, vgs,
- ``{
+ foreach(string dev, vgs, {
if( haskey( target, dev ))
target[dev,"delete"] = true;
target[dev,"partitions"] = maplist( map p, target[dev,"partitions"]:[],
@@ -823,9 +821,10 @@
return( p );
});
y2milestone( "DeleteDestroyedLvmVgs %1: %2", dev, target[dev]:$[] );
- });
- return( target );
- }
+ });
+ return target;
+}
+
/**
* Returns map of free space per partition
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org