rda-python-dscheck 2.0.0__tar.gz → 2.0.1__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 (19) hide show
  1. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/PKG-INFO +1 -1
  2. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/pyproject.toml +1 -1
  3. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck/dscheck.py +3 -3
  4. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck/dscheck.usg +7 -7
  5. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck/pg_check.py +153 -153
  6. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck.egg-info/PKG-INFO +1 -1
  7. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/LICENSE +0 -0
  8. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/MANIFEST.in +0 -0
  9. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/README.md +0 -0
  10. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/setup.cfg +0 -0
  11. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck/PgCheck.py +0 -0
  12. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck/__init__.py +0 -0
  13. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck/ds_check.py +0 -0
  14. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck.egg-info/SOURCES.txt +0 -0
  15. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck.egg-info/dependency_links.txt +0 -0
  16. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck.egg-info/entry_points.txt +0 -0
  17. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck.egg-info/requires.txt +0 -0
  18. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/src/rda_python_dscheck.egg-info/top_level.txt +0 -0
  19. {rda_python_dscheck-2.0.0 → rda_python_dscheck-2.0.1}/tests/test_dscheck.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dscheck
3
- Version: 2.0.0
3
+ Version: 2.0.1
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_dscheck"
7
- version = "2.0.0"
7
+ version = "2.0.1"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -123,7 +123,7 @@ class DsCheck(PgCheck):
123
123
  ss = "is"
124
124
  subject = "{} active Check Record{}".format(allcnt, s)
125
125
  mbuf = "{} {} listed:\n".format(subject, ss)
126
- pgrecs = {'status' : self.get_check_status(pgrecs, allcnt)}
126
+ pgrecs = {'status': self.get_check_status(pgrecs, allcnt)}
127
127
  for i in range(allcnt):
128
128
  if i > 0: mbuf += self.PGLOG['SEPLINE']
129
129
  mbuf += self.build_check_message(self.onerecord(pgrecs, i))
@@ -362,7 +362,7 @@ class DsCheck(PgCheck):
362
362
  if dlupdt and self.pgexec("UPDATE dlupdt set pid = 0 WHERE lindex = {}".format(dlupdt['lindex']), self.PGOPT['extlog']):
363
363
  self.pglog("Update Local File Index {} unlocked".format(dlupdt['lindex']), self.LOGWRN)
364
364
  elif pgrec['command'] == 'dsrqst':
365
- record = {'status' : 'I', 'pid' : 0}
365
+ record = {'status': 'I', 'pid': 0}
366
366
  if pgrec['otype'] == 'P':
367
367
  table = "ptrqst"
368
368
  field = "pindex"
@@ -494,7 +494,7 @@ class DsCheck(PgCheck):
494
494
  hash = self.TBLHASH[tname]
495
495
  condition = self.get_hash_condition(tname, None, "H", 1)
496
496
  if 'HN' in self.params:
497
- pgrecs = {'specialist' : [], 'hostname' : []}
497
+ pgrecs = {'specialist': [], 'hostname': []}
498
498
  spclsts = self.pgmget(tname, "DISTINCT specialist", condition, self.PGOPT['extlog'])
499
499
  if spclsts:
500
500
  for specialist in spclsts['specialist']:
@@ -170,11 +170,11 @@ categories:
170
170
  is present. Combination of specialist login name, command name and hostname of
171
171
  computer must be unique for for each daemon control record.
172
172
 
173
- Specify host name 'SLURM' for putting the command in the SLURM batch control system. If
173
+ Specify host name 'PBS' for putting the command in the PBS batch control system. If
174
174
  a specified command name is not found in the daemon control, the general 'dscheck'
175
175
  configuration for command name 'ALL' is used.
176
176
 
177
- For example, set daemon control information for schuster, all commands on SLURM hosts,
177
+ For example, set daemon control information for schuster, all commands on PBS hosts,
178
178
  for maximum 4 checks can be processed at the same time with priority 1, the smaller
179
179
  the number the higher the priority is, via input file daemon.ctl
180
180
 
@@ -182,7 +182,7 @@ categories:
182
182
 
183
183
  <<Content of input file daemon.ctl>>
184
184
  DaemonIndex<:>Command<:>Specialist<:>Hostname<:>ProcessLimit<:>Priority<:>
