Author: kmachalkova
Date: Thu Dec 11 11:24:54 2008
New Revision: 54043
URL: http://svn.opensuse.org/viewcvs/yast?rev=54043&view=rev
Log:
handle renaming NFS share (changing server name)
- delete the old and create the new
Modified:
trunk/storage/storage/src/include/ep-nfs.ycp
Modified: trunk/storage/storage/src/include/ep-nfs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-nfs.ycp?rev=54043&r1=54042&r2=54043&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-nfs.ycp (original)
+++ trunk/storage/storage/src/include/ep-nfs.ycp Thu Dec 11 11:24:54 2008
@@ -129,24 +129,31 @@
{
y2milestone("Changing NFS share: %1 mountpoint: %2 options: %3",
entry["device"]:"", entry["mount"]:"", entry["fstopt"]:"");
- //FIXME: renaming the device is not handled
- //we have to delete the dev with old name
- //and create a new one
- string dev = entry["device"]:"";
- target_map = Storage::GetTargetMap();
- list<map> nfs_list = target_map["/dev/nfs", "partitions"]:[];
-
- nfs_list = maplist ( map m, nfs_list, {
- if( m["device"]:"" == dev)
- {
- m["fstopt"] = entry["fstopt"]:"";
- m["mount"] = entry["mount"]:"";
- }
- return m;
- });
- target_map["/dev/nfs", "partitions"] = nfs_list;
- Storage::SetTargetMap( target_map );
+ //device got renamed -
+ //delete the one with old name and create new
+ if (haskey(entry,"old_device"))
+ {
+ Storage::DeleteDevice("/dev/nfs", entry["old_device"]:"");
+ AddShare(entry);
+ }
+ else
+ {
+ string dev = entry["device"]:"";
+ target_map = Storage::GetTargetMap();
+ list<map> nfs_list = target_map["/dev/nfs", "partitions"]:[];
+
+ nfs_list = maplist ( map m, nfs_list, {
+ if( m["device"]:"" == dev)
+ {
+ m["fstopt"] = entry["fstopt"]:"";
+ m["mount"] = entry["mount"]:"";
+ }
+ return m;
+ });
+ target_map["/dev/nfs", "partitions"] = nfs_list;
+ Storage::SetTargetMap( target_map );
+ }
}
void DeleteShare( map