Issue Number | 4347 |
---|---|
Summary | Modify CG2Public Job to Process Latest Weekly Job |
Created | 2017-12-11 12:57:14 |
Issue Type | Improvement |
Submitted By | Englisch, Volker (NIH/NCI) [C] |
Assigned To | Kline, Bob (NIH/NCI) [C] |
Status | Closed |
Resolved | 2018-03-17 08:58:19 |
Resolution | Fixed |
Path | /home/bkline/backups/jira/ocecdr/issue.218135 |
Our post-publishing job CG2Public.py copies documents from the output
directory to the "Vendor" directory. It accesses the files of the latest
publishing job to copy. In the rare event that another publishing job
started after the weekly publishing job started but before the CG2Public
job started (i.e. a hot-fix publishing job) the CG2Public job picks up
the wrong directory.
We want to modify this process to identify the correct Job-ID for the
weekly publishing job from the table pub_proc.
For testing purposes on the lower tiers we would still want to be able to overwrite the default Job-ID value.
Installed on DEV. The software now determines the default job
directory by picking the latest successful Export
job from
the pub_proc
table. It is still possible to override the
source directory:
$ python CG2Public.py --help
usage: CG2Public.py [-h] (--testmode | --livemode) [--export | --interim]
[--inputdir INPUTDIR] [--outputdir OUTPUTDIR] [--console]
optional arguments:
https://github.com/NCIOCPL/cdr-publishing/commit/47c92e3
-h, --help show this help message and exit
--testmode, -t
--livemode, -l
--export, -f
--interim, -i
--inputdir INPUTDIR, -s INPUTDIR
--outputdir OUTPUTDIR, -o OUTPUTDIR
--console, -c
The publishing job failed. I believe the following statement in CG2Public.py needs to be modified from
.where("pub_subset", "Export") query
to
.where("pub_subset = 'Export'") query
Right. Same for the next condition. Fixed on DEV. Good catch.
I ran into another error with this program. There were validation errors which were expected due to a DTD change causing the program to fail:
Traceback (most recent call last):
File "D:\cdr\Publishing\CG2Public.py", line 253, in <module>
logger.warnings("CG2Public.py - Finished with Warnings")
AttributeError: 'Logger' object has no attribute 'warnings'
I fixed the typo causing the error and was able to test the program successfully by running the Post Publishing scheduled job.
Changes are on QA.
The program seems to be doing the right thing now.
This had been extensively tested on the lower tiers and I don't want
to run multiple bogus publishing jobs on PROD in order to re-test this
rare occurrence of the problem reported.
Closing ticket.
Elapsed: 0:00:00.001322