Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix KeyError on doit list --status when missing file dependency #142

Closed
wants to merge 3 commits into from

Conversation

poliquin
Copy link
Contributor

@poliquin poliquin commented Jul 2, 2016

Tasks missing a file dependency will cause a KeyError on doit list --status because List.STATUS_MAP lacks an 'error' key.

This pull requests resolves the issue by showing 'E' next to the task name.

Example of a problematic dodo.py that causes a KeyError on doit list --status before this fix:

def task_a():
    """Task A"""
    return {
        'actions': ['echo "hello" > a.txt'],
        'file_dep': ['b.txt']  # assume b.txt does not exist
    }

This task raises a KeyError on doit list --status.

This test task is separate from the tasks in tasks_sample because
those tasks are intended to run successfully while a missing file
dependency is intended to illustrate a task that presumably cannot
run without errors.
A task missing a file dependency will result in a KeyError when
running doit list --status because List.STATUS_MAP is missing an
'error' key. These tasks should show 'E' instead.
Tasks missing a file dependency will show 'E' as the status
instead of raising a KeyError.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0003%) to 99.79% when pulling 188dfd2 on poliquin:list_err into 234d9bd on pydoit:master.

@schettino72
Copy link
Member

thanks. squashed and merge. sorry for delay.

You should add yourself to the AUTHORS file

@poliquin poliquin mentioned this pull request Dec 16, 2016
@schettino72 schettino72 reopened this Feb 16, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0009%) to 99.79% when pulling 188dfd2 on poliquin:list_err into 234d9bd on pydoit:master.

@schettino72
Copy link
Member

really merged (and pushed) this time. sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants