Issue Number | 4672 |
---|---|
Summary | [Internal] Running FileSweeper From Command Line |
Created | 2019-10-03 13:59:52 |
Issue Type | Bug |
Submitted By | Englisch, Volker (NIH/NCI) [C] |
Assigned To | Kline, Bob (NIH/NCI) [C] |
Status | Closed |
Resolved | 2019-12-03 09:43:05 |
Resolution | Fixed |
Path | /home/bkline/backups/jira/ocecdr/issue.250644 |
Most of our programs are written to be called as a module or to be run (for testing) from the command line.
The FileSweeper program, part of the scheduled tasks (file_sweeper_task.py), currently fails when run from the command line due to problems with importing local packages.
We want to fix this
I think https://github.com/NCIOCPL/cdr-tools/blob/kepler/DevTools/Utilities/run-filesweeper.cmd should address this requirement.
Please close this ticket when you get a chance to test the script, ~volker.
I know the run-filesweeper.cmd won't work anymore with the new
scheduler but should I be able to run file_sweeper_task.py from the
command line?
I'm seeing an error with the relative import of the
base_job.Job class.
Tell me how you're running it.
I'm trying it on the DEV server as well as my DEV WS VM with the same
result.
I was trying to run it as
file_sweeper_task.py --help
but your approach
python -m file_sweeper_task.py --help
gives me the same result.
I am in the following directory (on DEV) when I run this
d:\cdr\Scheduler\jobs
Basically the same technique as was used by
run-filesweeper.cmd
.
Move up one directory (again, same approach as was used by
run-filesweeper.cmd
with the old scheduler).
OK, I see now what I did wrong. RTFM
{{ -m: Since the argument is a module name, you must not give a file extension (.py).}}
It's working now.
Will this help?
File Name | Posted | User |
---|---|---|
image-2020-02-03-14-37-42-784.png | 2020-02-03 14:38:13 | Kline, Bob (NIH/NCI) [C] |
image-2020-02-03-16-03-48-366.png | 2020-02-03 16:04:19 | Kline, Bob (NIH/NCI) [C] |
Elapsed: 0:00:00.001287