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

Update app.py to support fallback to Python 2.7 #548

Closed
wants to merge 2 commits into from
Closed

Update app.py to support fallback to Python 2.7 #548

wants to merge 2 commits into from

Conversation

pjonesIDBS
Copy link
Contributor

Currently Puppetboard doesn't work on Systems still using Python 2.7 wsgi so we need to try and fallback on the old urllib import.

Currently Puppetboard doesn't work on Systems still using Python 2.7 wsgi so we need to try and fallback on the old urllib import.
@coveralls
Copy link

coveralls commented Feb 1, 2020

Coverage Status

Coverage decreased (-0.2%) to 81.122% when pulling 8b9047e on pjonesIDBS:patch-1 into 82c4897 on voxpupuli:master.

@bastelfreak
Copy link
Member

@pjonesIDBS can you test if this works for you?

@mattock
Copy link

mattock commented Feb 12, 2020

For what it's worth the fallback seems to work ok. Right now my setup is

  • ubuntu/bionic64 vagrant box, version 20200206.0.0
  • puppet-puppetboard 6.0.0
  • puppetboard commit c215ebd (latest from "master" right now)
  • Latest Puppet 6 version (puppetserver, puppetdb, puppet-agent)

Without this patch I get

Traceback (most recent call last):
  File "/srv/puppetboard/puppetboard/wsgi.py", line 15, in <module>
    from puppetboard.app import app as application
  File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 5, in <module>
    from urllib.parse import unquote, unquote_plus, quote_plus
ImportError: No module named parse

With this PR applied I get:

Traceback (most recent call last):
  File "/srv/puppetboard/puppetboard/wsgi.py", line 15, in <module>
    from puppetboard.app import app as application
  File "/srv/puppetboard/puppetboard/puppetboard/app.py", line 13, in <module>
    from flask import (
ImportError: No module named flask

The latter is the same error I got when testing an old version of Puppetboard (e.g. 2c3a593) which used to work with my old Puppet 5-based setup on Ubuntu 18.04.

@mattock
Copy link

mattock commented Feb 12, 2020

I was able to make Puppetboard work with this patch. The problem was that I had used puppetlabs-apache to purge configs:

  class { '::apache':
    purge_configs => true,
    --- snip ---

When I set purge_configs => false and applied this patch Puppetboard finally started working.

@pjonesIDBS
Copy link
Contributor Author

@bastelfreak Sorry, I've not been able to reply before... I can confirm the change works. At the moment, we're using a forked version of the repo with the patch applied :)

@nmaludy
Copy link
Member

nmaludy commented Mar 20, 2020

Implemented in #555

@nmaludy nmaludy closed this Mar 20, 2020
@pjonesIDBS pjonesIDBS deleted the patch-1 branch March 20, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants