rda-python-common 2.0.15__tar.gz → 2.0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/PKG-INFO +1 -1
  2. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/pyproject.toml +1 -1
  3. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgLOG.py +1 -1
  4. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_file.py +54 -27
  5. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_log.py +3 -6
  6. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common.egg-info/PKG-INFO +1 -1
  7. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/LICENSE +0 -0
  8. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/README.md +0 -0
  9. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/setup.cfg +0 -0
  10. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgCMD.py +0 -0
  11. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgDBI.py +0 -0
  12. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgFile.py +0 -0
  13. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgLock.py +0 -0
  14. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgOPT.py +0 -0
  15. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgSIG.py +0 -0
  16. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgSplit.py +0 -0
  17. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/PgUtil.py +0 -0
  18. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/__init__.py +0 -0
  19. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_cmd.py +0 -0
  20. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_dbi.py +0 -0
  21. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_lock.py +0 -0
  22. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_opt.py +0 -0
  23. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_password.py +0 -0
  24. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_sig.py +0 -0
  25. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_split.py +0 -0
  26. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pg_util.py +0 -0
  27. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common/pgpassword.py +0 -0
  28. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common.egg-info/SOURCES.txt +0 -0
  29. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common.egg-info/dependency_links.txt +0 -0
  30. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common.egg-info/entry_points.txt +0 -0
  31. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common.egg-info/requires.txt +0 -0
  32. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/src/rda_python_common.egg-info/top_level.txt +0 -0
  33. {rda_python_common-2.0.15 → rda_python_common-2.0.18}/test/test_common.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 2.0.15
3
+ Version: 2.0.18
4
4
  Summary: RDA Python common library codes shared by other RDA python packages
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-common
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_common"
7
- version = "2.0.15"
7
+ version = "2.0.18"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -1305,7 +1305,7 @@ def set_common_pglog():
1305
1305
  PGLOG['PGBATCH'] = ''
1306
1306
 
1307
1307
  pgpath = PGLOG['HOMEBIN']
1308
- PGLOG['LOCHOME'] = "/ncar/rda/setuid"
1308
+ PGLOG['LOCHOME'] = "/ncar/gdex/setuid"
1309
1309
  if not op.isdir(PGLOG['LOCHOME']): PGLOG['LOCHOME'] = "/usr/local/decs"
1310
1310
  pgpath += ":{}/bin".format(PGLOG['LOCHOME'])
1311
1311
  locpath = "{}/bin/{}".format(PGLOG['DSSHOME'], PGLOG['HOSTTYPE'])
@@ -73,7 +73,8 @@ class PgFile(PgUtil, PgSIG):
73
73
  'G': self.PGLOG['GPFSNAME'],
74
74
  'O': self.OHOST,
75
75
  'B': self.BHOST,
76
- 'D': self.DHOST
76
+ 'D': self.DHOST,
77
+
77
78
  }
78
79
  self.DPATHS = {
79
80
  'G': self.PGLOG['DSSDATA'],
@@ -88,7 +89,7 @@ class PgFile(PgUtil, PgSIG):
88
89
  'F': 'FAILED',
89
90
  }
90
91
  self.QPOINTS = {
91
- 'L': 'gdex-glade',
92
+ 'L': 'gdex-glade', # or gdex-lustre
92
93
  'B': 'gdex-quasar',
93
94
  'D': 'gdex-quasar-drdata'
94
95
  }
@@ -252,7 +253,7 @@ class PgFile(PgUtil, PgSIG):
252
253
  if 'user' not in meta: meta['user'] = self.PGLOG['CURUID']
253
254
  if 'group' not in meta: meta['group'] = self.PGLOG['GDEXGRP']
254
255
  uinfo = json.dumps(meta)
255
- finfo = self.check_local_file(fromfile, 0, logact)
256
+ finfo = self.check_local_file(fromfile, 0, logact|self.PFSIZE)
256
257
  if not finfo:
257
258
  if finfo != None: return self.FAILURE