185
- 0<:>schuster<:>ALL<:>SLURM<:>4<:>1<:>
185
+ 0<:>schuster<:>ALL<:>PBS<:>4<:>1<:>
186
186
 
187
187
 
188
188
  3.1.2 Get Daemon Control
@@ -311,11 +311,11 @@ DaemonIndex<:>Command<:>Specialist<:>Hostname<:>ProcessLimit<:>Priority<:>
311
311
  (ls -l | grep test) 1> test2.out 2>test2.err
312
312
 
313
313
  For example, to add testing command 'test2' into 'dscheck' for delayed mode execution on
314
- SLURM
314
+ PBS
315
315
 
316
- dsheck AC -CM test2 -HN SLURM
316
+ dsheck AC -CM test2 -HN PBS
317
317
 
318
- The command 'test2' must be executable at the current working directory on SLURM machines.
318
+ The command 'test2' must be executable at the current working directory on PBS machines.
319
319
 
320
320
 
321
321
  3.2.2 Get Check
@@ -591,7 +591,7 @@ Information options are used to pass information, one or multiple values, into
591
591
 
592
592
  -LH or -LocalHost, specify a local hostname to processes checks on the host for
593
593
  action -PC(-ProcessCheck). It defaults to '' to use the local host name. Specify
594
- SLURM or PBS to process batch jobs.
594
+ PBS to process batch jobs.
595
595
 
596
596
  -MT or -MaxrunTime, specify the maxmum run time for deamon mode. It defaults to 0
597
597
  for unlimit time. For examples, 5000 means seconds, and 1D means 1 day for 86400
@@ -1,15 +1,15 @@
1
1
  ###############################################################################
2
2
  #
3
- # Title : pg_check.py
4
- # Author : Zaihua Ji, zji@ucar.edu
5
- # Date : 08/26/2020
3
+ # Title: pg_check.py
4
+ # Author: Zaihua Ji, zji@ucar.edu
5
+ # Date: 08/26/2020
6
6
  # 2025-02-10 transferred to package rda_python_dscheck from
7
7
  # https://github.com/NCAR/rda-shared-libraries.git
8
8
  # 2025-12-04 convert to class PgOPT
9
- # Purpose : python library module for for holding some global variables and
9
+ # Purpose: python library module for for holding some global variables and
10
10
  # functions for dscheck utility
11
11
  #
12
- # Github : https://github.com/NCAR/rda-python-dscheck.git
12
+ # Github: https://github.com/NCAR/rda-python-dscheck.git
13
13
  #
14
14
  ###############################################################################
15
15
  #
@@ -30,147 +30,147 @@ class PgCheck(PgOPT, PgCMD):
30
30
  self.SHELLS = {} # shell names used by specialists
31
31
  # define initially the needed option values
32
32
  self.OPTS.update({
33
- 'PC' : [0x0004, 'ProcessCheck', 1],
34
- 'AC' : [0x0008, 'AddCheck', 1],
35
- 'GD' : [0x0010, 'GetDaemon', 0],
36
- 'SD' : [0x0020, 'SetDaemon', 1],
37
- 'GC' : [0x0040, 'GetCheck', 0],
38
- 'DL' : [0x0080, 'Delete', 1],
39
- 'UL' : [0x0100, 'UnLockCheck', 1],
40
- 'EC' : [0x0200, 'EmailCheck', 0],
41
- 'IC' : [0x0400, 'InterruptCheck', 1],
42
- 'CH' : [0x1000, 'CheckHost', 0],
43
- 'SO' : [0x1000, 'SetOptions', 1],
44
- 'AW' : [0, 'AnyWhere', 0],
45
- 'BG' : [0, 'BackGround', 0],
46
- 'CP' : [0, 'CheckPending', 0],
47
- 'CS' : [0, 'CheckStatus', 0],
48
- 'FI' : [0, 'ForceInterrrupt', 0],
49
- 'FO' : [0, 'FormatOutput', 0],
50
- 'LO' : [0, 'LogOn', 0],
51
- 'MD' : [0, 'PgDataset', 3],
52
- 'NC' : [0, 'NoCommand', 0],
53
- 'ND' : [0, 'NewDaemon', 0],
54
- 'NT' : [0, 'NoTrim', 0],
55
- 'WR' : [0, 'WithdsRqst', 0],
56
- 'WU' : [0, 'WithdsUpdt', 0],
57
- 'DM' : [1, 'DaemonMode', 1], # for action PC, start|quit|logon|logoff
58
- 'DV' : [1, 'Divider', 1], # default to <:>
59
- 'ES' : [1, 'EqualSign', 1], # default to <=>
60
- 'FN' : [1, 'FieldNames', 0],
61
- 'LH' : [1, 'LocalHost', 0, ''],
62
- 'MT' : [1, 'MaxrunTime', 0],
63
- 'OF' : [1, 'OutputFile', 0],
64
- 'ON' : [1, 'OrderNames', 0],
65
- 'AO' : [1, 'ActOption', 1], # default to <!>
66
- 'WI' : [1, 'WaitInterval', 1],
67
- 'AN' : [2, 'ActionName', 0],
68
- 'AV' : [2, 'ArgumentVector', 0],
69
- 'AX' : [2, 'ArgumenteXtra', 0],
70
- 'CC' : [2, 'CarbonCopy', 0],
71
- 'CD' : [2, 'CheckDate', 256],
72
- 'CI' : [2, 'CheckIndex', 16],
73
- 'CM' : [2, 'Command', 1],
74
- 'CT' : [2, 'CheckTime', 32],
75
- 'DB' : [2, 'Debug', 0],
76
- 'DC' : [2, 'DoneCount', 17],
77
- 'DF' : [2, 'DownFlags', 1],
78
- 'DI' : [2, 'DaemonIndex', 16],
79
- 'DS' : [2, 'Dataset', 1],
80
- 'ER' : [2, 'ERrormessage', 0],
81
- 'EV' : [2, 'Environments', 1],
82
- 'FC' : [2, 'FileCount', 17],
83
- 'HN' : [2, 'HostName', 1],
84
- 'IF' : [2, 'InputFile', 0],
85
- 'MC' : [2, 'MaxCount', 17],
86
- 'MH' : [2, 'MatchHost', 1],
87
- 'MO' : [2, 'Modules', 1],
88
- 'PI' : [2, 'ParentIndex', 17],
89
- 'PL' : [2, 'ProcessLimit', 17],
90
- 'PO' : [2, 'Priority', 17],
91
- 'PQ' : [2, 'PBSQueue', 0],
92
- 'QS' : [2, 'QSubOptions', 0],
93
- 'SN' : [2, 'Specialist', 1],
94
- 'ST' : [2, 'Status', 0],
95
- 'SZ' : [2, 'DataSize', 16],
96
- 'TC' : [2, 'TryCount', 17],
97
- 'WD' : [2, 'WorkDir', 0],
33
+ 'PC': [0x0004, 'ProcessCheck', 1],
34
+ 'AC': [0x0008, 'AddCheck', 1],
35
+ 'GD': [0x0010, 'GetDaemon', 0],
36
+ 'SD': [0x0020, 'SetDaemon', 1],
37
+ 'GC': [0x0040, 'GetCheck', 0],
38
+ 'DL': [0x0080, 'Delete', 1],
39
+ 'UL': [0x0100, 'UnLockCheck', 1],
40
+ 'EC': [0x0200, 'EmailCheck', 0],
41
+ 'IC': [0x0400, 'InterruptCheck', 1],
42
+ 'CH': [0x1000, 'CheckHost', 0],
43
+ 'SO': [0x1000, 'SetOptions', 1],
44
+ 'AW': [0, 'AnyWhere', 0],
45
+ 'BG': [0, 'BackGround', 0],
46
+ 'CP': [0, 'CheckPending', 0],
47
+ 'CS': [0, 'CheckStatus', 0],
48
+ 'FI': [0, 'ForceInterrrupt', 0],
49
+ 'FO': [0, 'FormatOutput', 0],
50
+ 'LO': [0, 'LogOn', 0],
51
+ 'MD': [0, 'PgDataset', 3],
52
+ 'NC': [0, 'NoCommand', 0],
53
+ 'ND': [0, 'NewDaemon', 0],
54
+ 'NT': [0, 'NoTrim', 0],
55
+ 'WR': [0, 'WithdsRqst', 0],
56
+ 'WU': [0, 'WithdsUpdt', 0],
57
+ 'DM': [1, 'DaemonMode', 1], # for action PC, start|quit|logon|logoff
58
+ 'DV': [1, 'Divider', 1], # default to <:>
59
+ 'ES': [1, 'EqualSign', 1], # default to <=>
60
+ 'FN': [1, 'FieldNames', 0],
61
+ 'LH': [1, 'LocalHost', 0, ''],
62
+ 'MT': [1, 'MaxrunTime', 0],
63
+ 'OF': [1, 'OutputFile', 0],
64
+ 'ON': [1, 'OrderNames', 0],
65
+ 'AO': [1, 'ActOption', 1], # default to <!>
66
+ 'WI': [1, 'WaitInterval', 1],
67
+ 'AN': [2, 'ActionName', 0],
68
+ 'AV': [2, 'ArgumentVector', 0],
69
+ 'AX': [2, 'ArgumenteXtra', 0],
70
+ 'CC': [2, 'CarbonCopy', 0],
71
+ 'CD': [2, 'CheckDate', 256],
72
+ 'CI': [2, 'CheckIndex', 16],
73
+ 'CM': [2, 'Command', 1],
74
+ 'CT': [2, 'CheckTime', 32],
75
+ 'DB': [2, 'Debug', 0],
76
+ 'DC': [2, 'DoneCount', 17],
77
+ 'DF': [2, 'DownFlags', 1],
78
+ 'DI': [2, 'DaemonIndex', 16],
79
+ 'DS': [2, 'Dataset', 1],
80
+ 'ER': [2, 'ERrormessage', 0],
81
+ 'EV': [2, 'Environments', 1],
82
+ 'FC': [2, 'FileCount', 17],
83
+ 'HN': [2, 'HostName', 1],
84
+ 'IF': [2, 'InputFile', 0],
85
+ 'MC': [2, 'MaxCount', 17],
86
+ 'MH': [2, 'MatchHost', 1],
87
+ 'MO': [2, 'Modules', 1],
88
+ 'PI': [2, 'ParentIndex', 17],
89
+ 'PL': [2, 'ProcessLimit', 17],
90
+ 'PO': [2, 'Priority', 17],
91
+ 'PQ': [2, 'PBSQueue', 0],
92
+ 'QS': [2, 'QSubOptions', 0],
93
+ 'SN': [2, 'Specialist', 1],
94
+ 'ST': [2, 'Status', 0],
95
+ 'SZ': [2, 'DataSize', 16],
96
+ 'TC': [2, 'TryCount', 17],
97
+ 'WD': [2, 'WorkDir', 0],
98
98
  })
