rda-python-dscheck 1.0.8__tar.gz → 2.0.0__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 (20) hide show
  1. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/PKG-INFO +1 -2
  2. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/pyproject.toml +6 -11
  3. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck/PgCheck.py +7 -8
  4. rda_python_dscheck-1.0.8/src/rda_python_dscheck/dscheck.py → rda_python_dscheck-2.0.0/src/rda_python_dscheck/ds_check.py +6 -6
  5. rda_python_dscheck-2.0.0/src/rda_python_dscheck/dscheck.py +532 -0
  6. rda_python_dscheck-2.0.0/src/rda_python_dscheck/pg_check.py +1334 -0
  7. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck.egg-info/PKG-INFO +1 -2
  8. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck.egg-info/SOURCES.txt +2 -0
  9. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck.egg-info/requires.txt +0 -1
  10. rda_python_dscheck-2.0.0/tests/test_dscheck.py +8 -0
  11. rda_python_dscheck-1.0.8/tests/test_dscheck.py +0 -6
  12. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/LICENSE +0 -0
  13. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/MANIFEST.in +0 -0
  14. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/README.md +0 -0
  15. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/setup.cfg +0 -0
  16. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck/__init__.py +0 -0
  17. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck/dscheck.usg +0 -0
  18. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck.egg-info/dependency_links.txt +0 -0
  19. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck.egg-info/entry_points.txt +0 -0
  20. {rda_python_dscheck-1.0.8 → rda_python_dscheck-2.0.0}/src/rda_python_dscheck.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dscheck
3
- Version: 1.0.8
3
+ Version: 2.0.0
4
4
  Summary: RDA python package to add and process batch jobs
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dscheck
@@ -12,7 +12,6 @@ Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: rda_python_common
15
- Requires-Dist: rda_python_setuid
16
15
  Dynamic: license-file
17
16
 
18
17
  RDA python package to add and process batch jobs.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_dscheck"
7
- version = "1.0.8"
7
+ version = "2.0.0"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -18,18 +18,13 @@ classifiers = [
18
18
  "Development Status :: 5 - Production/Stable",
19
19
  ]
20
20
  dependencies = [
21
- "rda_python_common",
22
- "rda_python_setuid",
21
+ "rda_python_common"
23
22
  ]
24
23
 
25
- [tool.setuptools]
26
- include-package-data = true
27
-
28
- [tool.setuptools.packages.find]
29
- where = ["src"]
30
-
31
- [tool.setuptools.package-data]
32
- "rda_python_dscheck" = ["dscheck.usg"]
24
+ [tool.pytest.ini_options]
25
+ pythonpath = [
26
+ "src"
27
+ ]
33
28
 
34
29
  [project.urls]
35
30
  "Homepage" = "https://github.com/NCAR/rda-python-dscheck"
@@ -211,7 +211,7 @@ def check_dscheck_options(cact, aname):
211
211
  "Miss check index per Info option -CI(-CheckIndex)",
212
212
  "Need Machine Hostname per -HN for new daemon control",
213
213
  "Need Application command name per -CM for new daemon control",
214
- "Must be {} to process Checks in daemon mode".format(PgLOG.PGLOG['RDAUSER']),
214
+ "Must be {} to process Checks in daemon mode".format(PgLOG.PGLOG['GDEXUSER']),
215
215
  "Miss Command information per Info option -CM(-Command)",
216
216
  ]
217
217
  erridx = -1
@@ -223,7 +223,7 @@ def check_dscheck_options(cact, aname):
223
223
  if 'DM' in PgOPT.params:
224
224
  if cact != "PC":
225
225
  erridx = 0
226
- elif PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['RDAUSER']:
226
+ elif PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['GDEXUSER']:
227
227
  erridx = 5
228
228
  elif 'CI' in PgOPT.params:
229
229
  erridx = 1
@@ -280,7 +280,7 @@ def check_dscheck_options(cact, aname):
280
280
  wtime = PgOPT.params['WI'] if 'WI' in PgOPT.params else 30
281
281
  logon = PgOPT.params['LO'] if 'LO' in PgOPT.params else 1
282
282
  PgSIG.start_none_daemon(aname, cact, PgOPT.params['LN'], 1, wtime, logon)
283
- if not ('CI' in PgOPT.params or 'DS' in PgOPT.params or PgOPT.params['LN'] == PgLOG.PGLOG['RDAUSER']):
283
+ if not ('CI' in PgOPT.params or 'DS' in PgOPT.params or PgOPT.params['LN'] == PgLOG.PGLOG['GDEXUSER']):
284
284
  PgOPT.set_default_value("SN", PgOPT.params['LN'])
285
285
 
286
286
  # minimal wait interval in seconds for next check
@@ -509,8 +509,7 @@ def dscheck_runtime(start, end = None):
509
509
  #
510
510
  def purge_dschecks(cnd, logact = 0):
511
511
 
512
- cnd += "pid = 0 AND einfo IS NULL AND bid "
513
- cnd += ('> 0' if CHKHOST['curhost'] == PgLOG.PGLOG['PGBATCH'] else '= 0')
512
+ cnd += "pid = 0 AND einfo IS NULL"
514
513
  pgrecs = PgDBI.pgmget("dscheck", "*", cnd, logact)
515
514
  cnt = (len(pgrecs['cindex']) if pgrecs else 0)
516
515
  ctime = int(time.time()) - PgSIG.PGSIG['CTIME']
@@ -582,7 +581,7 @@ def start_one_dscheck(pgrec, logact = 0):
582
581
 
583
582
  lidx = get_process_host(limits, pgrec['hostname'], pgrec['command'], pgrec['action'], logact)
584
583
  if lidx < 0 or skip_dscheck_record(pgrec, host, logact): return 0
585
- cmd = "pgstart_{} ".format(specialist) if PgLOG.PGLOG['CURUID'] == PgLOG.PGLOG['RDAUSER'] else ""
584
+ cmd = "pgstart_{} ".format(specialist) if PgLOG.PGLOG['CURUID'] == PgLOG.PGLOG['GDEXUSER'] else ""
586
585
  if not PgUtil.pgcmp(host, PgLOG.PGLOG['PBSNAME'], 1):
587
586
  if reach_dataset_limit(pgrec): return 0
588
587
  cmd += get_specialist_shell(specialist) + 'qsub '
@@ -1533,7 +1532,7 @@ def validate_daemons():
1533
1532
  if not pgrec:
1534
1533
  PgOPT.action_error("Daemon Control Index '{}' is not in RDADB".format(val))
1535
1534
  elif(PgOPT.OPTS[PgOPT.PGOPT['CACT']][2] > 0 and PgOPT.params['LN'] != pgrec['specialist'] and
1536
- PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['RDAUSER']):
1535
+ PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['GDEXUSER']):
1537
1536
  PgOPT.action_error("{}: must be {}, owner of Daemon Control Index {}".format(PgOPT.params['LN'], pgrec['specialist'], val))
1538
1537
  else: # found none-equal condition sign
1539
1538
  pgrec = PgDBI.pgmget("dsdaemon", "DISTINCT dindex",
@@ -1574,7 +1573,7 @@ def validate_checks():
1574
1573
  if not pgrec:
1575
1574
  PgOPT.action_error("Check Index '{}' is not in RDADB".format(val))
1576
1575
  elif(PgOPT.OPTS[PgOPT.PGOPT['CACT']][2] > 0 and PgOPT.params['LN'] != pgrec['specialist'] and
1577
- PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['RDAUSER']):
1576
+ PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['GDEXUSER']):
1578
1577
  PgOPT.action_error("{}: must be {}, owner of Check Index {}".format(PgOPT.params['LN'], pgrec['specialist'], val))
1579
1578
  else: # found none-equal condition sign
1580
1579
  pgrec = PgDBI.pgmget("dscheck", "cindex", PgDBI.get_field_condition("cindex", PgOPT.params['CI'], 0, 1), PgOPT.PGOPT['extlog'])
