Author: lslezak Date: Thu Jul 28 13:59:36 2011 New Revision: 65076 URL: http://svn.opensuse.org/viewcvs/yast?rev=65076&view=rev Log: - fixed registration status check when registering against SMT (bnc#708888) Modified: branches/SuSE-Code-11-SP2-Branch/wagon/package/yast2-wagon.changes branches/SuSE-Code-11-SP2-Branch/wagon/src/clients/wagon_registration_check.ycp branches/SuSE-Code-11-SP2-Branch/wagon/src/modules/Wagon.ycp Modified: branches/SuSE-Code-11-SP2-Branch/wagon/package/yast2-wagon.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/wagon/package/yast2-wagon.changes?rev=65076&r1=65075&r2=65076&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/wagon/package/yast2-wagon.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/wagon/package/yast2-wagon.changes Thu Jul 28 13:59:36 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Jul 28 11:56:48 UTC 2011 - lslezak@suse.cz + +- fixed registration status check when registering against SMT + (bnc#708888) + +------------------------------------------------------------------- Mon Jul 18 12:48:20 UTC 2011 - lslezak@suse.cz - added new core/full migration selection dialog Modified: branches/SuSE-Code-11-SP2-Branch/wagon/src/clients/wagon_registration_check.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/wagon/src/clients/wagon_registration_check.ycp?rev=65076&r1=65075&r2=65076&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/wagon/src/clients/wagon_registration_check.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/wagon/src/clients/wagon_registration_check.ycp Thu Jul 28 13:59:36 2011 @@ -232,6 +232,14 @@ // some other problem and user has to be informed about it define boolean Interactive(map<string,any> status) { + // SMT doesn't write /var/lib/suseRegister/registration-status.xml file + // so we cannot get any registration details, assume the system is fully registered + if (status["ncc"]:nil == false) + { + y2milestone("SMT server is used, assuming fully registered system"); + return false; + } + // the system is not registered at all if (status["registered_system"]:false) { Modified: branches/SuSE-Code-11-SP2-Branch/wagon/src/modules/Wagon.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/wagon/src/modules/Wagon.ycp?rev=65076&r1=65075&r2=65076&view=diff ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/wagon/src/modules/Wagon.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/wagon/src/modules/Wagon.ycp Thu Jul 28 13:59:36 2011 @@ -761,6 +761,50 @@ return true; } + /** + * Check whether NCC or SMT is used for registration + */ + define boolean NCCUsed() + { + // check /etc/suseRegister.conf content + string conf = (string)SCR::Read(.target.string, "/etc/suseRegister.conf"); + + if (conf == nil) + { + y2error("Cannot read /etc/suseRegister.conf"); + return nil; + } + + list<string> lines = splitstring(conf, "\n"); + + boolean found_url = false; + boolean found_ncc = false; + + foreach(string line, lines, { + if (regexpmatch(line, "^[ \t]*url[ \t]*=[ \t]*")) + { + found_url = true; + y2milestone("Found registration URL option: %1", line); + + if (regexpmatch(line, "^[ \t]*url[ \t]*=[ \t]*https://secure-www.novell.com/center/regsvc/*[ \t]*(#*.*)*")) + { + found_ncc = true; + y2milestone("NCC URL found"); + } + } + }); + + if (!found_url) + { + y2error("No url option found in /etc/suseRegister.conf"); + return nil; + } + + y2milestone("Found NCC registration server: %1", found_ncc); + + return found_ncc; + } + /* * Read registration status and sort products according their status * @param file Read this registration status file @@ -873,6 +917,7 @@ * @return map<string,any> result: $[ * "registered_system" : (boolean) - true registration was run, false registration has never run or there is no product to register (e.g. openSUSE installation) or the registration completely failed + "ncc" : (boolean) - true - NCC is used for registration, false - a SMT server is configured, nil - not configured or other error "timestamp" : (integer) - time when the status was saved (unix time), -1 in an unregistered system "registered" : (list<string>) - registered products "provisional" : (list<string>) - products with provisional subscription (registered, but no updates available) @@ -884,7 +929,10 @@ */ global define map<string,any> RegistrationStatus() { - return RegistrationStatusFromFile(RegistrationStatus::RegFile()); + map<string,any> ret = RegistrationStatusFromFile(RegistrationStatus::RegFile()); + ret["ncc"] = NCCUsed(); + + return ret; } /* EOF */ } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org