forked from PanDAWMS/pilot3
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created uuidgen_t() to replace call to external command
- Loading branch information
1 parent
e61c0da
commit 8c383c9
Showing
2 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,21 +18,25 @@ | |
# Authors: | ||
# - Alexey Anisenkov, [email protected], 2017 | ||
# - Pavlo Svirin, [email protected], 2018 | ||
# - Paul Nilsson, [email protected], 2018-23 | ||
# - Paul Nilsson, [email protected], 2018-24 | ||
|
||
import hashlib | ||
import os | ||
import socket | ||
import time | ||
|
||
from sys import exc_info | ||
from json import dumps, loads | ||
from os import environ, getuid | ||
|
||
from pilot.common.exception import FileHandlingFailure | ||
from pilot.util.auxiliary import correct_none_types | ||
from pilot.util.auxiliary import ( | ||
correct_none_types, | ||
uuidgen_t | ||
) | ||
from pilot.util.config import config | ||
from pilot.util.constants import get_pilot_version, get_rucio_client_version | ||
from pilot.util.container import execute, execute2 | ||
from pilot.util.container import execute2 | ||
from pilot.util.filehandling import append_to_file, write_file | ||
from pilot.util.https import request2 | ||
|
||
|
@@ -130,10 +134,8 @@ def init(self, job): | |
s = 'ppilot_%s' % job.jobdefinitionid | ||
self['uuid'] = hashlib.md5(s.encode('utf-8')).hexdigest() # hash_pilotid, Python 2/3 | ||
else: | ||
#self['uuid'] = commands.getoutput('uuidgen -t 2> /dev/null').replace('-', '') # all LFNs of one request have the same uuid | ||
cmd = 'uuidgen -t 2> /dev/null' | ||
exit_code, stdout, stderr = execute(cmd, timeout=10) | ||
self['uuid'] = stdout.replace('-', '') | ||
_uuid = uuidgen_t() # 'uuidgen -t 2> /dev/null' | ||
self['uuid'] = _uuid.replace('-', '') | ||
|
||
def get_value(self, key): | ||
""" | ||
|