Author: locilka Date: Thu Mar 6 10:17:18 2008 New Revision: 45256 URL: http://svn.opensuse.org/viewcvs/yast?rev=45256&view=rev Log: Added some error handling Modified: trunk/yast2/library/control/src/ProductControl.ycp Modified: trunk/yast2/library/control/src/ProductControl.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/control/src/ProductControl.ycp?rev=45256&r1=45255&r2=45256&view=diff ============================================================================== --- trunk/yast2/library/control/src/ProductControl.ycp (original) +++ trunk/yast2/library/control/src/ProductControl.ycp Thu Mar 6 10:17:18 2008 @@ -118,12 +118,25 @@ } /** - * DIsable given module from installation workflow + * Disable given module from installation workflow * @return current list of disabled modules */ global list<string> DisableModule (string modname) { + if (modname == nil || modname == "") { + y2error ("Module to disable is '%1'", modname); + } else { + DisabledModules = (list<string>) union (DisabledModules, [modname]); + } - DisabledModules = (list<string>) union (DisabledModules, [modname]); + return DisabledModules; +} + +/** + * Returns list of modules disabled in workflow + * + * @return list <string> DisabledModules + */ +global list <string> GetDisabledModules () { return DisabledModules; } @@ -134,6 +147,11 @@ */ global define boolean checkDisabled (map mod ) { + if (mod == nil) { + y2error ("Unknown module %1", mod); + return nil; + } + if (contains(DisabledModules, mod["name"]:"")) { return true; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org