提交 9ab8c0bb 编写于 作者: A Ademar de Souza Reis Jr

core.job_id: rename get_job_id() to create_unique_job_id()

The name get_job_id() doesn't reflect the fact that this
function returns a new job ID everytime it's called.
上级 36c33baa
......@@ -209,7 +209,7 @@ def get_job_logs_dir(args=None, unique_id=None):
logdir = get_logs_dir()
# Stand alone tests handling
if unique_id is None:
unique_id = job_id.get_job_id()
unique_id = job_id.create_unique_job_id()
debugbase = 'job-%s-%s' % (start_time, unique_id[:7])
debugdir = path.init_dir(logdir, debugbase)
......
......@@ -21,7 +21,7 @@ _RAND_POOL = random.SystemRandom()
_HOSTNAME = socket.gethostname()
def get_job_id():
def create_unique_job_id():
"""
Create a job ID SHA1.
......
......@@ -283,9 +283,9 @@ class Job(object):
"""
self.args = args
if args is not None:
self.unique_id = args.unique_job_id or job_id.get_job_id()
self.unique_id = args.unique_job_id or job_id.create_unique_job_id()
else:
self.unique_id = job_id.get_job_id()
self.unique_id = job_id.create_unique_job_id()
self.logdir = data_dir.get_job_logs_dir(self.args, self.unique_id)
self.logfile = os.path.join(self.logdir, "job.log")
self.idfile = os.path.join(self.logdir, "id")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册