refs #500 fix portability issue

ogagent-jobs
Natalia Serrano 2024-07-30 14:47:48 +02:00
parent 8c6a6523d8
commit da7dd418c0
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ class JobMgr():
args = operations.build_popen_args (script)
logger.debug ('args "{}"'.format (args))
now = datetime.now (tz=timezone.utc)
ts = float (now.strftime ('%s.%f'))
ts = now.strftime ('%Y-%m-%d %H:%M:%S.%f%z') ## '%s' doesn't work on windows
jobid = hashlib.sha256 (now.isoformat().encode('UTF-8') + script.encode ('UTF-8')).hexdigest()[0:8]
p = subprocess.Popen (args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
self.jobs[jobid] = { 'p': p, 'pid': p.pid, 'starttime': ts, 'script': script, 'client': is_client, 'status': 'running', 'stdout': '', 'stderr': '' }