Skip to content

Commit 22a21aa

Browse files
added timestamp to report and inspect (#160)
* added timestamp to report and inspect * changed timestamp to hardware address
1 parent 4dc0f72 commit 22a21aa

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ resolution
3939

4040
- Fixed forks with same source process name.
4141
- Fixed `inspect` issue when tasks took more than a day in duration.
42+
- Added hardware address to `inpsect` and `report` hash.
4243

4344
## 1.3.1
4445

flowcraft/generator/inspect.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import re
22
import os
33
import sys
4+
import uuid
45
import time
56
import curses
67
import signal
@@ -1540,7 +1541,8 @@ def _get_run_hash(self):
15401541
# Get hash from the current working dir and hostname
15411542
workdir = self.workdir.encode("utf8")
15421543
hostname = socket.gethostname().encode("utf8")
1543-
dir_hash = hashlib.md5(workdir + hostname)
1544+
hardware_addr = str(uuid.getnode()).encode("utf8")
1545+
dir_hash = hashlib.md5(workdir + hostname + hardware_addr)
15441546

15451547
return pipeline_hash.hexdigest() + dir_hash.hexdigest()
15461548

flowcraft/generator/report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import re
33
import sys
44
import json
5+
import uuid
56
import signal
67
import socket
78
import hashlib
@@ -195,7 +196,8 @@ def _get_report_id(self):
195196
# Get hash from the current working dir and hostname
196197
workdir = os.getcwd().encode("utf8")
197198
hostname = socket.gethostname().encode("utf8")
198-
dir_hash = hashlib.md5(workdir + hostname)
199+
hardware_addr = str(uuid.getnode()).encode("utf8")
200+
dir_hash = hashlib.md5(workdir + hostname + hardware_addr)
199201

200202
return pipeline_hash.hexdigest() + dir_hash.hexdigest()
201203

0 commit comments

Comments
 (0)