equal
deleted
inserted
replaced
63 Source |
63 Source |
64 |
64 |
65 DC_LOCKFILE = "distro_const.lock" |
65 DC_LOCKFILE = "distro_const.lock" |
66 DC_LOGGER = None |
66 DC_LOGGER = None |
67 LOG_TIMESTAMP = time.strftime("%Y-%m-%d.%H:%M") |
67 LOG_TIMESTAMP = time.strftime("%Y-%m-%d.%H:%M") |
68 DEFAULTLOG = system_temp_path("dc/default_log" + '.' + str(os.getpid())) |
68 DEFAULTLOG = system_temp_path("dc" + str(os.getpid()) + "/default_log") |
69 |
69 |
70 |
70 |
71 class Lockfile(object): |
71 class Lockfile(object): |
72 """ Lockfile - context manager for locking the distro_const dataset to |
72 """ Lockfile - context manager for locking the distro_const dataset to |
73 prevent multiple invocations of distro_const from running at the same time |
73 prevent multiple invocations of distro_const from running at the same time |
499 DC_LOGGER.info("Simple log: %s" % new_simplelog) |
499 DC_LOGGER.info("Simple log: %s" % new_simplelog) |
500 DC_LOGGER.info("Detail Log: %s" % new_detaillog) |
500 DC_LOGGER.info("Detail Log: %s" % new_detaillog) |
501 DC_LOGGER.transfer_log(destination=new_detaillog) |
501 DC_LOGGER.transfer_log(destination=new_detaillog) |
502 simple_fh.transfer_log(destination=new_simplelog) |
502 simple_fh.transfer_log(destination=new_simplelog) |
503 |
503 |
504 # Remove the original DEFAULTLOG. It's no longer needed |
504 # Remove the directory containing DEFAULTLOG and the original |
505 shutil.rmtree(base) |
505 # simple log. Their contents have been transferred to the DC |
|
506 # log location. |
|
507 shutil.rmtree(os.path.dirname(DEFAULTLOG)) |
506 |
508 |
507 # set the http_proxy if one is specified in the manifest |
509 # set the http_proxy if one is specified in the manifest |
508 dc_set_http_proxy(DC_LOGGER) |
510 dc_set_http_proxy(DC_LOGGER) |
509 |
511 |
510 # register each checkpoint listed in the execution section |
512 # register each checkpoint listed in the execution section |