99
99
  self.ALIAS.update({
100
- 'AN' : ['Action'],
101
- 'BG' : ['b'],
102
- 'CF' : ['Confirmation', 'ConfirmAction'],
103
- 'CM' : ['CommandName'],
104
- 'DL' : ['RM', 'Remove'],
105
- 'DS' : ['Dsid', 'DatasetID'],
106
- 'DV' : ['Delimiter', 'Separater'],
107
- 'EV' : ['Envs'],
108
- 'GZ' : ['GMT', 'GreenwichZone', 'UTC'],
109
- 'MC' : ['MaximumCount', 'MaxTryCount'],
110
- 'MH' : ['MatchHostname'],
111
- 'NC' : ['NoRemoteCommand'],
112
- 'MO' : ['Mods'],
113
- 'PI' : ['ParentCheckIndex'],
114
- 'QS' : ['PBSOptions'],
115
- 'SO' : ['SetBatchOptions'],
116
- 'SZ' : ['Size', "ProcSize"],
117
- 'UL' : ['UnLock'],
118
- 'WD' : ["WorkDirectory"],
119
- 'WR' : ["WithRequest"],
120
- 'WU' : ["WithUpdate"],
100
+ 'AN': ['Action'],
101
+ 'BG': ['b'],
102
+ 'CF': ['Confirmation', 'ConfirmAction'],
103
+ 'CM': ['CommandName'],
104
+ 'DL': ['RM', 'Remove'],
105
+ 'DS': ['Dsid', 'DatasetID'],
106
+ 'DV': ['Delimiter', 'Separater'],
107
+ 'EV': ['Envs'],
108
+ 'GZ': ['GMT', 'GreenwichZone', 'UTC'],
109
+ 'MC': ['MaximumCount', 'MaxTryCount'],
110
+ 'MH': ['MatchHostname'],
111
+ 'NC': ['NoRemoteCommand'],
112
+ 'MO': ['Mods'],
113
+ 'PI': ['ParentCheckIndex'],
114
+ 'QS': ['PBSOptions'],
115
+ 'SO': ['SetBatchOptions'],
116
+ 'SZ': ['Size', "ProcSize"],
117
+ 'UL': ['UnLock'],
118
+ 'WD': ["WorkDirectory"],
119
+ 'WR': ["WithRequest"],
120
+ 'WU': ["WithUpdate"],
121
121
  })