258
259
  return self.lmsg(fromfile, "{} to copy to {}-{}".format(self.PGLOG['MISSFILE'], self.OHOST, tofile), logact)
@@ -260,7 +261,8 @@ class PgFile(PgUtil, PgSIG):
260
261
  tinfo = self.check_object_file(tofile, bucket, 0, logact)
261
262
  if tinfo and tinfo['data_size'] > 0:
262
263
  return self.pglog("{}-{}-{}: file exists already".format(self.OHOST, bucket, tofile), logact)
263
- cmd = "{} ul -lf {} -b {} -k {} -md '{}'".format(self.OBJCTCMD, fromfile, bucket, tofile, uinfo)
264
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
265
+ cmd = "{} ul -lf {} -b {} -k {} -md '{}'".format(ocmd, fromfile, bucket, tofile, uinfo)
264
266
  for loop in range(2):
265
267
  buf = self.pgsystem(cmd, logact, self.CMDBTH)
266
268
  tinfo = self.check_object_file(tofile, bucket, 0, logact)
@@ -293,7 +295,8 @@ class PgFile(PgUtil, PgSIG):
293
295
  destination_endpoint = topoint
294
296
  label = f"{self.ENDPOINTS[frompoint]} to {self.ENDPOINTS[topoint]} {action}"
295
297
  verify_checksum = True
296
- cmd = f'{self.BACKCMD} {action} -se {source_endpoint} -de {destination_endpoint} --label "{label}"'
298
+ bcmd = self.valid_command(self.BACKCMD, logact)
299
+ cmd = f'{bcmd} {action} -se {source_endpoint} -de {destination_endpoint} --label "{label}"'
297
300
  if verify_checksum:
298
301
  cmd += ' -vc'
299
302
  cmd += ' --batch -'
@@ -322,14 +325,14 @@ class PgFile(PgUtil, PgSIG):
322
325
  if tinfo and tinfo['data_size'] > 0:
323
326
  return self.pglog("{}-{}: file exists already".format(topoint, tofile), logact)
324
327
  action = 'transfer'
325
- cmd = f'{self.BACKCMD} {action} -se {frompoint} -de {topoint} -sf {fromfile} -df {tofile} -vc'
328
+ bcmd = self.valid_command(self.BACKCMD, logact)
329
+ cmd = f'{bcmd} {action} -se {frompoint} -de {topoint} -sf {fromfile} -df {tofile} -vc'
326
330
  task = self.submit_globus_task(cmd, topoint, logact)
327
331
  if task['stat'] == 'S':
328
332
  ret = self.SUCCESS
329
333
  elif task['stat'] == 'A':
330
334
  self.TASKIDS["{}-{}".format(topoint, tofile)] = task['id']
331
335
  ret = self.FINISH
332
-
333
336
  return ret
334
337
 
335
338
  # submit a globus task and return a task id
@@ -370,7 +373,8 @@ class PgFile(PgUtil, PgSIG):
370
373
  if not taskid: return ret
371
374
  if not endpoint: endpoint = self.PGLOG['BACKUPEP']
372
375
  mp = r'Status:\s+({})'.format('|'.join(self.QSTATS.values()))
373
- cmd = f"{self.BACKCMD} get-task {taskid}"
376
+ bcmd = self.valid_command(self.BACKCMD, logact)
377
+ cmd = f"{bcmd} get-task {taskid}"
374
378
  astats = ['OK', 'Queued']
375
379
  for loop in range(2):
376
380
  buf = self.pgsystem(cmd, logact, self.CMDRET)
@@ -386,7 +390,7 @@ class PgFile(PgUtil, PgSIG):
386
390
  if logact&self.NOWAIT:
387
391
  errmsg = "{}: Cancel Task due to {}:\n{}".format(taskid, detail, buf)
388
392
  self.errlog(errmsg, 'B', 1, logact)
389
- ccmd = f"{self.BACKCMD} cancel-task {taskid}"
393
+ ccmd = f"{bcmd} cancel-task {taskid}"
390
394
  self.pgsystem(ccmd, logact, 7)
