Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rda_python_common"
version = "1.0.16"
version = "1.0.17"
authors = [
{ name="Zaihua Ji", email="zji@ucar.edu" },
]
Expand Down
3 changes: 2 additions & 1 deletion src/rda_python_common/PgFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,8 @@ def make_one_remote_directory(dir, odir, host, logact = 0):
if is_root_directory(dir, 'R', host, "make directory {} on {}".format(odir, host), logact): return PgLOG.FAILURE

if make_one_remote_directory(op.dirname(dir), odir, host, logact):
if PgLOG.pgsystem("{} {} {}".format(PgLOG.get_sync_command(host), PgLOG.PGLOG['TMPSYNC'], dir), logact, 5):
tmpsync = PgLOG.get_tmpsync_path()
if PgLOG.pgsystem("{} {} {}".format(PgLOG.get_sync_command(host), tmpsync, dir), logact, 5):
set_remote_mode(dir, 0, host, PgLOG.PGLOG['EXECMODE'])
return PgLOG.SUCCESS

Expand Down
11 changes: 9 additions & 2 deletions src/rda_python_common/PgLOG.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,11 +1337,18 @@ def set_common_pglog():

# empty diretory for HOST-sync
PGLOG['TMPSYNC'] = PGLOG['DSSDBHM'] + "/tmp/.syncdir"

os.umask(2)

#
# check and return TMPSYNC path, and add it if not exists
#
def get_tmpsync_path():

if 'DSSHOME' in PGLOG and PGLOG['DSSHOME'] and not op.exists(PGLOG['TMPSYNC']):
pgsystem("mkdir " + PGLOG['TMPSYNC'], 0, LGWNEX, 4)
pgsystem("chmod 775 " + PGLOG['TMPSYNC'], LOGWRN, 4)

os.umask(2)
return PGLOG['TMPSYNC']

#
# append or prepend locpath to pgpath
Expand Down