122
122
  self.TBLHASH['dscheck'] = {
123
123
  #SHORTNM KEYS DBFIELD
124
- 'C' : ['CI', "cindex", 0],
125
- 'O' : ['CM', "command", 1],
126
- 'V' : ['AV', "argv", 1],
127
- 'T' : ['DS', "dsid", 1],
128
- 'A' : ['AN', "action", 1],
129
- 'U' : ['ST', "status", 1],
130
- 'P' : ['PQ', "pbsqueue", 1],
131
- 'R' : ['PI', "pindex", 0],
132
- 'B' : ['DF', "dflags", 0],
133
- 'F' : ['FC', "fcount", 0],
134
- 'J' : ['DC', "dcount", 0],
135
- 'K' : ['TC', "tcount", 0],
136
- 'L' : ['MC', "mcount", 0],
137
- 'Z' : ['SZ', "size", 0],
138
- 'D' : ['CD', "date", 1],
139
- 'Y' : ['CT', "time", 1],
140
- 'H' : ['HN', "hostname", 1],
141
- 'N' : ['SN', "specialist", 1],
142
- 'W' : ['WD', "workdir", 1],
143
- 'M' : ['MO', "modules", 1],
144
- 'I' : ['EV', "environments", 1],
145
- 'Q' : ['QS', "qoptions", 1],
146
- 'X' : ['AX', "argextra", -1],
147
- 'E' : ['ER', "errmsg", -1],
124
+ 'C': ['CI', "cindex", 0],
125
+ 'O': ['CM', "command", 1],
126
+ 'V': ['AV', "argv", 1],
127
+ 'T': ['DS', "dsid", 1],
128
+ 'A': ['AN', "action", 1],
129
+ 'U': ['ST', "status", 1],
130
+ 'P': ['PQ', "pbsqueue", 1],
131
+ 'R': ['PI', "pindex", 0],
132
+ 'B': ['DF', "dflags", 0],
133
+ 'F': ['FC', "fcount", 0],
134
+ 'J': ['DC', "dcount", 0],
135
+ 'K': ['TC', "tcount", 0],
136
+ 'L': ['MC', "mcount", 0],
137
+ 'Z': ['SZ', "size", 0],
138
+ 'D': ['CD', "date", 1],
139
+ 'Y': ['CT', "time", 1],
140
+ 'H': ['HN', "hostname", 1],
141
+ 'N': ['SN', "specialist", 1],
142
+ 'W': ['WD', "workdir", 1],
143
+ 'M': ['MO', "modules", 1],
144
+ 'I': ['EV', "environments", 1],
145
+ 'Q': ['QS', "qoptions", 1],
146
+ 'X': ['AX', "argextra", -1],
147
+ 'E': ['ER', "errmsg", -1],
148
148
  }
149
149
  self.TBLHASH['dsdaemon'] = {
150
150
  #SHORTNM KEYS DBFIELD
151
- 'I' : ['DI', "dindex", 0],
152
- 'C' : ['CM', "command", 1],
153
- 'H' : ['HN', "hostname", 1],
154
- 'M' : ['MH', "matchhost", 1],
155
- 'S' : ['SN', "specialist", 1],
156
- 'P' : ['PL', "proclimit", 0],
157
- 'O' : ['PO', "priority", 0],
151
+ 'I': ['DI', "dindex", 0],
152
+ 'C': ['CM', "command", 1],
153
+ 'H': ['HN', "hostname", 1],
154
+ 'M': ['MH', "matchhost", 1],
155
+ 'S': ['SN', "specialist", 1],
156
+ 'P': ['PL', "proclimit", 0],
157
+ 'O': ['PO', "priority", 0],
158
158
  }
159
159
  self.CHKHOST = {
160
- 'curhost' : self.get_host(1),
161
- 'chkhost' : None,
162
- 'hostcond' : None,
163
- 'isbatch' : 0
160
+ 'curhost': self.get_host(1),
161
+ 'chkhost': None,
162
+ 'hostcond': None,
163
+ 'isbatch': 0
164
164
  }
165
165
  self.PGOPT['dscheck'] = "COVTUPFJDNW" # default
166
166
  self.PGOPT['chkall'] = "COVTAUPRBFJKLZDYHNWMIQXE" # default to all
167
167
  self.PGOPT['dsdaemon'] = "ICHQSPO" # default to all
168
168
  self.PGOPT['waitlimit'] = 280 # limit of C and P request checks at a time
169
169
  self.PGOPT['totallimit'] = 380 # maximum number of checks can be started on PBS
170
- self.PBSQUEUES = {'rda' : None, 'htc' : 'casper@casper-pbs'}
171
- self.PBSTIMES = {'default' : 21600, 'rda' : self.PGLOG['PBSTIME'], 'htc' : 86400}
172
- #self.DOPTHOSTS = {'rda-work' : None, 'PBS' : ['!subconv -Q']}
173
- self.DOPTHOSTS = {'rda-work' : None, 'PBS' : None, 'cron' : None}
170
+ self.PBSQUEUES = {'rda': None, 'htc': 'casper@casper-pbs'}
171
+ self.PBSTIMES = {'default': 21600, 'rda': self.PGLOG['PBSTIME'], 'htc': 86400}
172
+ #self.DOPTHOSTS = {'rda-work': None, 'PBS': ['!subconv -Q']}
173
+ self.DOPTHOSTS = {'rda-work': None, 'PBS': None, 'cron': None}
174
174
  self.DSLMTS = {}
175
175
  self.EMLMTS = {}
176
176
 
@@ -280,7 +280,7 @@ class PgCheck(PgOPT, PgCMD):
280
280
  self.PLIMITS[ckey] = 0
281
281
  return 0
282
282
  j = 0
283
- self.PLIMITS[ckey] = {'host' : [], 'priority' : [], 'acnt' : [], 'match' : [], 'pcnd' : []}
283
+ self.PLIMITS[ckey] = {'host': [], 'priority': [], 'acnt': [], 'match': [], 'pcnd': []}
284
284
  for i in range(cnt):
285
285
  if pgrecs['proclimit'][i] <= 0: continue
286
286
  host = pgrecs['hostname'][i]
@@ -366,7 +366,7 @@ class PgCheck(PgOPT, PgCMD):
366
366
  else:
367
367
  self.update_dscheck_time(pgrec, ltime, logact)
368
368
  elif not pgrec['lockhost'] or pgrec['lockhost'] == 'rda_config':
369
- record = {'pid' : 0, 'lockhost' : ''}
369
+ record = {'pid': 0, 'lockhost': ''}
370
370
  if self.pgupdt("dscheck", record, "cindex = {} AND pid = {}".format(cidx, pgrec['pid']), logact):
371
371
  self.pglog("CHK{}: unlocked {}".format(cidx, lmsg), self.LOGWRN)
372
372
  lcnt += 1
@@ -398,7 +398,7 @@ class PgCheck(PgOPT, PgCMD):
398
398
  # update dscheck time in case in pending status or
399
399
  # the command does not updateupdates not on time by itself
400
400
  def update_dscheck_time(self, pgrec, ltime, logact = 0):
401
- record = {'chktime' : ltime}
401
+ record = {'chktime': ltime}
402
402
  if(self.CHKHOST['chkhost'] and self.CHKHOST['chkhost'] == self.PGLOG['PBSNAME']
403
403
  and pgrec['lockhost'] == self.PGLOG['PBSNAME']):
404
404
  info = self.get_pbs_info(pgrec['pid'], 0, logact)
@@ -756,7 +756,7 @@ class PgCheck(PgOPT, PgCMD):
756
756
  newrec['stttime'] > pgrec['stttime'] or newrec['tcount'] > pgrec['tcount']): return 1
757
757
  if self.lock_dscheck(pgrec['cindex'], 1) <= 0: return 1
