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 incompatibility: inventory page table empty with puppetboard 0.2.1 #361

Closed
buzzdeee opened this issue Feb 13, 2017 · 7 comments
Closed
Milestone

Comments

@buzzdeee
Copy link
Contributor

Hi,

accessing /inventory, I see the header of the inventory table, with all its columns, but the table contents is not rendered. Running the daemon in debug mode I see following backtrace:

[2017-02-13 13:21:24 +0100] [11148] [DEBUG] GET /inventory
[2017-02-13 13:21:24 +0100] [11148] [ERROR] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 181, in handle_request
for item in respiter:
File "/usr/local/lib/python3.6/site-packages/werkzeug/wsgi.py", line 703, in next
return self._next()
File "/usr/local/lib/python3.6/site-packages/werkzeug/wrappers.py", line 81, in _iter_encoded
for item in iterable:
File "/usr/local/lib/python3.6/site-packages/flask/helpers.py", line 129, in generator
for item in gen:
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1208, in next
return self._next()
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1190, in generator
c = next()
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 1013, in generate
yield self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python3.6/site-packages/jinja2/environment.py", line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/var/www/puppetboard/puppetboard/templates/inventory.html", line 1, in top-level template code
{% extends 'layout.html' %}
File "/var/www/puppetboard/puppetboard/templates/layout.html", line 95, in top-level template code
{% block content %} {% endblock content %}
File "/var/www/puppetboard/puppetboard/templates/inventory.html", line 15, in block "content"
{% for node, facts in fact_data.iteritems() %}
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'iteritems'
[2017-02-13 13:21:24 +0100] [11148] [DEBUG] Closing connection.
[2017-02-13 13:21:24 +0100] [76105] [DEBUG] GET /static/jquery-datatables-1.10.13/dataTables.semanticui.min.css
[2017-02-13 13:21:24 +0100] [11148] [DEBUG] GET /static/css/puppetboard.css
[2017-02-13 13:21:24 +0100] [11148] [DEBUG] GET /static/jquery-datatables-1.10.13/jquery.dataTables.min.js
[2017-02-13 13:21:24 +0100] [13229] [DEBUG] GET /static/jquery-datatables-1.10.13/dataTables.semanticui.min.js
[2017-02-13 13:21:24 +0100] [65581] [DEBUG] GET /static/js/d3.min.js
[2017-02-13 13:21:24 +0100] [11148] [DEBUG] GET /static/js/c3.min.js
[2017-02-13 13:21:24 +0100] [76105] [DEBUG] GET /static/Semantic-UI-2.1.8/semantic.min.css
[2017-02-13 13:21:24 +0100] [13229] [DEBUG] GET /static/moment.js-2.7.0/moment.min.js
[2017-02-13 13:21:24 +0100] [65581] [DEBUG] GET /static/js/timestamps.js
[2017-02-13 13:21:24 +0100] [65581] [DEBUG] GET /static/js/lists.js
[2017-02-13 13:21:24 +0100] [76105] [DEBUG] GET /static/jquery-2.1.1/jquery.min.js
[2017-02-13 13:21:24 +0100] [11148] [DEBUG] GET /static/js/scroll.top.js
[2017-02-13 13:21:24 +0100] [76105] [DEBUG] GET /static/Semantic-UI-2.1.8/semantic.min.js
[2017-02-13 13:21:24 +0100] [65581] [DEBUG] GET /static/jquery-tablesort-v.0.0.7/jquery.tablesort.min.js
[2017-02-13 13:21:32 +0100] [76105] [DEBUG] GET /static/js/lists.js
[2017-02-13 13:21:32 +0100] [11148] [DEBUG] GET /static/js/tables.js

I just have this in my default_settings.py with regard to INVENTORY_FACTS:

INVENTORY_FACTS = [('Hostname', 'fqdn'),
('IP Address', 'ipaddress'),
('OS', 'lsbdistdescription'),
('Architecture', 'hardwaremodel'),
('Kernel Version', 'kernelrelease'),
('PuppetXXX Version', 'puppetversion'), ]

Just added these XXX to see if it takes it and they are shown in the web interface.
Downgrading again to puppetboard 0.2.0 makes it work again.

I found this thread:
http://stackoverflow.com/questions/30418481/error-dict-object-has-no-attribute-iteritems-when-trying-to-use-networkx
so changed iteritems -> items and the table contents is rendered properly.

0.2.0 as well as the 0.2.1 run with python 3.6.0

@tux-o-matic
Copy link
Contributor

@buzzdeee The support of Puppetboard is still limited to Python < 3 as mentioned in the header of the README:

At the current time of writing, Puppetboard supports the following Python versions:

    Python 2.6
    Python 2.7

@buzzdeee
Copy link
Contributor Author

I was wading through the README, but obviously missed that.
Anyways, for the OpenBSD port, where I run it on, I patched that little thing,
and updated it just yesterday to the 0.2.1, since everything else seems to run fine with python 3.
So, I don't mind if you keep the issue open as a reminder, or close it with that it doesn't apply.
Looking forward to some official python 3 support ;)

@mterzo
Copy link
Contributor

mterzo commented Feb 14, 2017

@buzzdeee We are moving to python 3x support, so thanks for the feedback.

@mterzo mterzo added this to the 0.3.0 milestone Mar 20, 2017
@nikolaik
Copy link
Contributor

nikolaik commented Apr 20, 2017

Seeing the same after bumping to 0.2.2 just now. Looking forward to a 0.3.0 release including #355 :-)

@mterzo
Copy link
Contributor

mterzo commented Oct 16, 2017

This should work now that 0.3.0 is released.

@jvperrin
Copy link

I can confirm this appears to be fixed with the release of 0.3.0 and Python 3 (3.5 in our case).

@larsnaesbye
Copy link
Contributor

Can't we close this issue since it has been confirmed to have been fixed in 0.3.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants