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

genadashboard and python issues #244

Open
klrobertson opened this issue Oct 5, 2018 · 2 comments
Open

genadashboard and python issues #244

klrobertson opened this issue Oct 5, 2018 · 2 comments

Comments

@klrobertson
Copy link

I updated my Open-NTI installation yesterday to the latest version and when I try to create a new dashboard, I am getting an error:

root@wf-opennti1:/home/juniper/open-nti/dashboards# python gendashboard.py --file test-dashboard-desktop.yaml Traceback (most recent call last):
File "gendashboard.py", line 6, in
import yaml
File "/usr/local/lib/python3.5/dist-packages/yaml/init.py", line 284
class YAMLObject(metaclass=YAMLObjectMetaclass):
^
SyntaxError: invalid syntax
root@wf-opennti1:/home/juniper/open-nti/dashboards#

It seems like this is trying to use python 3.5 with python 2.7 as the interpreter? Can you help? I tried using python3.5 to make the same call, but there are embedded calls within the distribution that seem to be tied to python 2.x:

root@wf-opennti1:/home/juniper/open-nti/dashboards# python3.5 gendashboard.py --file test-dashboard-desktop.yaml
opennti - INFO - Opening Configuration file test-dashboard-desktop.yaml
opennti - INFO - Add Row : test-rows-re-health.yaml
opennti - INFO - - Add Graph :test-graph-system-storage-junos.yaml
Traceback (most recent call last):
File "gendashboard.py", line 86, in
graph_tpl_rdr = Template(graph_tpl.read()).render(graph_conf)
File "/usr/local/lib/python3.5/dist-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/local/lib/python3.5/dist-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.5/dist-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "", line 46, in top-level template code
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'iteritems'

I noticed on my server that the dist packages for python are all installed under python3.5, but when I attempt to install them under python 2.7, pip claims the requirement is already satisfied by the distribution under 3.5.

@brahmastra2016
Copy link
Contributor

it seem your python installation is mixed up , try using virtualenv that might be quick and easy way to solve the issue.

@klrobertson
Copy link
Author

Does the genadashboard need python 2.7 specifically or can I use python 3.5?

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

No branches or pull requests

2 participants