Changeset 2323

Show
Ignore:
Timestamp:
06/24/05 16:17:54 (19 years ago)
Author:
jerome
Message:

Now logs a warning when user/group doesn't exist when running edpykota.
NB : the message is only printed once all users/groups have been processed.
Severity : if you don't need this, you don't need to upgrade.

Location:
pykota/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/edpykota

    r2303 r2323  
    353353                overcharge = getattr(protoentry, "OverCharge", None) 
    354354             
     355        missingusers = {} 
     356        missinggroups = {}     
    355357        todelete = {}     
    356358        changed = {} # tracks changes made at the user/group level 
     
    400402                allentries = getattr(self.storage, "getPrinter%ssAndQuotas" % suffix)(printer, names) 
    401403                 
     404            # TODO : do this only once !!!     
     405            allnames = [entry.Name for (entry, dummy) in allentries] 
     406            for name in names :     
     407                if not self.matchString(name, allnames) : 
     408                    if options["groups"] : 
     409                        missinggroups[name] = 1 
     410                    else :     
     411                        missingusers[name] = 1 
     412                 
    402413            for (entry, entrypquota) in allentries : 
    403414                if not changed.has_key(entry.Name) : 
     
    435446                            else :     
    436447                                self.printInfo(_("Invalid user name %s") % entry.Name) 
     448                    else : 
     449                        if options["groups"] : 
     450                            missinggroups[entry.Name] = 1 
     451                        else :     
     452                            missingusers[entry.Name] = 1 
    437453                elif options["delete"] :                 
    438454                    todelete[entry.Name] = entry 
     
    490506                                    self.printInfo(_("Group %s not found in the PyKota Storage.") % groupname) 
    491507                         
     508        # Now outputs the list of nonexistent users and groups                 
     509        for name in missingusers.keys() : 
     510            self.printInfo(_("Nonnexistent user %s") % name, level="warn") 
     511        for name in missinggroups.keys() : 
     512            self.printInfo(_("Nonnexistent group %s") % name, level="warn") 
     513         
    492514        # Now delete what has to be deleted                 
    493515        for (name, entry) in todelete.items() :                 
  • pykota/trunk/NEWS

    r2320 r2323  
    2222PyKota NEWS : 
    2323        
     24    - 1.23alpha14 :  
     25     
     26        - Logs a warning when the user/group doesn't exist when running 
     27          edpykota. 
     28           
    2429    - 1.23alpha13 : 
    2530     
  • pykota/trunk/pykota/version.py

    r2320 r2323  
    2222# 
    2323 
    24 __version__ = "1.23alpha13_unofficial" 
     24__version__ = "1.23alpha14_unofficial" 
    2525 
    2626__doc__ = "PyKota : a complete Printing Quota Solution for CUPS and LPRng." 
  • pykota/trunk/TODO

    r2317 r2323  
    2222TODO, in no particular order : 
    2323         
     24        - Adds configurability to what happens when the user/group doesn't exist 
     25          when running edpykota. 
     26           
    2427        - Add the listing of the member printers in pkprinters if the printer 
    2528          is a printer group.