diff --git a/src/rda_python_common/PgFile.py b/src/rda_python_common/PgFile.py index 2e2eee1..0c0f471 100644 --- a/src/rda_python_common/PgFile.py +++ b/src/rda_python_common/PgFile.py @@ -113,9 +113,9 @@ } ENDPOINTS = { - 'gdex-glade' : "NCAR RDA GLADE", - 'gdex-quasar' : "NCAR RDA Quasar", - 'gdex-quasar-drdata' : "NCAR RDA Quasar DRDATA" + 'gdex-glade' : "NCAR GDEX GLADE", + 'gdex-quasar' : "NCAR GDEX Quasar", + 'gdex-quasar-drdata' : "NCAR GDEX Quasar DRDATA" } BFILES = {} # cache backup file names and dates for each bid @@ -163,7 +163,7 @@ def errlog(msg, etype, retry = 0, logact = 0): # # Return 1 if successful 0 if failed with error message generated in PgLOG.pgsystem() cached in PgLOG.PGLOG['SYSERR'] # -def copy_rda_file(tofile, fromfile, tohost = LHOST, fromhost = LHOST, logact = 0): +def copy_gdex_file(tofile, fromfile, tohost = LHOST, fromhost = LHOST, logact = 0): thost = strip_host_name(tohost) fhost = strip_host_name(fromhost) @@ -192,6 +192,8 @@ def copy_rda_file(tofile, fromfile, tohost = LHOST, fromhost = LHOST, logact = 0 return errlog("{}-{}->{}-{}: Cannot copy file".format(fhost, fromfile, thost, tofile), 'O', 1, PgLOG.LGEREX) +copy_rda_file = copy_gdex_file + # # Copy a file locally # @@ -300,7 +302,7 @@ def local_copy_object(tofile, fromfile, bucket = None, meta = None, logact = 0): if not bucket: bucket = PgLOG.PGLOG['OBJCTBKT'] if meta is None: meta = {} if 'user' not in meta: meta['user'] = PgLOG.PGLOG['CURUID'] - if 'group' not in meta: meta['group'] = PgLOG.PGLOG['RDAGRP'] + if 'group' not in meta: meta['group'] = PgLOG.PGLOG['GDEXGRP'] uinfo = json.dumps(meta) finfo = check_local_file(fromfile, 0, logact) @@ -332,7 +334,7 @@ def local_copy_object(tofile, fromfile, bucket = None, meta = None, logact = 0): # tofiles - target file name list, echo name leading with /dsnnn.n/ on Quasar and # leading with /data/ or /decsdata/ on local glade disk # fromfiles - source file name list, the same format as the tofiles -# topoint - target endpoint name, 'gdex-glade', 'gdex-quasar' or 'gdex-quasar-drdata' +# topoint - target endpoint name, 'gdex-glade', 'gdex-quasar' or 'gdex-quasar-dgdexta' # frompoint - source endpoint name, the same choices as the topoint # def quasar_multiple_trasnfer(tofiles, fromfiles, topoint, frompoint, logact = 0): @@ -374,7 +376,7 @@ def quasar_multiple_trasnfer(tofiles, fromfiles, topoint, frompoint, logact = 0) # tofile - target file name, leading with /dsnnn.n/ on Quasar and # leading with /data/ or /decsdata/ on local glade disk # fromfile - source file, the same format as the tofile -# topoint - target endpoint name, 'gdex-glade', 'gdex-quasar' or 'gdex-quasar-drdata' +# topoint - target endpoint name, 'gdex-glade', 'gdex-quasar' or 'gdex-quasar-dgdexta' # frompoint - source endpoint name, the same choices as the topoint # def endpoint_copy_endpoint(tofile, fromfile, topoint, frompoint, logact = 0): @@ -689,7 +691,7 @@ def object_copy_remote(tofile, fromfile, host, bucket = None, logact = 0): # # Return 1 if successful 0 if failed with error message generated in PgLOG.pgsystem() cached in PgLOG.PGLOG['SYSERR'] # -def delete_rda_file(file, host, logact = 0): +def delete_gdex_file(file, host, logact = 0): shost = strip_host_name(host) if PgUtil.pgcmp(shost, LHOST, 1) == 0: @@ -699,6 +701,8 @@ def delete_rda_file(file, host, logact = 0): else: return delete_remote_file(file, host, logact) +delete_rda_file = delete_gdex_file + # # Delete a local file/irectory # @@ -784,7 +788,7 @@ def delete_backup_file(file, endpoint = None, logact = 0): return PgLOG.FAILURE # -# reset local file/directory information to make them writable for PgLOG.PGLOG['RDAUSER'] +# reset local file/directory information to make them writable for PgLOG.PGLOG['GDEXUSER'] # file - file name (mandatory) # info - gathered file info with option 14, None means file not exists # @@ -817,8 +821,8 @@ def reset_local_directory(dir, info = None, logact = 0): if info: if info['mode'] and info['mode'] != 0o775: ret += set_local_mode(dir, 0, 0o775, info['mode'], info['logname'], logact) - if info['group'] and PgLOG.PGLOG['RDAGRP'] != info['group']: - ret += change_local_group(dir, PgLOG.PGLOG['RDAGRP'], info['group'], info['logname'], logact) + if info['group'] and PgLOG.PGLOG['GDEXGRP'] != info['group']: + ret += change_local_group(dir, PgLOG.PGLOG['GDEXGRP'], info['group'], info['logname'], logact) return 1 if ret else 0 @@ -833,8 +837,8 @@ def reset_local_file(file, info = None, logact = 0): if info: if info['mode'] != 0o664: ret += set_local_mode(file, 1, 0o664, info['mode'], info['logname'], logact) - if PgLOG.PGLOG['RDAGRP'] != info['group']: - ret += change_local_group(file, PgLOG.PGLOG['RDAGRP'], info['group'], info['logname'], logact) + if PgLOG.PGLOG['GDEXGRP'] != info['group']: + ret += change_local_group(file, PgLOG.PGLOG['GDEXGRP'], info['group'], info['logname'], logact) return ret @@ -847,7 +851,7 @@ def reset_local_file(file, info = None, logact = 0): # # Return PgLOG.SUCCESS if successful PgLOG.FAILURE otherwise # -def move_rda_file(tofile, fromfile, host, logact = 0): +def move_gdex_file(tofile, fromfile, host, logact = 0): shost = strip_host_name(host) if PgUtil.pgcmp(shost, LHOST, 1) == 0: @@ -857,6 +861,8 @@ def move_rda_file(tofile, fromfile, host, logact = 0): else: return move_remote_file(tofile, fromfile, host, logact) +move_rda_file = move_gdex_file + # # Move a file locally # @@ -1071,7 +1077,7 @@ def move_backup_file(tofile, fromfile, endpoint = None, logact = 0): # # Return PgLOG.SUCCESS(1) if successful or PgLOG.FAILURE(0) if failed # -def make_rda_directory(dir, host, logact = 0): +def make_gdex_directory(dir, host, logact = 0): if not dir: return PgLOG.SUCCESS shost = strip_host_name(host) @@ -1080,6 +1086,8 @@ def make_rda_directory(dir, host, logact = 0): else: return make_remote_directory(dir, host, logact) +make_rda_directory = make_gdex_directory + # # Make a local directory # @@ -1239,7 +1247,7 @@ def is_root_directory(dir, etype, host = None, action = None, logact = 0): # # set mode for a given direcory/file on a given host (include local host) # -def set_rda_mode(file, isfile, host, nmode = None, omode = None, logname = None, logact = 0): +def set_gdex_mode(file, isfile, host, nmode = None, omode = None, logname = None, logact = 0): shost = strip_host_name(host) if PgUtil.pgcmp(shost, LHOST, 1) == 0: @@ -1247,6 +1255,8 @@ def set_rda_mode(file, isfile, host, nmode = None, omode = None, logname = None, else: return set_remote_mode(file, isfile, host, nmode, omode, logact) +set_rda_mode = set_gdex_mode + # # set mode for given local directory or file # @@ -1292,7 +1302,7 @@ def set_remote_mode(file, isfile, host, nmode = 0, omode = 0, logact = 0): def change_local_group(file, ngrp = None, ogrp = None, logname = None, logact = 0): if not ngrp: - ngid = PgLOG.PGLOG['RDAGID'] + ngid = PgLOG.PGLOG['GDEXGID'] else: ngid = grp.getgrnam[ngrp].gr_gid if logact and logact&PgLOG.EXITLG: logact &=~PgLOG.EXITLG @@ -1455,7 +1465,7 @@ def check_service_accessibilty(sname, fhost = None, logact = 0): if not fhost: fhost = PgLOG.PGLOG['HOSTNAME'] pgrec = PgDBI.pgget("dsservice", "*", "service = '{}' AND hostname = '{}'".format(sname, fhost), logact) if not pgrec: - PgLOG.pglog("dsservice: Access {} from {} is not defined in RDA Configuration".format(sname, fhost), logact) + PgLOG.pglog("dsservice: Access {} from {} is not defined in GDEX Configuration".format(sname, fhost), logact) return -1 path = sname if (pgrec['flag'] == "H" or pgrec['flag'] == "G") else None @@ -1484,7 +1494,7 @@ def local_host_action(host, action, info, logact = 0): if host == "partition": msg = "for individual partition" elif host == "rda_config": - msg = "via https://gdex.ucar.edu/internal/rda_pg_config" + msg = "via https://gdex.ucar.edu/rda_pg_config" elif host in PgLOG.BCHCMDS: msg = "on a {} Node".format(host) else: @@ -1555,7 +1565,7 @@ def strip_host_name(host): # # Return a dict of file info, or None if file not exists # -def check_rda_file(file, host = LHOST, opt = 0, logact = 0): +def check_gdex_file(file, host = LHOST, opt = 0, logact = 0): shost = strip_host_name(host) @@ -1570,6 +1580,8 @@ def check_rda_file(file, host = LHOST, opt = 0, logact = 0): else: return check_remote_file(file, host, opt, logact) +check_rda_file = check_gdex_file + # # wrapper to check_local_file() and check_globus_file() to check info for a file # on local or remote Globus endpoints @@ -1686,7 +1698,7 @@ def local_path_size(pname): # file: remote File name # opt: 0 - get data size only (fname, data_size, isfile), fname is the file basename # 1 - get date/time modified (date_modified, time_modfied) -# 2 - file owner's login name (logname), assumed 'rdadata' +# 2 - file owner's login name (logname), assumed 'gdexdata' # 4 - get permission mode in 3 octal digits (mode) # 8 - get group name (group), assumed 'dss' # 16 - get week day 0-Sunday, 1-Monday (week_day) @@ -1743,8 +1755,8 @@ def remote_file_stat(line, opt): info['time_modified'] = mtime if opt&16: info['week_day'] = PgUtil.get_weekday(mdate) - if opt&2: info['logname'] = "rdadata" - if opt&8: info['group'] = PgLOG.PGLOG['RDAGRP'] + if opt&2: info['logname'] = "gdexdata" + if opt&8: info['group'] = PgLOG.PGLOG['GDEXGRP'] return info @@ -2100,7 +2112,7 @@ def ftp_file_stat(line, opt): # # Return: a dict with filenames as keys None if empty directory # -def rda_glob(dir, host, opt = 0, logact = 0): +def gdex_glob(dir, host, opt = 0, logact = 0): shost = strip_host_name(host) if PgUtil.pgcmp(shost, LHOST, 1) == 0: @@ -2112,6 +2124,8 @@ def rda_glob(dir, host, opt = 0, logact = 0): else: return remote_glob(dir, host, opt, logact) +rda_glob = gdex_glob + # # get an array of directories/files under given dir on local host # @@ -2151,7 +2165,7 @@ def local_glob(dir, opt = 0, logact = 0): # host: host name the directory on, default to LHOST # opt: 0 - get data size only (fname, data_size, isfile), fname is the file basename # 1 - get date/time modified (date_modified, time_modfied) -# 2 - file owner's login name (logname), assumed 'rdadata' +# 2 - file owner's login name (logname), assumed 'gdexdata' # 4 - get permission mode in 3 octal digits (mode) # 8 - get group name (group), assumed 'dss' # 16 - get week day 0-Sunday, 1-Monday (week_day) @@ -2409,9 +2423,9 @@ def clean_delete_directory(logact = 0): for dir in DELDIRS: host = DELDIRS[dir] dinfo = (dir if host == LHOST else "{}-{}".format(host, dir)) - dstat = rda_empty_directory(dir, DELDIRS[dir]) + dstat = gdex_empty_directory(dir, DELDIRS[dir]) if dstat == 0: - if delete_rda_file(dir, host, logact): + if delete_gdex_file(dir, host, logact): PgLOG.pglog(dinfo + ": Empty directory removed", lact) elif dstat > 0: if dstat == 1 and lvl > 0: PgLOG.pglog(dinfo + ": Directory not empty yet", lact) @@ -2433,7 +2447,7 @@ def clean_empty_directory(dir, host, logact = 0): if not dir: return 0 - dirs = rda_glob(dir, host) + dirs = gdex_glob(dir, host) cnt = 0 if logact: lact = logact&~PgLOG.EXITLG @@ -2448,7 +2462,7 @@ def clean_empty_directory(dir, host, logact = 0): dinfo = (dir if same_hosts(host, LHOST) else "{}-{}".format(host, dir)) if cnt == 0: - if delete_rda_file(dir, host, logact): + if delete_gdex_file(dir, host, logact): PgLOG.pglog(dinfo + ": Empty directory removed", lact) return 1 else: @@ -2462,7 +2476,7 @@ def clean_empty_directory(dir, host, logact = 0): # # Return: 0 if empty directory, 1 if not empty and -1 if invalid directory # -def rda_empty_directory(dir, host): +def gdex_empty_directory(dir, host): shost = strip_host_name(host) @@ -2471,6 +2485,8 @@ def rda_empty_directory(dir, host): else: return remote_empty_directory(dir, host) +rda_empty_directory = gdex_empty_directory + # # return 0 if empty local directory, 1 if not; -1 if cannot remove # @@ -2505,13 +2521,15 @@ def remote_empty_directory(dir, host): # # return: array of file sizes size is -1 if file does not exist # -def rda_file_sizes(files, host, logact = 0): +def gdex_file_sizes(files, host, logact = 0): sizes = [] - for file in files: sizes.append(rda_file_size(file, host, 2, logact)) + for file in files: sizes.append(gdex_file_size(file, host, 2, logact)) return sizes +rda_file_sizes = gdex_file_sizes + # # get sizes of local files # @@ -2540,15 +2558,15 @@ def local_file_sizes(files, logact = 0): # -1 - file not exists # -2 - error check file # -def rda_file_size(file, host, opt = 0, logact = 0): +def gdex_file_size(file, host, opt = 0, logact = 0): - info = check_rda_file(file, host, 0, logact) + info = check_gdex_file(file, host, 0, logact) if info: if info['isfile'] and info['data_size'] < PgLOG.PGLOG['MINSIZE']: if opt: if opt&2: errlog("{}-{}: {} file".format(host, file, ("Too small({}B)".format(info['data_size']) if info['data_size'] > 0 else "Empty")), 'O', 1, logact) - if opt&1: delete_rda_file(file, host, logact) + if opt&1: delete_gdex_file(file, host, logact) return 0 else: return info['data_size'] # if not regular file or not empty @@ -2559,6 +2577,8 @@ def rda_file_size(file, host, opt = 0, logact = 0): if opt&4: errlog("{}-{}: {}".format(host, file, PgLOG.PGLOG['MISSFILE']), 'O', 1, logact) return -1 # file not exist +rda_file_size = gdex_file_size + # # check if a local file is empty or too small to be considered valid # @@ -3049,7 +3069,7 @@ def check_storage_dflags(dflags, dscheck = None, logact = 0): return msgary # -# check a RDA file is backed up or not for given file record; +# check a GDEX file is backed up or not for given file record; # clear the cached bfile records if frec is None. # return 0 if not yet, 1 if backed up, or -1 if backed up but modified # diff --git a/src/rda_python_common/PgLOG.py b/src/rda_python_common/PgLOG.py index e176656..574435f 100644 --- a/src/rda_python_common/PgLOG.py +++ b/src/rda_python_common/PgLOG.py @@ -59,7 +59,7 @@ EMLSUM = (0x08000) # record as email summary EMEROL = (0x10000) # record error as email only EMLALL = (0x1D208) # all email acts -DOSUDO = (0x20000) # add 'sudo -u PGLOG['RDAUSER']' +DOSUDO = (0x20000) # add 'sudo -u PGLOG['GDEXUSER']' NOTLOG = (0x40000) # do not log any thing OVRIDE = (0x80000) # do override existing file or record NOWAIT = (0x100000) # do not wait on globus task to finish @@ -99,9 +99,9 @@ 'BACKROOT': "/DRDATA/DECS", # backup path for desaster recovering tape on hpss 'OLDAROOT': "/FS/DSS", # old root path on hpss 'OLDBROOT': "/DRDATA/DSS", # old backup tape on hpss - 'RDAUSER' : "rdadata", # common rda user name - 'RDAEMAIL' : "zji", # specialist to receipt email intead of common rda user name - 'SUDORDA' : 0, # 1 to allow sudo to PGLOG['RDAUSER'] + 'GDEXUSER' : "gdexdata", # common gdex user name + 'GDEXEMAIL' : "zji", # specialist to receipt email intead of common gdex user name + 'SUDOGDEX' : 0, # 1 to allow sudo to PGLOG['GDEXUSER'] 'HOSTNAME' : '', # current host name the process in running on 'OBJCTSTR' : "object", 'BACKUPNM' : "quasar", @@ -121,7 +121,7 @@ 'SLMTIME' : 604800, # max runtime for SLURM bath job, (7x24x60x60 seconds) 'PBSTIME' : 86400, # max runtime for PBS bath job, (24x60x60 seconds) 'MSSGRP' : None, # set if set to different HPSS group - 'RDAGRP' : "decs", + 'GDEXGRP' : "decs", 'EMLSEND' : None, # path to sendmail, None if not exists 'DSCHECK' : None, # carry some cached dscheck information 'PGDBBUF' : None, # reference to a connected database object @@ -139,6 +139,11 @@ 'EMLPORT' : 25 } +PGLOG['RDAUSER'] = PGLOG['GDEXUSER'] +PGLOG['RDAGRP'] = PGLOG['GDEXGRP'] +PGLOG['RDAEMAIL'] = PGLOG['GDEXEMAIL'] +PGLOG['SUDORDA'] = PGLOG['SUDOGDEX'] + HOSTTYPES = { 'rda' : 'dsg_mach', 'casper' : 'dav', @@ -311,15 +316,15 @@ def send_python_email(subject = None, receiver = None, msg = None, sender = None docc = False if cc else True if not sender: sender = PGLOG['CURUID'] - if sender != PGLOG['RDAUSER']: docc = False - if sender == PGLOG['RDAUSER']: sender = PGLOG['RDAEMAIL'] + if sender != PGLOG['GDEXUSER']: docc = False + if sender == PGLOG['GDEXUSER']: sender = PGLOG['GDEXEMAIL'] if sender.find('@') == -1: sender += "@ucar.edu" if not receiver: receiver = PGLOG['EMLADDR'] if PGLOG['EMLADDR'] else PGLOG['CURUID'] - if receiver == PGLOG['RDAUSER']: receiver = PGLOG['RDAEMAIL'] + if receiver == PGLOG['GDEXUSER']: receiver = PGLOG['GDEXEMAIL'] if receiver.find('@') == -1: receiver += "@ucar.edu" - if docc and not re.match(PGLOG['RDAUSER'], sender): add_carbon_copy(sender, 1) + if docc and not re.match(PGLOG['GDEXUSER'], sender): add_carbon_copy(sender, 1) emlmsg = EmailMessage() emlmsg.set_content(msg) emlmsg['From'] = sender @@ -792,7 +797,7 @@ def pgsystem(pgcmd, logact = LOGWRN, cmdopt = 5, instr = None, seconds = 0): if ret == FAILURE and loop >= loops: errlog |= logact pglog(error, errlog) - if last > PGLOG['CMDTIME'] and not re.search(r'(^|/|\s)(dsarch|dsupdt|dsrqst|rdacp|rdasub)\s', cmdstr): + if last > PGLOG['CMDTIME'] and not re.search(r'(^|/|\s)(dsarch|dsupdt|dsrqst)\s', cmdstr): cmdstr = "> {} Ends By {}".format(break_long_string(cmdstr, 100, "...", 1), current_datetime()) cmd_execute_time(cmdstr, last, cmdact) @@ -1176,11 +1181,11 @@ def get_local_command(cmd, asuser = None): cuser = PGLOG['SETUID'] if PGLOG['SETUID'] else PGLOG['CURUID'] if not asuser or cuser == asuser: return cmd - if cuser == PGLOG['RDAUSER']: + if cuser == PGLOG['GDEXUSER']: wrapper = "pgstart_" + asuser if valid_command(wrapper): return "{} {}".format(wrapper, cmd) - elif PGLOG['SUDORDA'] and asuser == PGLOG['RDAUSER']: - return "sudo -u {} {}".format(PGLOG['RDAUSER'], cmd) # sudo as user rdadata + elif PGLOG['SUDOGDEX'] and asuser == PGLOG['GDEXUSER']: + return "sudo -u {} {}".format(PGLOG['GDEXUSER'], cmd) # sudo as user gdexdata return cmd @@ -1203,12 +1208,12 @@ def get_hpss_command(cmd, asuser = None, hcmd = None): if not hcmd: hcmd = 'hsi' if asuser and cuser != asuser: - if cuser == PGLOG['RDAUSER']: + if cuser == PGLOG['GDEXUSER']: return "{} sudo -u {} {}".format(hcmd, asuser, cmd) # setuid wrapper as user asuser - elif PGLOG['SUDORDA'] and asuser == PGLOG['RDAUSER']: - return "sudo -u {} {} {}".format(PGLOG['RDAUSER'], hcmd, cmd) # sudo as user rdadata + elif PGLOG['SUDOGDEX'] and asuser == PGLOG['GDEXUSER']: + return "sudo -u {} {} {}".format(PGLOG['GDEXUSER'], hcmd, cmd) # sudo as user gdexdata - if cuser != PGLOG['RDAUSER']: + if cuser != PGLOG['GDEXUSER']: if re.match(r'^ls ', cmd) and hcmd == 'hsi': return "hpss" + cmd # use 'hpssls' instead of 'hsi ls' elif re.match(r'^htar -tvf', hcmd): @@ -1225,8 +1230,8 @@ def get_sync_command(host, asuser = None): host = get_short_host(host) - if (not (PGLOG['SETUID'] and PGLOG['SETUID'] == PGLOG['RDAUSER']) and - (not asuser or asuser == PGLOG['RDAUSER'])): + if (not (PGLOG['SETUID'] and PGLOG['SETUID'] == PGLOG['GDEXUSER']) and + (not asuser or asuser == PGLOG['GDEXUSER'])): return "sync" + host return host + "-sync" @@ -1240,7 +1245,7 @@ def set_suid(cuid = 0): if cuid != PGLOG['EUID'] or cuid != PGLOG['RUID']: os.setreuid(cuid, cuid) PGLOG['SETUID'] = pwd.getpwuid(cuid).pw_name - if not (PGLOG['SETUID'] == PGLOG['RDAUSER'] or cuid == PGLOG['RUID']): + if not (PGLOG['SETUID'] == PGLOG['GDEXUSER'] or cuid == PGLOG['RUID']): set_specialist_environments(PGLOG['SETUID']) PGLOG['CURUID'] == PGLOG['SETUID'] # set CURUID to a specific specialist @@ -1256,12 +1261,12 @@ def set_common_pglog(): PGLOG['EUID'] = os.geteuid() PGLOG['CURUID'] = pwd.getpwuid(PGLOG['RUID']).pw_name try: - PGLOG['RDAUID'] = pwd.getpwnam(PGLOG['RDAUSER']).pw_uid - PGLOG['RDAGID'] = grp.getgrnam(PGLOG['RDAGRP']).gr_gid + PGLOG['RDAUID'] = PGLOG['GDEXUID'] = pwd.getpwnam(PGLOG['GDEXUSER']).pw_uid + PGLOG['RDAGID'] = PGLOG['GDEXGID'] = grp.getgrnam(PGLOG['GDEXGRP']).gr_gid except: - PGLOG['RDAUID'] = 0 - PGLOG['RDAGID'] = 0 - if PGLOG['CURUID'] == PGLOG['RDAUSER']: PGLOG['SETUID'] = PGLOG['RDAUSER'] + PGLOG['RDAUID'] = PGLOG['GDEXUID'] = 0 + PGLOG['RDAGID'] = PGLOG['GDEXGID'] = 0 + if PGLOG['CURUID'] == PGLOG['GDEXUSER']: PGLOG['SETUID'] = PGLOG['GDEXUSER'] PGLOG['HOSTNAME'] = get_host() for htype in HOSTTYPES: @@ -1274,7 +1279,7 @@ def set_common_pglog(): PGLOG['NOTBROOT'] = '|'.join([PGLOG['OLDAROOT'], PGLOG['OLDBROOT'], PGLOG['ARCHROOT']]) PGLOG['ALLROOTS'] = '|'.join([PGLOG['OLDAROOT'], PGLOG['OLDBROOT'], PGLOG['ARCHROOT'], PGLOG['BACKROOT']]) SETPGLOG("USRHOME", "/glade/u/home") - SETPGLOG("DSSHOME", "/glade/u/home/rdadata") + SETPGLOG("DSSHOME", "/glade/u/home/gdexdata") SETPGLOG("GDEXHOME", "/data/local") SETPGLOG("ADDPATH", "") SETPGLOG("ADDLIB", "") @@ -1334,7 +1339,7 @@ def set_common_pglog(): SETPGLOG("CNFPATH", PGLOG['DSSHOME']+"/config") # path to configuration files SETPGLOG("DSSURL", "https://gdex.ucar.edu") # current dss web URL SETPGLOG("RQSTURL", "/datasets/request") # request URL path - SETPGLOG("WEBSERVERS", "rda-web-prod01.ucar.edu:rda-web-test01.ucar.edu") # webserver names for Web server + SETPGLOG("WEBSERVERS", "") # webserver names for Web server PGLOG['WEBHOSTS'] = PGLOG['WEBSERVERS'].split(':') if PGLOG['WEBSERVERS'] else [] SETPGLOG("DBMODULE", '') SETPGLOG("LOCDATA", "/data") diff --git a/src/rda_python_common/PgOPT.py b/src/rda_python_common/PgOPT.py index 957b249..93acba3 100644 --- a/src/rda_python_common/PgOPT.py +++ b/src/rda_python_common/PgOPT.py @@ -624,7 +624,7 @@ def set_email_logact(): def validate_dsowner(aname, dsid = None, logname = None, pgds = 0, logact = 0): if not logname: logname = (params['LN'] if 'LN' in params else PgLOG.PGLOG['CURUID']) - if logname == PgLOG.PGLOG['RDAUSER']: return 1 + if logname == PgLOG.PGLOG['GDEXUSER']: return 1 dsids = {} if dsid: @@ -1638,7 +1638,7 @@ def send_request_email_notice(pgrqst, errmsg, fcount, rstat, readyfile = None, p exclude = (einfo['SENDER'] if errmsg else einfo['RECEIVER']) if not errmsg and pgcntl and pgcntl['ccemail']: PgLOG.add_carbon_copy(pgcntl['ccemail'], 1, exclude, pgrqst['specialist']) - if PgLOG.PGLOG['CURUID'] != pgrqst['specialist'] and PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['RDAUSER']: + if PgLOG.PGLOG['CURUID'] != pgrqst['specialist'] and PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['GDEXUSER']: PgLOG.add_carbon_copy(PgLOG.PGLOG['CURUID'], 1, exclude) if 'CC' in params: PgLOG.add_carbon_copy(params['CC'], 0, exclude) einfo['CCD'] = PgLOG.PGLOG['CCDADDR'] diff --git a/src/rda_python_common/PgSIG.py b/src/rda_python_common/PgSIG.py index 6e4fc10..abf27ba 100644 --- a/src/rda_python_common/PgSIG.py +++ b/src/rda_python_common/PgSIG.py @@ -1089,7 +1089,7 @@ def record_background(bcmd, logact = PgLOG.LOGWRN): aname = bcmd mp = r"^\s*(\S+)\s+(\d+)\s+1\s+.*{}(.*)$".format(aname) - pc = "ps -u {},{} -f | grep ' 1 ' | grep {}".format(PgLOG.PGLOG['CURUID'], PgLOG.PGLOG['RDAUSER'], aname) + pc = "ps -u {},{} -f | grep ' 1 ' | grep {}".format(PgLOG.PGLOG['CURUID'], PgLOG.PGLOG['GDEXUSER'], aname) for i in range(2): buf = PgLOG.pgsystem(pc, logact, 20+1024) if buf: @@ -1100,7 +1100,7 @@ def record_background(bcmd, logact = PgLOG.LOGWRN): (uid, sbid, acmd) = ms.groups() bid = int(sbid) if bid in CBIDS: return -1 - if uid == PgLOG.PGLOG['RDAUSER']: + if uid == PgLOG.PGLOG['GDEXUSER']: acmd = re.sub(r'^\.(pl|py)\s+', '', acmd, 1) if re.match(r'^{}{}'.format(aname, acmd), bcmd): continue CBIDS[bid] = bcmd