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))
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]