391
395
  else:
392
396
  time.sleep(self.PGSIG['ETIME'])
@@ -498,7 +502,8 @@ class PgFile(PgUtil, PgSIG):
498
502
  if not finfo:
499
503
  if finfo != None: return ret
500
504
  return self.lmsg(fromfile, "{}-{} to copy to {}".format(self.OHOST, self.PGLOG['MISSFILE'], tofile), logact)
501
- cmd = "{} go -k {} -b {}".format(self.OBJCTCMD, fromfile, bucket)
505
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
506
+ cmd = "{} go -k {} -b {}".format(ocmd, fromfile, bucket)
502
507
  fromname = op.basename(fromfile)
503
508
  toname = op.basename(tofile)
504
509
  if toname == tofile:
@@ -509,7 +514,7 @@ class PgFile(PgUtil, PgSIG):
509
514
  loop = reset = 0
510
515
  while (loop-reset) < 2:
511
516
  buf = self.pgsystem(cmd, logact, self.CMDBTH)
512
- info = self.check_local_file(fromname, 143, logact) # 1+2+4+8+128
517
+ info = self.check_local_file(fromname, 143, logact|self.PFSIZE) # 1+2+4+8+128
513
518
  if info:
514
519
  if info['data_size'] == finfo['data_size']:
515
520
  self.set_local_mode(fromfile, info['isfile'], 0, info['mode'], info['logname'], logact)
@@ -603,12 +608,13 @@ class PgFile(PgUtil, PgSIG):
603
608
  # Delete a file on object store
604
609
  def delete_object_file(self, file, bucket = None, logact = 0):
605
610
  if not bucket: bucket = self.PGLOG['OBJCTBKT']
611
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
606
612
  for loop in range(2):
607
613
  list = self.object_glob(file, bucket, 0, logact)
608
614
  if not list: return self.FAILURE
609
615
  errmsg = None
610
616
  for key in list:
611
- cmd = "{} dl {} -b {}".format(self.OBJCTCMD, key, bucket)
617
+ cmd = "{} dl {} -b {}".format(ocmd, key, bucket)
612
618
  if not self.pgsystem(cmd, logact, self.CMDERR):
613
619
  errmsg = self.PGLOG['SYSERR']
614
620
  break
@@ -622,7 +628,8 @@ class PgFile(PgUtil, PgSIG):
622
628
  if not endpoint: endpoint = self.PGLOG['BACKUPEP']
623
629
  info = self.check_backup_file(file, endpoint, 0, logact)
624
630
  if not info: return self.FAILURE
625
- cmd = f"{self.BACKCMD} delete -ep {endpoint} -tf {file}"
631
+ bcmd = self.valid_command(self.BACKCMD, logact)
632
+ cmd = f"{bcmd} delete -ep {endpoint} -tf {file}"
626
633
  task = self.submit_globus_task(cmd, endpoint, logact)
627
634
  if task['stat'] == 'S':
628
635
  return self.SUCCESS
@@ -775,8 +782,9 @@ class PgFile(PgUtil, PgSIG):
775
782
  return self.errlog("{}-{}: Object File exists, cannot move {}-{} to it".format(tobucket, tofile, frombucket, fromfile), 'R', 1, logact)
776
783
  elif tinfo != None:
777
784
  return self.FAILURE
778
- cmd = "{} mv -b {} -db {} -k {} -dk {}".format(self.OBJCTCMD, frombucket, tobucket, fromfile, tofile)
779
- ucmd = "{} gm -k {} -b {}".format(self.OBJCTCMD, fromfile, frombucket)
785
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
786
+ cmd = "{} mv -b {} -db {} -k {} -dk {}".format(ocmd, frombucket, tobucket, fromfile, tofile)
787
+ ucmd = "{} gm -k {} -b {}".format(ocmd, fromfile, frombucket)
780
788
  ubuf = self.pgsystem(ucmd, self.LOGWRN, self.CMDRET)
781
789
  if ubuf and re.match(r'^\{', ubuf): cmd += " -md '{}'".format(ubuf)
