NationalGenomicsInfrastructure/ngi_pipeline

ngi_pipeline_start.py will fail if not --restart-all-jobs is specified

Closed this issue · 2 comments

Because of this piece of code:

    if args.restart_all_jobs:
        args.restart_failed_jobs = True
        args.restart_finished_jobs = True
        args.restart_running_jobs = True

You get:

/home/funk_002/anaconda/envs/NGI/lib/python2.7/site-packages/setuptools-7.0-py2.7.egg/pkg_resources.py:1045: UserWarning: /home/funk_002/.python-eggs is writable by group/others and vulnerable to attack when used with get_resource_filename. Consider a more secure location (set with .set_extraction_path or the PYTHON_EGG_CACHE environment variable).
Traceback (most recent call last):
  File "/home/funk_002/anaconda/envs/NGI/bin/ngi_pipeline_start.py", line 4, in <module>
    __import__('pkg_resources').run_script('ngi-pipeline==0.1.0', 'ngi_pipeline_start.py')
  File "/home/funk_002/anaconda/envs/NGI/lib/python2.7/site-packages/setuptools-7.0-py2.7.egg/pkg_resources.py", line 517, in run_script
  File "/home/funk_002/anaconda/envs/NGI/lib/python2.7/site-packages/setuptools-7.0-py2.7.egg/pkg_resources.py", line 1443, in run_script
  File "/home/funk_002/anaconda/envs/NGI/lib/python2.7/site-packages/ngi_pipeline-0.1.0-py2.7.egg/EGG-INFO/scripts/ngi_pipeline_start.py", line 56, in <module>

AttributeError: 'Namespace' object has no attribute 'restart_all_jobs'

I'll fix this, just wanted to document it.

isnt there a default=False ?
doesn't look that way. Oh well.

ohh wait, yes, that was puzzling me... there is a store_true

process_fc.add_argument("-a", "--restart-all", dest="restart_all_jobs", action="store_true",
        help=("Just start any kind of job you can get your hands on regardless of status."))

but this is for the process_fc parser, so when calling the script with the server command that doesn't work. I guess that because the process_fc subparser is not instanciated? I don't really get this bit.