Ejemplo n.º 1
0
 def Run(self, args):
   if args.path:
     path = args.CollapsePath()
   else:
     path = GetDefaultGRRTempDirectory()
   total, used, free, _ = psutil.disk_usage(path)
   self.SendReply(
       rdf_client.DiskUsage(path=path, total=total, used=used, free=free))
Ejemplo n.º 2
0
 def CheckFreeGRRTempSpace(self, _):
     """Mock out the driver loading code to pass the memory image."""
     path = tempfiles.GetDefaultGRRTempDirectory()
     reply = rdf_client.DiskUsage(path=path,
                                  total=10 * 1024 * 1024 * 1024,
                                  used=5 * 1024 * 1024 * 1024,
                                  free=5 * 1024 * 1024 * 1024)
     return [reply]