782
790
  for loop in range(2):
@@ -808,7 +816,8 @@ class PgFile(PgUtil, PgSIG):
808
816
  return self.SUCCESS
809
817
  else:
810
818
  return self.errlog("{}-{}: {} to move".format(frombucket, frompath, self.PGLOG['MISSFILE']), 'R', 1, logact)
811
- cmd = "{} mv -b {} -db {} -k {} -dk {}".format(self.OBJCTCMD, frombucket, tobucket, frompath, topath)
819
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
820
+ cmd = "{} mv -b {} -db {} -k {} -dk {}".format(ocmd, frombucket, tobucket, frompath, topath)
812
821
  for loop in range(2):
813
822
  buf = self.pgsystem(cmd, logact, self.CMDBTH)
814
823
  fcnt = self.check_object_path(frompath, frombucket, logact)
@@ -837,7 +846,8 @@ class PgFile(PgUtil, PgSIG):
837
846
  return self.errlog("{}: File exists, cannot move {} to it".format(tofile, fromfile), 'B', 1, logact)
838
847
  elif tinfo != None:
839
848
  return ret
840
- cmd = f"{self.BACKCMD} rename -ep {endpoint} --old-path {fromfile} --new-path {tofile}"
849
+ bcmd = self.valid_command(self.BACKCMD, logact)
850
+ cmd = f"{bcmd} rename -ep {endpoint} --old-path {fromfile} --new-path {tofile}"
841
851
  loop = 0
842
852
  while loop < 2:
843
853
  buf = self.pgsystem(cmd, logact, self.CMDRET)
@@ -935,7 +945,8 @@ class PgFile(PgUtil, PgSIG):
935
945
  return self.FAILURE
936
946
  if not odir: odir = dir
937
947
  if not self.make_one_backup_directory(op.dirname(dir), odir, endpoint, logact): return self.FAILURE
938
- cmd = f"{self.BACKCMD} mkdir -ep {endpoint} -p {dir}"
948
+ bcmd = self.valid_command(self.BACKCMD, logact)
949
+ cmd = f"{bcmd} mkdir -ep {endpoint} -p {dir}"
939
950
  for loop in range(2):
940
951
  buf = self.pgsystem(cmd, logact, self.CMDRET)
941
952
  syserr = self.PGLOG['SYSERR']
@@ -1408,8 +1419,11 @@ class PgFile(PgUtil, PgSIG):
1408
1419
  if not bucket: bucket = self.PGLOG['OBJCTBKT']
1409
1420
  ret = None
1410
1421
  if not file: return ret
1411
- cmd = "{} lo {} -b {}".format(self.OBJCTCMD, file, bucket)
1412
- ucmd = "{} gm -k {} -b {}".format(self.OBJCTCMD, file, bucket) if opt&14 else None
1422
+ ms = re.match(r'^(.+)/$', file)
1423
+ if ms: file = ms.group(1) # remove ending '/' in case
1424
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
1425
+ cmd = "{} lo {} -b {}".format(ocmd, file, bucket)
1426
+ ucmd = "{} gm -k {} -b {}".format(ocmd, file, bucket) if opt&14 else None
1413
1427
  loop = 0
1414
1428
  while loop < 2:
1415
1429
  buf = self.pgsystem(cmd, self.LOGWRN, self.CMDRET)
@@ -1417,14 +1431,23 @@ class PgFile(PgUtil, PgSIG):
1417
1431
  if re.match(r'^\[\]', buf): break
1418
1432
  if re.match(r'^\[\{', buf):
1419
1433
  ary = json.loads(buf)
1420
- cnt = len(ary)
1421
- if cnt > 1: return self.pglog("{}-{}: {} records returned\n{}".format(bucket, file, cnt, buf), logact|self.ERRLOG)
1422
1434
  hash = ary[0]
1423
1435
  uhash = None
1424
1436
  if ucmd:
1425
1437
  ubuf = self.pgsystem(ucmd, self.LOGWRN, self.CMDRET)
