Skip to content

Commit

Permalink
fix(easy_install): datetime formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Jan 9, 2020
1 parent b80cecc commit 9cc6e2e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions playbooks/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

tmp_bench_repo = os.path.join('/', 'tmp', '.bench')
tmp_log_folder = os.path.join('/', 'tmp', 'logs')

execution_day = "{:%Y-%m-%d}".format(datetime.datetime.utcnow())
execution_time = "{:%H-%M}".format(datetime.datetime.utcnow())
execution_ts = "{0}__{1}".format(execution_day, execution_time)

log_file_name = "easy-install__{}.log".format(execution_ts)
execution_timestamp = datetime.datetime.utcnow()
execution_day = "{:%Y-%m-%d}".format(execution_timestamp)
execution_time = "{:%H:%M}".format(execution_timestamp)
log_file_name = "easy-install__{0}__{1}.log".format(execution_day, execution_time.replace(':', '-'))
log_path = os.path.join(tmp_log_folder, log_file_name)
log_stream = sys.stdout

Expand All @@ -35,7 +33,7 @@ def setup_log_stream(args):
os.makedirs(tmp_log_folder)
log_stream = open(log_path, 'w')
log("Logs are saved under {0}".format(log_path), level=3)
print("Install script run at {}\n\n".format(execution_ts), file=log_stream)
print("Install script run at {0} on {1}\n\n".format(execution_time, execution_day), file=log_stream)


def check_environment():
Expand Down

0 comments on commit 9cc6e2e

Please sign in to comment.