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

Python 3 related fix in highstate_return.py #48997

Merged
merged 2 commits into from Aug 9, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions salt/returners/highstate_return.py
Expand Up @@ -185,8 +185,8 @@ def _generate_html_table(data, out, level=0, extra_style=''):
else:
new_extra_style = extra_style
if len(subdata) == 1:
name = subdata.keys()[0]
value = subdata.values()[0]
name = list(subdata.keys())[0]
value = list(subdata.values())[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

How about using a generator, like so?

name = next(six.iterkeys(subdata))
value = next(six.itervalues(subdata))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now using an iterator as requested

print('<tr style="{0}">'.format(
_lookup_style('tr', [row_style])
), file=out)
Expand Down