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

Feature/cli fixes #826

Merged
merged 3 commits into from
Jan 6, 2016
Merged

Conversation

abridgett
Copy link
Contributor

Corrected a duplicated help text.
Also pulled a workaround from http://stackoverflow.com/questions/23349349/argparse-with-required-subparser so that "airflow" prints help rather than an ugly help with python3 (Ubuntu 14.04):

Was:

[2016-01-05 22:31:02,400] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.4/lib2to3/Grammar.txt
[2016-01-05 22:31:02,429] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.4/lib2to3/PatternGrammar.txt
[2016-01-05 22:31:02,553] {__init__.py:36} INFO - Using executor CeleryExecutor
Traceback (most recent call last):
  File "/opt/airflow/bin/airflow", line 15, in <module>
    args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'

Now

2016-01-05 22:14:43,790] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.4/lib2to3/Grammar.txt
[2016-01-05 22:14:43,820] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python3.4/lib2to3/PatternGrammar.txt
[2016-01-05 22:14:43,943] {__init__.py:36} INFO - Using executor CeleryExecutor
usage: airflow [-h]
               {backfill,clear,trigger_dag,run,test,task_state,webserver,scheduler,initdb,resetdb,upgradedb,list_dags,list_tasks,worker,serve_logs,flower,version,kerberos}
               ...
airflow: error: the following arguments are required: subcommand

@@ -427,7 +427,8 @@ def kerberos(args):

def get_parser():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(help='sub-command help')
subparsers = parser.add_subparsers(help='sub-command help', dest='subcommand')
subparsers.required=True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spaces around operator pls

@abridgett
Copy link
Contributor Author

fixed - sorry, really should go and get pylint etc all hooked in properly

@mistercrunch
Copy link
Member

I use flake8 with the git commit hook
https://pypi.python.org/pypi/flake8

It will give warning only for the things you've touched which is nice. Other linters sometimes warn or alter more than what you bargain for.

Thanks for the PR!

mistercrunch added a commit that referenced this pull request Jan 6, 2016
@mistercrunch mistercrunch merged commit 2c15096 into apache:master Jan 6, 2016
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.

2 participants