758
758
  if pgrec['subtime'] or pgrec['stttime']:
759
- newrec = {'stttime' : 0, 'subtime' : 0, 'runhost' : '', 'bid' : 0}
759
+ newrec = {'stttime': 0, 'subtime': 0, 'runhost': '', 'bid': 0}
760
760
  (newrec['ttltime'], newrec['quetime']) = self.get_dscheck_runtime(pgrec)
761
761
  if not self.pgupdt("dscheck", newrec, "cindex = {}".format(pgrec['cindex']), logact): return 1
762
762
  return 0
@@ -808,7 +808,7 @@ class PgCheck(PgOPT, PgCMD):
808
808
  def validate_dsrqst_partitions(self, pgrec, logact = 0):
809
809
  pgctl = self.get_dsrqst_control(pgrec, logact)
810
810
  if pgctl and (pgctl['ptlimit'] or pgctl['ptsize']): return True
811
- record = {'ptcount' : 1}
811
+ record = {'ptcount': 1}
812
812
  pgrec['ptcount'] = 1
813
813
  if pgrec['ptlimit']: pgrec['ptlimit'] = record['ptlimit'] = 0
814
814
  if pgrec['ptsize']: pgrec['ptsize'] = record['ptsize'] = 0
@@ -828,7 +828,7 @@ class PgCheck(PgOPT, PgCMD):
828
828
  if self.lock_dscheck(pgrec['cindex'], 1) <= 0: continue
829
829
  qoptions = self.build_dscheck_options(pgrec, 'qoptions', 'PBS')
830
830
  if not qoptions and pgrec['status'] == 'E': continue # failed evaluating qoptions
831
- record = {'pid' : 0, 'qoptions': qoptions}
831
+ record = {'pid': 0, 'qoptions': qoptions}
832
832
  qcnt += self.pgupdt('dscheck', record, "cindex = {}".format(pgrec['cindex']), self.PGOPT['errlog'])
833
833
  if qcnt and cnt > 1: self.pglog("{} of {} DSCHECK PBS options Dynamically set on {}".format(qcnt, cnt, self.PGLOG['HOSTNAME']), self.WARNLG)
834
834
 
@@ -927,7 +927,7 @@ class PgCheck(PgOPT, PgCMD):
927
927
  self.pglog("Rqst{}: time updated for {}".format(ridx, lmsg), self.LOGWRN|self.FRCLOG)
928
928
  elif(not pgrec['lockhost'] or pgrec['lockhost'] == 'rda_config' or pgrec['lockhost'] == 'partition' and
929
929
  not self.pgget('ptrqst', '', "rindex = {} AND pid > 0".format(ridx), logact)):
930
- record = {'pid' : 0, 'lockhost' : ''}
930
+ record = {'pid': 0, 'lockhost': ''}
931
931
  if self.pgupdt("dsrqst", record, "rindex = {} AND pid = {}".format(ridx, pgrec['pid']), logact):
932
932
  self.pglog("Rqst{}: unlocked {}".format(ridx, pgrec['lockhost'], pgrec['pid'], self.current_datetime(ltime)), self.LOGWRN)
933
933
  lcnt += 1
@@ -956,7 +956,7 @@ class PgCheck(PgOPT, PgCMD):
956
956
  not self.pgget("dscheck", "", "oindex = {} AND command = 'dsrqst' AND otype = 'P'".format(pidx))):
957
957
  self.pglog("RPT{}: time updated for {}".format(pidx, lmsg), self.LOGWRN)
958
958
  elif not pgrec['lockhost'] or pgrec['lockhost'] == 'rda_config':
959
- record = {'pid' : 0, 'lockhost' : ''}
959
+ record = {'pid': 0, 'lockhost': ''}
960
960
  if self.pgupdt("ptrqst", record, "pindex = {} AND pid = {}".format(pidx, pgrec['pid']), logact):
961
961
  self.pglog("RPT{}: unlocked {}".format(pidx, lmsg), self.LOGWRN)
962
962
  lcnt += 1
@@ -973,7 +973,7 @@ class PgCheck(PgOPT, PgCMD):
973
973
  cnd += " OR status = 'O' AND (date_purge < '{}' OR date_purge = '{}' AND time_purge < '{}')) ORDER BY rindex".format(sdate, sdate, stime)
974
974
  pgrecs = self.pgmget("dsrqst", "rindex, dsid, email, specialist", cnd, logact)
975
975
  cnt = (len(pgrecs['rindex']) if pgrecs else 0)
976
- pgctl = {'qoptions' : "-l walltime=1:00:00"}
976
+ pgctl = {'qoptions': "-l walltime=1:00:00"}
977
977
  pcnt = 0
978
978
  for i in range(cnt):
979
979
  pgrec = self.onerecord(pgrecs, i)
@@ -1099,7 +1099,7 @@ class PgCheck(PgOPT, PgCMD):
1099
1099
  not self.pgget("dscheck", "", "oindex = {} AND command = 'dsupdt'".format(idx))):
1100
1100
  self.pglog("UC{}: time updated for {}".format(idx, lmsg), self.LOGWRN)
1101
1101
  elif not pgrec['lockhost'] or pgrec['lockhost'] == 'rda_config':
1102
- record = {'pid' : 0, 'lockhost' : ''}
1102
+ record = {'pid': 0, 'lockhost': ''}
1103
1103
  if self.pgupdt("dcupdt", record, "cindex = {} AND pid = {}".format(idx, pgrec['pid']), logact):
1104
1104
  self.pglog("UC{}: unlocked {}".format(idx, lmsg), self.LOGWRN)
1105
1105
  lcnt += 1
@@ -1124,7 +1124,7 @@ class PgCheck(PgOPT, PgCMD):
1124
1124
  continue
1125
1125
  self.pgexec("UPDATE dlupdt SET locktime = {} WHERE lindex = {} AND pid = {}".format(ltime, idx, pgrec['pid']), logact)
1126
1126
  elif not pgrec['hostname'] or pgrec['hostname'] == 'rda_config':
1127
- record = {'pid' : 0, 'hostname' : ''}
1127
+ record = {'pid': 0, 'hostname': ''}
1128
1128
  if self.pgupdt("dlupdt", record, "lindex = {} AND pid = {}".format(idx, pgrec['pid']), logact):
1129
1129
  self.pglog("Updt{}: unlocked {}".format(idx, lmsg), self.LOGWRN)
1130
1130
  lcnt += 1
@@ -1188,8 +1188,8 @@ class PgCheck(PgOPT, PgCMD):
1188
1188
  argv = argv[0:100]
1189
1189
  else:
1190
1190
  argextra = None
1191
- record = {'command' : cmd, 'argv' : argv, 'specialist' : specialist, 'workdir' : workdir,
1192
- 'dsid' : dsid, 'action' : action, 'oindex' : oindex, 'otype' : otype}
1191
+ record = {'command': cmd, 'argv': argv, 'specialist': specialist, 'workdir': workdir,
1192
+ 'dsid': dsid, 'action': action, 'oindex': oindex, 'otype': otype}
1193
1193
  (record['date'], record['time']) = self.get_date_time()
1194
1194
  if argextra: record['argextra'] = argextra
1195
1195
  if 'PI' in self.params: record['pindex'] = self.params['PI'][0]
@@ -1225,16 +1225,16 @@ class PgCheck(PgOPT, PgCMD):
1225
1225
  @staticmethod
1226
1226
  def dscheck_status(stat):
1227
1227
  STATUS = {
1228
- 'C' : "Created",
1229
- 'D' : "Done",
1230
- 'E' : "Exit",
1231
- 'F' : "Finished",
1232
- 'H' : "Held",
1233
- 'I' : "Interrupted",
1234
- 'P' : "Pending",
1235
- 'Q' : "Queueing",
1236
- 'R' : "Run",
1237
- 'S' : "Suspended",
1228
+ 'C': "Created",
1229
+ 'D': "Done",
1230
+ 'E': "Exit",
1231
+ 'F': "Finished",
1232
+ 'H': "Held",
1233
+ 'I': "Interrupted",
1234
+ 'P': "Pending",
1235
+ 'Q': "Queueing",
1236
+ 'R': "Run",
1237
+ 'S': "Suspended",
1238
1238
  }
1239
1239
  return (STATUS[stat] if stat in STATUS else "Unknown")
1240
1240
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dscheck
3
- Version: 2.0.0
3
+ Version: 2.0.1
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