self.passwd_data = {}
self.map_uid = {}
- self.now = datetime.datetime.now(UTC)
+ self.now = datetime.datetime.utcnow()
self.du_cmd = self.get_command('du', quiet=True)
self.do_statistics = False
files.sort()
# Removing all files older 4 years
limit_age = time.time() - self.max_age
- limit_age_dt = datetime.datetime.fromtimestamp(limit_age, UTC)
+ limit_age_dt = datetime.datetime.utcfromtimestamp(limit_age)
LOG.info("Removing all status files older than {!r} ...".format(
limit_age_dt.isoformat(' ')))
util = self.get_util_dir_kb(path)
total_kb += util
result = {
- 'checked': datetime.datetime.now(UTC),
+ 'checked': datetime.datetime.utcnow(),
'util_kb': util,
'uid': dir_uid,
'gid': dir_stat.st_gid,
}
check['data'][home_rel] = result
- end_ts = datetime.datetime.now(UTC)
+ end_ts = datetime.datetime.utcnow()
duration = end_ts - self.now
dur_days = duration.days
dur_secs = duration.seconds