Author: kmachalkova Date: Mon Apr 14 19:03:50 2008 New Revision: 46616 URL: http://svn.opensuse.org/viewcvs/yast?rev=46616&view=rev Log: nfsv4 support (fate #302031) Modified: trunk/nfs-client/src/Nfs.ycp trunk/nfs-client/src/ui.ycp trunk/nfs-client/testsuite/tests/r-fstab.out trunk/nfs-client/testsuite/tests/r-fstab.ycp trunk/nfs-client/testsuite/tests/readwrite.ycp Modified: trunk/nfs-client/src/Nfs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/src/Nfs.ycp?rev=46616&... ============================================================================== --- trunk/nfs-client/src/Nfs.ycp (original) +++ trunk/nfs-client/src/Nfs.ycp Mon Apr 14 19:03:50 2008 @@ -26,6 +26,7 @@ import "Summary"; import "SuSEFirewall"; import "Progress"; + import "PackageSystem"; import "Wizard"; include "nfs/routines.ycp"; @@ -54,7 +55,7 @@ /** * Required packages */ - global list required_packages = ["portmap"]; + global list <string> required_packages = ["portmap", "nfs-client"]; /** * eg.: [ $["spec": "moon:/cheese", file: "/mooncheese", "mntopts": "defaults"], ...] @@ -66,6 +67,8 @@ */ global list<map> non_nfs_entries = []; + global boolean nfs4_enabled = false; + // list of created directories list<string> created_dirs = []; @@ -228,8 +231,16 @@ return (entry["vfstype"]:"" != "nfs"); }); + nfs4_enabled = (SCR::Read(.sysconfig.nfs.NFS4_SUPPORT)=="yes"); + SuSEFirewall::Read (); + if (nfs4_enabled) + required_packages = add( required_packages, "nfsidmap"); + + if ( !PackageSystem::CheckAndInstallPackagesInteractive( required_packages ) ) + return false; + return true; } @@ -246,7 +257,7 @@ list<map<string,any> > fstab = (list<map<string,any> >) SCR::Read (.etc.fstab); // unescape deferred for optimization fstab = filter (map<string,any> entry, fstab, ``{ - return (entry["vfstype"]:"" != "nfs" || entry["vfstype"]:"" != "nfs4"); + return ( entry["vfstype"]:"" != "nfs" && entry["vfstype"]:"" != "nfs4"); }); fstab = UnescapeSpaces (fstab); foreach (map<string,any> entry, nfs_entries, ``{ @@ -289,6 +300,15 @@ Service::Enable("nfsboot"); } + if(nfs4_enabled) + { + SCR::Write(.sysconfig.nfs.NFS4_SUPPORT,"yes"); + } + else + { + SCR::Write(.sysconfig.nfs.NFS4_SUPPORT,"no"); + } + boolean progress_orig = Progress::set (false); SuSEFirewall::WriteOnly (); Progress::set (progress_orig); Modified: trunk/nfs-client/src/ui.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/src/ui.ycp?rev=46616&a... ============================================================================== --- trunk/nfs-client/src/ui.ycp (original) +++ trunk/nfs-client/src/ui.ycp Mon Apr 14 19:03:50 2008 @@ -252,7 +252,7 @@ ), // textentry label `VSpacing(0.2), - `CheckBox(`id(`nfs4),"NFS&v4 Share", nfs4), + `CheckBox(`id(`nfs4), "NFS&v4 Share", nfs4), `TextEntry(`id(`optionsent), _("O&ptions"), options), `VSpacing(0.2), `HBox( @@ -462,6 +462,12 @@ // #211570 `HStretch ()), `VSpacing (1), + `HBox( + `Left(`CheckBox(`id(`enable_nfs4), `opt(`notify), _("Enable NFSv4"))), + `Left(`InputField(`id(`nfs4_domain), _("NFSv4 Domain Name"))), + `HStretch() + ), + `VSpacing (1), fw_cwm_widget["custom_widget"]:`Empty (), // frame label `VSpacing(0.2) @@ -478,6 +484,8 @@ UI::ChangeWidget (`id(`editbut), `Enabled, false); UI::ChangeWidget (`id(`delbut), `Enabled, false); + UI::ChangeWidget (`id(`enable_nfs4), `Value, Nfs::nfs4_enabled); + UI::ChangeWidget (`id(`nfs4_domain), `Enabled, Nfs::nfs4_enabled); map event = nil; any ret = nil; @@ -542,6 +550,12 @@ UI::ChangeWidget (`id(`fstable), `Items, FstabTableItems (nfs_entries)); } + else if (ret == `enable_nfs4) + { + y2internal("!!!yebat"); + boolean enabled = (boolean) UI::QueryWidget(`id(`enable_nfs4), `Value); + UI::ChangeWidget( `id(`nfs4_domain), `Enabled, enabled); + } else if (ret == `abort && changed && !Popup::ReallyAbort (true)) { ret = `again; @@ -555,6 +569,7 @@ CWMFirewallInterfaces::OpenFirewallStore (fw_cwm_widget, "", event); Nfs::nfs_entries = nfs_entries; + Nfs::nfs4_enabled = (boolean) UI::QueryWidget(`id(`enable_nfs4),`Value); } Wizard::RestoreScreenShotName (); Modified: trunk/nfs-client/testsuite/tests/r-fstab.out URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/testsuite/tests/r-fsta... ============================================================================== --- trunk/nfs-client/testsuite/tests/r-fstab.out (original) +++ trunk/nfs-client/testsuite/tests/r-fstab.out Mon Apr 14 19:03:50 2008 @@ -1,5 +1,5 @@ Dump FstabTableItems -Return [`item (`id (0), "foo.bar.com ", "/home ", "/home ", "defaults "), `item (`id (1), "foo.bar.com ", "/var/spool/mail ", "/var/spool/mail ", "defaults "), `item (`id (2), "foo.bar.com.tw ", "/local/install ", "/install ", "hard,intr ")] +Return [`item (`id (0), "foo.bar.com ", "/home ", "/home ", "nfs4", "defaults "), `item (`id (1), "foo.bar.com ", "/var/spool/mail ", "/var/spool/mail ", "nfs", "defaults "), `item (`id (2), "foo.bar.com.tw ", "/local/install ", "/install ", "nfs", "hard,intr ")] Dump IsMpInFstab Return true Return true Modified: trunk/nfs-client/testsuite/tests/r-fstab.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/testsuite/tests/r-fsta... ============================================================================== --- trunk/nfs-client/testsuite/tests/r-fstab.ycp (original) +++ trunk/nfs-client/testsuite/tests/r-fstab.ycp Mon Apr 14 19:03:50 2008 @@ -25,7 +25,7 @@ "mntops":"defaults", "passno":0, "spec":"foo.bar.com:/home", - "vfstype":"nfs" + "vfstype":"nfs4" ], $[ "file":"/var/spool/mail", Modified: trunk/nfs-client/testsuite/tests/readwrite.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/nfs-client/testsuite/tests/readwr... ============================================================================== --- trunk/nfs-client/testsuite/tests/readwrite.ycp (original) +++ trunk/nfs-client/testsuite/tests/readwrite.ycp Mon Apr 14 19:03:50 2008 @@ -113,7 +113,12 @@ "vfstype":"nfs", ], ], - ], + "sysconfig": $[ + "nfs" : $[ + "NFS4_SUPPORT": "yes", + ], + ] + ] ]; map WRITE = $[ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org