1426
1438
  if ubuf and re.match(r'^\{', ubuf): uhash = json.loads(ubuf)
1427
1439
  ret = self.object_file_stat(hash, uhash, opt)
1440
+ if ret:
1441
+ cnt = len(ary)
1442
+ if cnt > 1 or hash['Key'] != file:
1443
+ ret['count'] = cnt
1444
+ ret['fname'] = op.basename(file)
1445
+ ret['isfile'] = 0
1446
+ size = 0
1447
+ for a in ary:
1448
+ size += int(a['Size'])
1449
+ ret['data_size'] = size
1450
+ uhash = None
1428
1451
  break
1429
1452
  if opt&64: return self.FAILURE
1430
1453
  errmsg = "Error Execute: {}\n{}".format(cmd, self.PGLOG['SYSERR'])
@@ -1443,7 +1466,8 @@ class PgFile(PgUtil, PgSIG):
1443
1466
  if not bucket: bucket = self.PGLOG['OBJCTBKT']
1444
1467
  ret = None
1445
1468
  if not path: return ret
1446
- cmd = "{} lo {} -ls -b {}".format(self.OBJCTCMD, path, bucket)
1469
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
1470
+ cmd = "{} lo {} -ls -b {}".format(ocmd, path, bucket)
1447
1471
  loop = 0
1448
1472
  while loop < 2:
1449
1473
  buf = self.pgsystem(cmd, self.LOGWRN, self.CMDRET)
@@ -1496,7 +1520,8 @@ class PgFile(PgUtil, PgSIG):
1496
1520
  if not endpoint: endpoint = self.PGLOG['BACKUPEP']
1497
1521
  bdir = op.dirname(file)
1498
1522
  bfile = op.basename(file)
1499
- cmd = f"{self.BACKCMD} ls -ep {endpoint} -p {bdir} --filter {bfile}"
1523
+ bcmd = self.valid_command(self.BACKCMD, logact)
1524
+ cmd = f"{bcmd} ls -ep {endpoint} -p {bdir} --filter {bfile}"
1500
1525
  ccnt = loop = 0
1501
1526
  while loop < 2:
1502
1527
  buf = self.pgsystem(cmd, logact, self.CMDRET)
@@ -1756,7 +1781,8 @@ class PgFile(PgUtil, PgSIG):
1756
1781
  if not bucket: bucket = self.PGLOG['OBJCTBKT']
1757
1782
  ms = re.match(r'^(.+)/$', dir)
1758
1783
  if ms: dir = ms.group(1)
1759
- cmd = "{} lo {} -b {}".format(self.OBJCTCMD, dir, bucket)
1784
+ ocmd = self.valid_command(self.OBJCTCMD, logact)
1785
+ cmd = "{} lo {} -b {}".format(ocmd, dir, bucket)
1760
1786
  ary = err = None
1761
1787
  buf = self.pgsystem(cmd, self.LOGWRN, self.CMDRET)
1762
1788
  if buf:
@@ -1775,7 +1801,7 @@ class PgFile(PgUtil, PgSIG):
1775
1801
  for hash in ary:
1776
1802
  uhash = None
1777
1803
  if opt&10:
1778
- ucmd = "{} gm -l {} -b {}".format(self.OBJCTCMD, hash['Key'], bucket)
1804
+ ucmd = "{} gm -l {} -b {}".format(ocmd, hash['Key'], bucket)
1779
1805
  ubuf = self.pgsystem(ucmd, self.LOGWRN, self.CMDRET)
1780
1806
  if ubuf and re.match(r'^\{.+', ubuf): uhash = json.loads(ubuf)
1781
1807
  info = self.object_file_stat(hash, uhash, opt)
@@ -1794,7 +1820,8 @@ class PgFile(PgUtil, PgSIG):
1794
1820
  def backup_glob(self, dir, endpoint = None, opt = 0, logact = 0):
1795
1821
  if not dir: return None
1796
1822
  if not endpoint: endpoint = self.PGLOG['BACKUPEP']