@@ -279,7 +279,7 @@ def set_daemon_info():
279
279
  if pgrec:
280
280
  modcnt += PgDBI.pgupdt(tname, record, cnd, PgOPT.PGOPT['extlog'])
281
281
  else:
282
- if 'specialist' not in record and PgOPT.params['LN'] != PgLOG.PGLOG['RDAUSER']: record['specialist'] = PgOPT.params['LN']
282
+ if 'specialist' not in record and PgOPT.params['LN'] != PgLOG.PGLOG['GDEXUSER']: record['specialist'] = PgOPT.params['LN']
283
283
  didx = PgDBI.pgadd(tname, record, PgOPT.PGOPT['extlog']|PgLOG.AUTOID)
284
284
  if didx:
285
285
  PgLOG.pglog("Daemon Control Index {} added".format(didx), PgOPT.PGOPT['wrnlog'])
@@ -506,12 +506,12 @@ def process_dschecks():
506
506
 
507
507
  logact = PgLOG.LOGERR
508
508
 
509
- if PgLOG.PGLOG['CURUID'] == PgLOG.PGLOG['RDAUSER'] and (time.time()%(3*PgSIG.PGSIG['CTIME'])) < 60:
509
+ if PgLOG.PGLOG['CURUID'] == PgLOG.PGLOG['GDEXUSER'] and (time.time()%(3*PgSIG.PGSIG['CTIME'])) < 60:
510
510
  logact |= PgLOG.EMEROL
511
511
 
512
512
  cnd = PgOPT.get_hash_condition("dscheck", "ST", None, 1)
513
513
  if cnd: cnd += " AND "
514
- if 'SN' not in PgOPT.params and PgOPT.params['LN'] != PgLOG.PGLOG['RDAUSER']:
514
+ if 'SN' not in PgOPT.params and PgOPT.params['LN'] != PgLOG.PGLOG['GDEXUSER']:
515
515
  cnd += "specialist = '{}' AND ".format(PgOPT.params['LN'])
516
516
 
517
517
  if 'WR' in PgOPT.params: PgCheck.start_dsrqsts(cnd, logact)
@@ -530,12 +530,12 @@ def process_dscheck_options():
530
530
 
531
531
  logact = PgLOG.LOGERR
532
532
 
533
- if PgLOG.PGLOG['CURUID'] == PgLOG.PGLOG['RDAUSER'] and (time.time()%(3*PgSIG.PGSIG['CTIME'])) < 60:
533
+ if PgLOG.PGLOG['CURUID'] == PgLOG.PGLOG['GDEXUSER'] and (time.time()%(3*PgSIG.PGSIG['CTIME'])) < 60:
534
534
  logact |= PgLOG.EMEROL
535
535
 
536
536
  cnd = PgOPT.get_hash_condition("dscheck", "ST", None, 1)
537
537
  if cnd: cnd += " AND "
538
- if 'SN' not in PgOPT.params and PgOPT.params['LN'] != PgLOG.PGLOG['RDAUSER']:
538
+ if 'SN' not in PgOPT.params and PgOPT.params['LN'] != PgLOG.PGLOG['GDEXUSER']:
539
539
  cnd += "specialist = '{}' AND ".format(PgOPT.params['LN'])
540
540
 
541
541
  acnd = PgOPT.get_hash_condition("dscheck", None, "ST", 1)
@@ -654,7 +654,7 @@ def check_host_connection():
654
654
  hostname = pgrecs['hostname'][i]
655
655
  cmd = "ssh {} ps".format(hostname)
656
656
  if specialist != PgLOG.PGLOG['CURUID']:
657
- if PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['RDAUSER']:
657
+ if PgLOG.PGLOG['CURUID'] != PgLOG.PGLOG['GDEXUSER']:
658
658
  PgLOG.pglog("{}: Cannot check connection to '{}' for {}".format(PgLOG.PGLOG['CURUID'], hostname, specialist), PgLOG.LOGERR)
659
659
  continue
660
660
  else: