Re: Review Request 29698: Simplify client help output to solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67222 --- Ship it! Ship It! - Zameer Manji On Jan. 7, 2015, 7:33 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 7, 2015, 7:33 p.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES is omitted, then all instances will be operated on. unix_command_line optional arguments: -h, --helpshow this help message and exit --threads NUM_THREADS, -t NUM_THREADS
Re: Review Request 29698: Simplify client help output to solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67231 --- Ship it! src/main/python/apache/aurora/client/cli/task.py https://reviews.apache.org/r/29698/#comment15 The majority of subcommand help strings (i.e. jobs.py) start with capital letter. Suggest making it consistent here. - Maxim Khutornenko On Jan. 8, 2015, 3:33 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 3:33 a.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES
Re: Review Request 29698: Simplify client help output to solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67238 --- Ship it! Ship It! - Joshua Cohen On Jan. 8, 2015, 3:33 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 3:33 a.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES is omitted, then all instances will be operated on. unix_command_line optional arguments: -h, --helpshow this help message and exit --threads NUM_THREADS, -t NUM_THREADS
Re: Review Request 29698: Simplify client help output to solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67248 --- Ship it! src/main/python/apache/aurora/client/cli/task.py https://reviews.apache.org/r/29698/#comment111209 since these aren't multiline anymore you don't need the triple quotes. In fact, you can do ```py help = ... ``` instead of @property. - Kevin Sweeney On Jan. 7, 2015, 7:33 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 7, 2015, 7:33 p.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES]
Re: Review Request 29698: Simplify client help output and solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67290 --- Ship it! docs/client-commands.md https://reviews.apache.org/r/29698/#comment111288 The cron commands are implemented now, right? Can we just kill these lines? - Joshua Cohen On Jan. 8, 2015, 8:32 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 8:32 p.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - docs/client-commands.md 75e69541fd95dfd9a7aa1e04de1a590b8fcbeacf docs/client.md 3ec39b4f3bd6b45692aa1291e66a0a171d7dbb68 src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/BUILD bbac5c8efc9892fd2a966a6ac25fe05ffd740733 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES]
Re: Review Request 29698: Simplify client help output and solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67293 --- Ship it! Ship It! - Zameer Manji On Jan. 8, 2015, 12:32 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 12:32 p.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - docs/client-commands.md 75e69541fd95dfd9a7aa1e04de1a590b8fcbeacf docs/client.md 3ec39b4f3bd6b45692aa1291e66a0a171d7dbb68 src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/BUILD bbac5c8efc9892fd2a966a6ac25fe05ffd740733 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES
Re: Review Request 29698: Simplify client help output and solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67292 --- Ship it! Master (4053924) is green with this patch. ./build-support/jenkins/build.sh I will refresh this build result if you post a review containing @ReviewBot retry - Aurora ReviewBot On Jan. 8, 2015, 8:32 p.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 8:32 p.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - docs/client-commands.md 75e69541fd95dfd9a7aa1e04de1a590b8fcbeacf docs/client.md 3ec39b4f3bd6b45692aa1291e66a0a171d7dbb68 src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/BUILD bbac5c8efc9892fd2a966a6ac25fe05ffd740733 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES]
Re: Review Request 29698: Simplify client help output to solely use argparse.
On Jan. 8, 2015, 6:15 p.m., Maxim Khutornenko wrote: src/main/python/apache/aurora/client/cli/task.py, line 46 https://reviews.apache.org/r/29698/diff/1/?file=811543#file811543line46 The majority of subcommand help strings (i.e. jobs.py) start with capital letter. Suggest making it consistent here. Thanks, you caught me trying to hunt for the convention. Fixed. - Bill --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67231 --- On Jan. 8, 2015, 3:33 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 3:33 a.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES]
Re: Review Request 29698: Simplify client help output to solely use argparse.
On Jan. 8, 2015, 6:50 p.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/cli/task.py, line 83 https://reviews.apache.org/r/29698/diff/1/?file=811543#file811543line83 since these aren't multiline anymore you don't need the triple quotes. In fact, you can do ```py help = ... ``` instead of @property. Good catch on both, changed throughout. - Bill --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67248 --- On Jan. 8, 2015, 3:33 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 3:33 a.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments:
Re: Review Request 29698: Simplify client help output to solely use argparse.
On Jan. 8, 2015, 6:50 p.m., Kevin Sweeney wrote: src/main/python/apache/aurora/client/cli/task.py, line 83 https://reviews.apache.org/r/29698/diff/1/?file=811543#file811543line83 since these aren't multiline anymore you don't need the triple quotes. In fact, you can do ```py help = ... ``` instead of @property. Bill Farner wrote: Good catch on both, changed throughout. Scratch that - this causes checkstyle to bark with ``` T001:ERROR src/main/python/apache/aurora/client/cli/jobs.py:402 Class globals must be UPPER_SNAKE_CASED | help = Open a job's scheduler page in the web browser. ``` Punting to you if you would like to follow up. Personally, i'm happy to leave this alone since it will disappear when we remove the class hierarchy here. - Bill --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67248 --- On Jan. 8, 2015, 3:33 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 3:33 a.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine
Re: Review Request 29698: Simplify client help output and solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 8:26 p.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Changes --- In the updated patch, i've removed docs/client.md. It served as more of a design doc for the new client, and no longer serves as useful documentation. Summary (updated) - Simplify client help output and solely use argparse. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs (updated) - docs/client-commands.md 75e69541fd95dfd9a7aa1e04de1a590b8fcbeacf docs/client.md 3ec39b4f3bd6b45692aa1291e66a0a171d7dbb68 src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES is omitted, then all instances will be operated on. unix_command_line optional arguments: -h, --helpshow this help message and exit --threads NUM_THREADS, -t NUM_THREADS Number of threads to use --ssh-user
Re: Review Request 29698: Simplify client help output and solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 8:32 p.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Changes --- Fixed build, for some reason reviewbot passed the previous patch even though a BUILD file was in need of update. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs (updated) - docs/client-commands.md 75e69541fd95dfd9a7aa1e04de1a590b8fcbeacf docs/client.md 3ec39b4f3bd6b45692aa1291e66a0a171d7dbb68 src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/BUILD bbac5c8efc9892fd2a966a6ac25fe05ffd740733 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES is omitted, then all instances will be operated on. unix_command_line optional arguments: -h, --helpshow this help message and exit --threads NUM_THREADS, -t NUM_THREADS Number of threads to use --ssh-user ssh_username, -l ssh_username
Re: Review Request 29698: Simplify client help output to solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/#review67158 --- Ship it! Master (9a817f2) is green with this patch. ./build-support/jenkins/build.sh I will refresh this build result if you post a review containing @ReviewBot retry - Aurora ReviewBot On Jan. 8, 2015, 3:33 a.m., Bill Farner wrote: --- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- (Updated Jan. 8, 2015, 3:33 a.m.) Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES is omitted, then all instances will be operated on.
Review Request 29698: Simplify client help output to solely use argparse.
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/29698/ --- Review request for Aurora, Joshua Cohen, Maxim Khutornenko, and Zameer Manji. Bugs: AURORA-994 https://issues.apache.org/jira/browse/AURORA-994 Repository: aurora Description --- The only downside with this patch is that we've technically lost test coverage of our help output. This is rather involved if we want to change it. I ventured down the path of preserving `test_help.py`, but the best i could come up with (without a larger refactor on our end) was to patch `_print_message` and `exit` functions from `argparser.ArgumentParser`. This still did not address the fact that it accesses `sys.argv[0]` directly. Again - we could restructure to work around it, but at this point i think the value is dubious. Diffs - src/main/python/apache/aurora/client/cli/__init__.py 395819fdf24b7919b32be51060fb5b581c8e1514 src/main/python/apache/aurora/client/cli/client.py 939e32b0287a4a6e9cd66c4d6ffe05b32ed26d78 src/main/python/apache/aurora/client/cli/options.py b7f5a031d135a33ec2d79aa521ce9c1438eb58c1 src/main/python/apache/aurora/client/cli/task.py e084c5bef54d8a726276764ed7e5ce44cdc99ec5 src/test/python/apache/aurora/client/cli/test_help.py 9fa05e683f01a0e51253e08aa7fba69fd49d3756 src/test/python/apache/aurora/client/cli/test_plugins.py cf742a3feb12c6bb8fc6e80f15daaac7c2b2bf55 src/test/python/apache/aurora/client/cli/util.py 1fa1207d9380e57ac77d2aa24725b9ac39c83d4c Diff: https://reviews.apache.org/r/29698/diff/ Testing --- In vagrant: ``` vagrant@192:~$ aurora usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora -h usage: aurora [-h] {task,quota,cron,job,config,sla,beta-update} ... optional arguments: -h, --helpshow this help message and exit commands: {task,quota,cron,job,config,sla,beta-update} taskWork with a task running in an Apache Aurora cluster quota Work with quota settings for an Apache Aurora cluster cronWork with entries in the aurora cron scheduler job Work with an aurora job config Work with an aurora configuration file sla Work with SLA data in Aurora cluster. beta-update Interact with the aurora update service. vagrant@192:~$ aurora task usage: aurora task [-h] {run,ssh} ... aurora task: error: too few arguments vagrant@192:~$ aurora task -h usage: aurora task [-h] {run,ssh} ... optional arguments: -h, --help show this help message and exit subcommands: {run,ssh} run runs a shell command on machines currently hosting instances of a single job. This feature supports the same command line wildcards that are used to populate a job's commands. This means anything in the {{mesos.*}} and {{thermos.*}} namespaces. ssh initiates an SSH session on the machine that a task instance is running on. vagrant@192:~$ aurora task run -h usage: aurora task run [-h] [--threads NUM_THREADS] [--ssh-user ssh_username] [--executor-sandbox] [--verbose] [--skip-hooks hook,hook,...] CLUSTER/ROLE/ENV/NAME[/INSTANCES] unix_command_line positional arguments: CLUSTER/ROLE/ENV/NAME[/INSTANCES] Fully specified job instance key, in CLUSTER/ROLE/ENV/NAME[/INSTANCES] format. If INSTANCES is omitted, then all instances will be operated on. unix_command_line optional arguments: -h, --helpshow this help message and exit --threads NUM_THREADS, -t NUM_THREADS Number of threads to use --ssh-user ssh_username, -l ssh_username ssh as this username instead of the job's role --executor-sandboxRun the command in the executor sandbox instead of the task sandbox --verbose, -v Show verbose output --skip-hooks hook,hook,... A comma-separated list of command hook names that should be skipped. If the hooks cannot be skipped,