Skip to content

Commit

Permalink
[fix] fix python3 comp., metric ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego M. Rodriguez committed May 3, 2017
1 parent f75479b commit 8d052a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions loadimpactcli/metric_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
from operator import attrgetter

import click

Expand Down Expand Up @@ -51,8 +52,8 @@ def list_metrics(test_run_id, metric_types):
result_ids = client.list_test_run_result_ids(test_run_id, data={'types': types})

click.echo('NAME:\tTYPE:')
for result_id in result_ids:
for key, _ in result_id.ids.iteritems():
for result_id in sorted(result_ids, key=attrgetter('type')):
for key, _ in sorted(result_id.ids.items()):
click.echo('{0}\t{1}'.format(key, result_id.results_type_code_to_text(result_id.type)))
except ConnectionError:
click.echo("Cannot connect to Load impact API")

0 comments on commit 8d052a4

Please sign in to comment.