tuxudo / macos_security_compliance

macOS Security Compliance module for MunkiReport
1 stars 0 forks source link

Script fails other Date Formats #2

Open soberhofer opened 2 weeks ago

soberhofer commented 2 weeks ago

I am getting the following error on the client, when it is trying to run the script:

ValueError: time data 'Di 18 Jun 2024 14:48:20 CEST' does not match format '%a %b %d %H:%M:%S %Z %Y'

This is happening on a client with german locale and the error is raised in the following line:

out['last_compliance_check'] = str(int(time.mktime(datetime.datetime.strptime(pl[item], "%a %b %d %H:%M:%S %Z %Y").timetuple())))

soberhofer commented 2 weeks ago

I was able to avoid the error by using pl[item] without the whole date manipulation. I guess the format is wrong then, but it just writes the string as is into the table