1797
- cmd = f"{self.BACKCMD} ls -ep {endpoint} -p {dir}"
1823
+ bcmd = self.valid_command(self.BACKCMD, logact)
1824
+ cmd = f"{bcmd} ls -ep {endpoint} -p {dir}"
1798
1825
  flist = {}
1799
1826
  for loop in range(2):
1800
1827
  buf = self.pgsystem(cmd, logact, self.CMDRET)
@@ -101,6 +101,7 @@ class PgLOG:
101
101
  'OBJCTSTR': "object",
102
102
  'BACKUPNM': "quasar",
103
103
  'DRDATANM': "drdata",
104
+ 'TACCNAME': "tacc",
104
105
  'GPFSNAME': "glade",
105
106
  'PBSNAME': "PBS",
106
107
  'DSIDCHRS': "d",
@@ -857,7 +858,7 @@ class PgLOG:
857
858
  if cmd not in self.COMMANDS:
858
859
  buf = shutil.which(cmd)
859
860
  if buf is None:
860
- if logact: self.pglog(cmd + ": executable command not found", logact)
861
+ if logact: self.pglog("{}: executable command not found in\n{}".format(cmd, os.environ.get("PATH")), logact)
861
862
  buf = ''
862
863
  elif option:
863
864
  buf += option
@@ -866,7 +867,6 @@ class PgLOG:
866
867
 
867
868
  # add carbon copies to self.PGLOG['CCDADDR']
868
869
  def add_carbon_copy(self, cc = None, isstr = None, exclude = 0, specialist = None):
869
-
870
870
  if not cc:
871
871
  if cc is None and isstr is None: self.PGLOG['CCDADDR'] = ''
872
872
  else:
@@ -885,28 +885,24 @@ class PgLOG:
885
885
 
886
886
  # get the current host name; or batch sever name if getbatch is 1
887
887
  def get_host(self, getbatch = 0):
888
-
889
888
  if getbatch and self.PGLOG['CURBID'] != 0:
890
889
  host = self.PGLOG['PGBATCH']
891
890
  elif self.PGLOG['HOSTNAME']:
892
891
  return self.PGLOG['HOSTNAME']
893
892
  else:
894
893
  host = socket.gethostname()
895
-
896
894
  return self.get_short_host(host)
897
895
 
898
896
  #
899
897
  # strip domain names and retrun the server name itself
900
898
  #
901
899
  def get_short_host(self, host):
902
-
903
900
  if not host: return ''
904
901
  ms = re.match(r'^([^\.]+)\.', host)
905
902
  if ms: host = ms.group(1)
906
903
  if self.PGLOG['HOSTNAME'] and (host == 'localhost' or host == self.PGLOG['HOSTNAME']): return self.PGLOG['HOSTNAME']
907
904
  HOST = host.upper()
908
905
  if HOST in self.BCHCMDS: return HOST
909
-
910
906
  return host
911
907
 
912
908
  # get a live PBS host name
@@ -1063,6 +1059,7 @@ class PgLOG:
1063
1059
  self.SETPGLOG("OBJCTBKT", "gdex-data") # default Bucket on Object Store
1064
1060
  self.SETPGLOG("BACKUPEP", "gdex-quasar") # default Globus Endpoint on Quasar
1065
1061
  self.SETPGLOG("DRDATAEP", "gdex-quasar-drdata") # DRDATA Globus Endpoint on Quasar
1062
+ self.SETPGLOG("TACCEP", "gdex-tacc") # default Globus Endpoint on TACC
1066
1063
  self.SETPGLOG("DBGFILE", "pgdss.dbg") # debug file name
1067
1064
  self.SETPGLOG("CNFPATH", self.PGLOG['DSSHOME']+"/config") # path to configuration files
1068
1065
  self.SETPGLOG("DSSURL", "https://gdex.ucar.edu") # current dss web URL
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 2.0.15
3
+ Version: 2.0.18
4
4
  Summary: RDA Python common library codes shared by other RDA python packages
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-common