def construct(path, name=None):
    "Selects an appropriate CGroup subclass for the given CGroup path."
    name = name if name else path.split("/")[4]
    classes = {"memory": Memory,
               "cpu": CPU,
               "cpuacct": CPUAcct}
    constructor = classes.get(name, CGroup)
    log.debug("Chose %s for: %s", constructor.__name__, path)
    return constructor(path, name)
def construct ( path , name = None ) : name = name if name else path . split ( "/" ) [ 4 ] classes = { "memory" : Memory , "cpu" : CPU , "cpuacct" : CPUAcct } constructor = classes . get ( name , CGroup ) log . debug ( "Chose %s for: %s" , constructor . __name__ , path ) return constructor ( path , name )
Selects an appropriate CGroup subclass for the given CGroup path.