Skip to content

Commit 543bb22

Browse files
authored
Merge pull request #55 from NCAR/email_log_fix
Email log fix
2 parents f03febb + aa84679 commit 543bb22

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "rda_python_common"
7-
version = "1.0.45"
7+
version = "1.0.46"
88
authors = [
99
{ name="Zaihua Ji", email="zji@ucar.edu" },
1010
]

src/rda_python_common/PgLOG.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,12 @@ def log_email(emlmsg):
354354
if not CPID['PID']: CPID['PID'] = "{}-{}-{}".format(PGLOG['HOSTNAME'], get_command(), PGLOG['CURUID'])
355355
cmdstr = "{} {} at {}\n".format(CPID['PID'], break_long_string(CPID['CMD'], 40, "...", 1), current_datetime())
356356
fn = "{}/{}".format(PGLOG['LOGPATH'], PGLOG['EMLFILE'])
357-
f = open(fn, 'a')
358-
f.write(cmdstr + emlmsg)
359-
f.close()
357+
try:
358+
f = open(fn, 'a')
359+
f.write(cmdstr + emlmsg)
360+
f.close()
361+
except FileNotFoundError as e:
362+
print(e)
360363

361364
#
362365
# Function: cmdlog(cmdline)

0 commit comments

Comments
 (0)