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



src/main/python/apache/aurora/client/api/sla.py
<https://reviews.apache.org/r/18296/#comment65595>

    for clarity i'd name this 'for job_key in jobs' since you're iterating over 
the keys, not the jobs.
    
    alternately you could do
    
    for job_key, job in jobs.items():
      ...
    
    so that you don't need to keep doing self._jobs[job_key]
    



src/main/python/apache/aurora/client/api/sla.py
<https://reviews.apache.org/r/18296/#comment65593>

    you can use a for/else statement here:
    
    for job in jobs:
      <compute statistics>
      if statistics below threshold:
        break
    else:
      safe_hosts[host].append(safe_limits)
    
    the 'else' statement will only be executed if no breaks took place, so you 
don't need to manage the 'safe' boolean.



src/main/python/apache/aurora/client/api/sla.py
<https://reviews.apache.org/r/18296/#comment65596>

    shouldn't this be safe_hosts[host] = safe_limits?
    



src/main/python/apache/aurora/client/commands/admin.py
<https://reviews.apache.org/r/18296/#comment65585>

    2 newlines between toplevel defns.  here and below in this file



src/main/python/apache/aurora/client/commands/admin.py
<https://reviews.apache.org/r/18296/#comment65586>

    don't do this in a comprehension.  just
    
    for line in results:
      print(line)



src/main/python/apache/aurora/client/commands/admin.py
<https://reviews.apache.org/r/18296/#comment65587>

    i'd add a safety clause here to skip empty lines since i know my editor has 
the propensity to add these to the ends of files:
    
    if not line.strip():
      continue



src/test/python/apache/aurora/client/commands/test_admin_sla.py
<https://reviews.apache.org/r/18296/#comment65584>

    no need to do nested patches here:
    
    with patch(...) as mock_options:
      ...
    


- Brian Wickman


On Feb. 21, 2014, 4:30 p.m., Maxim Khutornenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/18296/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2014, 4:30 p.m.)
> 
> 
> Review request for Aurora, Mark Chu-Carroll and Brian Wickman.
> 
> 
> Bugs: AURORA-208
>     https://issues.apache.org/jira/browse/AURORA-208
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> Implemented admin_client sla_list_safe_domain command.
> 
> 
> Diffs
> -----
> 
>   src/main/python/apache/aurora/client/api/__init__.py 
> 0999b6f99bd74361663258cdae9d3920b3bb636f 
>   src/main/python/apache/aurora/client/api/sla.py 
> b0b2b245951ea72d113ff2b3969c4d54024f73e7 
>   src/main/python/apache/aurora/client/commands/admin.py 
> 45686aec8d69f0dfa1d649a92a19ca87bd315823 
>   src/test/python/apache/aurora/client/api/test_sla.py 
> 2e6c8faf668182b497df59fe41b74af240459de7 
>   src/test/python/apache/aurora/client/commands/BUILD 
> 02c27aa513d60ef901f446c56cbfc0d891445e30 
>   src/test/python/apache/aurora/client/commands/test_admin_sla.py 
> PRE-CREATION 
>   src/test/python/apache/aurora/client/commands/util.py 
> 11ae990c0d8e41470c6df438d37d8a2a79907a58 
> 
> Diff: https://reviews.apache.org/r/18296/diff/
> 
> 
> Testing
> -------
> 
> ./pants src/test/python/apache/aurora/client:all
> 
> 
> Thanks,
> 
> Maxim Khutornenko
> 
>

Reply via email to