Skip to content

Commit

Permalink
taking Martins suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Jul 20, 2016
1 parent 256d506 commit d48a2c8
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
31 changes: 14 additions & 17 deletions src/modules/AutoinstDrive.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -336,21 +336,20 @@
newDrive = set( newDrive, "initialize", drive["initialize"]:true );
newDrive = set( newDrive, "use", string2symbol( drive["use"]:"all" ));
newDrive = set( newDrive, "pesize", drive["pesize"]:"" );
if( drive["type"]:`x == `CT_NFS ){
newDrive["initialize"] = false; // Do not initialize
# If it is a root nfs partition we do not need any additional
# partition conversation. (bnc#986124)
newDrive["partitions"] = drive["partitions"]:[];
if( drive["type"]:`x == `CT_NFS ) {
newDrive = set( newDrive, "initialize", false); // Do not initialize
// If it is a root nfs partition we do not need any additional
// partition conversation. (bnc#986124)
newDrive = set( newDrive, "partitions", drive["partitions"]:[]);
} else {
foreach( map part, drive["partitions"]:[], {
PartitionT newPart = AutoinstPartition::parsePartition( part );
if( AutoinstPartition::isPartition( newPart ) ){
newDrive = addPartition( newDrive, newPart );
}
else{
y2error("Couldn't construct PartitionT from '%1'", part );
}
});
foreach( map part, drive["partitions"]:[], {
PartitionT newPart = AutoinstPartition::parsePartition( part );
if( AutoinstPartition::isPartition( newPart ) ){
newDrive = addPartition( newDrive, newPart );
} else {
y2error("Couldn't construct PartitionT from '%1'", part );
}
});
}
return newDrive;
}
Expand All @@ -368,9 +367,7 @@
/* get rid of id */
map exportDrive = remove( drive, "_id" );
/* translate e.g. `all to "all" */
if( is( exportDrive["use"]:`Empty, symbol ) ){
exportDrive["use"] = symbol2string( exportDrive["use"]:`Empty );
}
exportDrive["use"] = symbol2string( exportDrive["use"]:`Empty );
/* let AutoinstPartition do it's own filtering */
exportDrive["partitions"] =
maplist( PartitionT part, exportDrive["partitions"]:[], {
Expand Down
44 changes: 23 additions & 21 deletions src/modules/AutoinstPartPlan.ycp
Original file line number Diff line number Diff line change
Expand Up @@ -357,23 +357,25 @@
{
Mode::SetMode("normal");
StorageDevices::InitDone();
map<string, map> StorageMap = eval(Storage::GetTargetMap());
map<string, map> StorageMap = eval(Storage::GetTargetMap());

StorageMap=filter(string d, map p, StorageMap, ``{
boolean ok = (d != "/dev/evms" && d != "/dev/tmpfs" && size(p["partitions"]:[]) > 0);
if( ok && d == "/dev/nfs" ){
// Checking if /dev/nfs container has a root partition.
// If yes, it can be taken for the plan (bnc#986124)
ok = false;
foreach(map part, p["partitions"]:[], ``{
if( part["mount"]:"" == "/" ){
ok = true;
break;
}
});
}
return ok;
});
boolean ok = ( d != "/dev/evms" &&
d != "/dev/tmpfs" &&
size(p["partitions"]:[]) > 0 );
if( ok && d == "/dev/nfs" ) {
// Checking if /dev/nfs container has a root partition.
// If yes, it can be taken for the plan (bnc#986124)
ok = false;
foreach(map part, p["partitions"]:[], ``{
if( part["mount"]:"" == "/" ) {
ok = true;
break;
}
});
}
return ok;
});
y2milestone("Storagemap %1", StorageMap);
// list evms_vgs = [];

Expand All @@ -391,12 +393,12 @@
map new_pe = $[];
// Handling /dev/nfs containers (bnc#986124)
if( pe["type"]:`x == `nfs ) {
new_pe["type"] = pe["type"]:`nfs;
new_pe["device"] = pe["device"]:"";
new_pe["mount"] = pe["mount"]:"";
new_pe["fstopt"] = pe["fstopt"]:"";
partitions=add(partitions,new_pe);
continue;
new_pe["type"] = pe["type"]:`nfs;
new_pe["device"] = pe["device"]:"";
new_pe["mount"] = pe["mount"]:"";
new_pe["fstopt"] = pe["fstopt"]:"";
partitions = add(partitions,new_pe);
continue;
}
new_pe["create"] = true;
boolean skipwin = false;
Expand Down

0 comments on commit d48a2c8

Please sign in to comment.