rda-python-common 1.0.29__tar.gz → 1.0.32__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.

Potentially problematic release.


This version of rda-python-common might be problematic. Click here for more details.

Files changed (21) hide show
  1. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/PKG-INFO +1 -1
  2. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/pyproject.toml +1 -1
  3. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgDBI.py +7 -6
  4. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgFile.py +1 -1
  5. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgLOG.py +2 -2
  6. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgOPT.py +1 -1
  7. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common.egg-info/PKG-INFO +1 -1
  8. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/LICENSE +0 -0
  9. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/README.md +0 -0
  10. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/setup.cfg +0 -0
  11. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgCMD.py +0 -0
  12. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgLock.py +0 -0
  13. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgSIG.py +0 -0
  14. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgSplit.py +0 -0
  15. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/PgUtil.py +0 -0
  16. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common/__init__.py +0 -0
  17. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common.egg-info/SOURCES.txt +0 -0
  18. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common.egg-info/dependency_links.txt +0 -0
  19. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common.egg-info/requires.txt +0 -0
  20. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/src/rda_python_common.egg-info/top_level.txt +0 -0
  21. {rda_python_common-1.0.29 → rda_python_common-1.0.32}/test/test_common.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.29
3
+ Version: 1.0.32
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 = "1.0.29"
7
+ version = "1.0.32"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -315,13 +315,13 @@ def aborttran(autocommit = True):
315
315
  #
316
316
  # record error message to dscheck record and clean the lock
317
317
  #
318
- def record_dscheck_error(errmsg):
318
+ def record_dscheck_error(errmsg, logact = PGDBI['EXITLG']):
319
319
 
320
320
  cnd = PgLOG.PGLOG['DSCHECK']['chkcnd']
321
321
  if PgLOG.PGLOG['NOQUIT']: PgLOG.PGLOG['NOQUIT'] = 0
322
322
  dflags = PgLOG.PGLOG['DSCHECK']['dflags']
323
323
 
324
- pgrec = pgget("dscheck", "mcount, tcount, lockhost, pid", cnd, PgLOG.LGEREX)
324
+ pgrec = pgget("dscheck", "mcount, tcount, lockhost, pid", cnd, logact)
325
325
  if not pgrec: return 0
326
326
  if not pgrec['pid'] and not pgrec['lockhost']: return 0
327
327
  (chost, cpid) = PgLOG.current_process_info()
@@ -330,8 +330,9 @@ def record_dscheck_error(errmsg):
330
330
  # update dscheck record only if it is still locked by the current process
331
331
  record = {}
332
332
  record['chktime'] = int(time.time())
333
- record['status'] = "E"
334
- record['pid'] = 0 # release lock
333
+ if logact&PgLOG.EXITLG:
334
+ record['status'] = "E"
335
+ record['pid'] = 0 # release lock
335
336
  if dflags:
336
337
  record['dflags'] = dflags
337
338
  record['mcount'] = pgrec['mcount'] + 1
@@ -343,7 +344,7 @@ def record_dscheck_error(errmsg):
343
344
  if pgrec['tcount'] > 1: errmsg = "Try {}: {}".format(pgrec['tcount'], errmsg)
344
345
  record['errmsg'] = errmsg
345
346
 
346
- return pgupdt("dscheck", record, cnd, PGDBI['ERRLOG'])
347
+ return pgupdt("dscheck", record, cnd, logact)
347
348
 
348
349
  #
349
350
  # local function to log query error
@@ -367,7 +368,7 @@ def qelog(dberror, sleep, sqlstr, vals, pgcnt, logact = PGDBI['ERRLOG']):
367
368
  if vals: sqlstr += " with values: " + str(vals)
368
369
 
369
370
  if dberror: sqlstr = "{}\n{}".format(dberror, sqlstr)
370
- if logact&PgLOG.EXITLG and PgLOG.PGLOG['DSCHECK']: record_dscheck_error(sqlstr)
371
+ if logact&PgLOG.EXITLG and PgLOG.PGLOG['DSCHECK']: record_dscheck_error(sqlstr, logact)
371
372
  PgLOG.pglog(sqlstr, logact)
372
373
  if sleep: time.sleep(sleep)
373
374
 
@@ -145,7 +145,7 @@ def errlog(msg, etype, retry = 0, logact = 0):
145
145
  logact |= PgLOG.EXITLG
146
146
  ECNTS[etype] = 0
147
147
 
148
- if PgLOG.PGLOG['DSCHECK'] and logact&PgLOG.EXITLG: PgDBI.record_dscheck_error(msg)
148
+ if PgLOG.PGLOG['DSCHECK'] and logact&PgLOG.EXITLG: PgDBI.record_dscheck_error(msg, logact)
149
149
  PgLOG.pglog(msg, logact)
150
150
  PgLOG.PGLOG['BCKGRND'] = bckgrnd
151
151
  if not retry: time.sleep(PgSIG.PGSIG['ETIME'])
@@ -1325,8 +1325,8 @@ def set_common_pglog():
1325
1325
  SETPGLOG("SLMHOSTS", "cheyenne:casper") # host names for SLURM server
1326
1326
  SETPGLOG("PBSHOSTS", "cheyenne:casper") # host names for PBS server
1327
1327
  SETPGLOG("CHKHOSTS", "") # host names for dscheck daemon
1328
- SETPGLOG("PVIEWHOST", "rda-pgdb-02.ucar.edu") # host name for view only postgresql server
1329
- SETPGLOG("PMISCHOST", "rda-pgdb-03.ucar.edu") # host name for misc postgresql server
1328
+ SETPGLOG("PVIEWHOST", "pgdb02.k8s.ucar.edu") # host name for view only postgresql server
1329
+ SETPGLOG("PMISCHOST", "pgdb03.k8s.ucar.edu") # host name for misc postgresql server
1330
1330
  SETPGLOG("FTPUPLD", PGLOG['TRANSFER']+"/rossby") # ftp upload path
1331
1331
  PGLOG['GPFSROOTS'] = "{}|{}|{}".format(PGLOG['DSDHOME'], PGLOG['UPDTWKP'], PGLOG['RQSTHOME'])
1332
1332
 
@@ -985,7 +985,7 @@ def action_error(errmsg, cact = None):
985
985
  msg += " of " + params['DS'][0]
986
986
 
987
987
  msg += ": " + errmsg
988
- if PgLOG.PGLOG['DSCHECK']: PgDBI.record_dscheck_error(msg)
988
+ if PgLOG.PGLOG['DSCHECK']: PgDBI.record_dscheck_error(msg, PGOPT['extlog'])
989
989
  PgLOG.pglog(msg, PGOPT['extlog'])
990
990
 
991
991
  #
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 1.0.29
3
+ Version: 1.0.32
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