-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/19063/
-----------------------------------------------------------

Review request for Aurora and Mark Chu-Carroll.


Repository: aurora


Description
-------

- fix help usage for Commands that was adding spaces between each chars.
- show help when no argument is passed


Diffs
-----

  src/main/python/apache/aurora/client/cli/__init__.py 
4a6a7eef7b781be79a3d40776a3bd6f0c6e8c4c0 
  src/main/python/apache/aurora/client/cli/bridge.py 
801facc6816d798f7efed97d16645a01e56444ee 
  src/test/python/apache/aurora/client/cli/test_bridge.py 
d94498142e333395b6769fae330e5d5f25bf1e3f 

Diff: https://reviews.apache.org/r/19063/diff/


Testing
-------

$ ./pants py src/main/python/apache/aurora/client/BUILD:clientv2-packaged
This is a merged command line, consisting of ['Aurora Client v2', 'Aurora 
Client v1']
========== help for Aurora Client v2 ==========
Usage:
==Commands for jobs
  job status [--write_json] value
  job cancel_update [--read_json] [--config=str] CLUSTER/ROLE/ENV/NAME
  job create [--bind=pystachio-binding] [--read_json] [--wait_until=('PENDING', 
'RUNNING', 'FINISHED')] [--open-browser] CLUSTER/ROLE/ENV/NAME str
  job inspect [--bind=pystachio-binding] [--read_json] [--local] [--raw] 
CLUSTER/ROLE/ENV/NAME str
  job list value
  job update [--force] [--bind=pystachio-binding] [--read_json] 
[--instances=inst,inst,inst...] [--healthcheck_interval_seconds=value] 
CLUSTER/ROLE/ENV/NAME str
  job kill [--open-browser] [--instances=inst,inst,inst...] [--config=str] 
CLUSTER/ROLE/ENV/NAME
  job diff [--bind=pystachio-binding] [--read_json] [--from=value] 
CLUSTER/ROLE/ENV/NAME str
  job restart [--batch_size=value] [--bind=pystachio-binding] [--open-browser] 
[--force] [--healthcheck_interval_seconds=value] 
[--instances=inst,inst,inst...] [--read_json] [--watch_secs=value] 
[--max_per_instance_failures=value] [--restart_threshold=value] 
[--max_total_failures=value] [--no-rollback_on_failure] CLUSTER/ROLE/ENV/NAME 
str
...


Without the fix:
$ ./pants py src/main/python/apache/aurora/client/BUILD:clientv2-packaged
Traceback (most recent call last):
  File 
"/opt/twitter/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py",
 line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File 
"/opt/twitter/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py",
 line 72, in _run_code
    exec code in run_globals
  File 
"/private/var/folders/yv/jcm7bpxj01n72xyy8n99g0cm0000gn/T/tmpedI8lQ/__main__.py",
 line 24, in <module>
    bootstrap_pex(__entry_point__)
  File 
"/private/var/folders/yv/jcm7bpxj01n72xyy8n99g0cm0000gn/T/tmpedI8lQ/.bootstrap/_twitter_common_python/pex_bootstrapper.py",
 line 47, in bootstrap_pex
    pex.PEX(entry_point).execute()
  File 
"/private/var/folders/yv/jcm7bpxj01n72xyy8n99g0cm0000gn/T/tmpedI8lQ/.bootstrap/_twitter_common_python/pex.py",
 line 137, in execute
    self.execute_entry(entry_point, args)
  File 
"/private/var/folders/yv/jcm7bpxj01n72xyy8n99g0cm0000gn/T/tmpedI8lQ/.bootstrap/_twitter_common_python/pex.py",
 line 167, in execute_entry
    runner(entry_point)
  File 
"/private/var/folders/yv/jcm7bpxj01n72xyy8n99g0cm0000gn/T/tmpedI8lQ/.bootstrap/_twitter_common_python/pex.py",
 line 190, in execute_pkg_resources
    runner()
  File 
"/var/folders/yv/jcm7bpxj01n72xyy8n99g0cm0000gn/T/tmpedI8lQ/apache/aurora/client/cli/client.py",
 line 61, in proxy_main
    bridge.execute(sys.argv)
  File 
"/var/folders/yv/jcm7bpxj01n72xyy8n99g0cm0000gn/T/tmpedI8lQ/apache/aurora/client/cli/bridge.py",
 line 69, in execute
    if args[1] == 'help':
IndexError: list index out of range

$ ./pants py src/main/python/apache/aurora/client/BUILD:clientv2-packaged help
This is a merged command line, consisting of ['Aurora Client v2', 'Aurora 
Client v1']
========== help for Aurora Client v2 ==========
Usage:
==Commands for jobs
  job s t a t u s   [ - - w r i t e _ j s o n ]   v a l u e
  job c a n c e l _ u p d a t e   [ - - r e a d _ j s o n ]   [ - - c o n f i g 
= s t r ]   C L U S T E R / R O L E / E N V / N A M E
  job c r e a t e   [ - - b i n d = p y s t a c h i o - b i n d i n g ]   [ - - 
r e a d _ j s o n ]   [ - - w a i t _ u n t i l = ( ' P E N D I N G ' ,   ' R U 
N N I N G ' ,   ' F I N I S H E D ' ) ]   [ - - o p e n - b r o w s e r ]   C L 
U S T E R / R O L E / E N V / N A M E   s t r
  job i n s p e c t   [ - - b i n d = p y s t a c h i o - b i n d i n g ]   [ - 
- r e a d _ j s o n ]   [ - - l o c a l ]   [ - - r a w ]   C L U S T E R / R O 
L E / E N V / N A M E   s t r
  job l i s t   v a l u e
  job u p d a t e   [ - - f o r c e ]   [ - - b i n d = p y s t a c h i o - b i 
n d i n g ]   [ - - r e a d _ j s o n ]   [ - - i n s t a n c e s = i n s t , i 
n s t , i n s t . . . ]   [ - - h e a l t h c h e c k _ i n t e r v a l _ s e c 
o n d s = v a l u e ]   C L U S T E R / R O L E / E N V / N A M E   s t r
...


Thanks,

Antoine Tollenaere

Reply via email to