Skip to content

Commit

Permalink
Merge pull request #5 from eea/develop
Browse files Browse the repository at this point in the history
Python 3 support
  • Loading branch information
alecghica authored Nov 21, 2019
2 parents df660f4 + b0c1187 commit dc089c8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 7 deletions.
6 changes: 6 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ pipeline {
}
},

"Python3": {
node(label: 'docker') {
sh '''docker run -i --rm --name="$BUILD_TAG-python3" -e GIT_BRANCH="$BRANCH_NAME" -e ADDONS="$GIT_NAME" -e DEVELOP="src/$GIT_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/plone-test:5-python3 -v -vv -s $GIT_NAME'''
}
},

"Zope2": {
node(label: 'eea') {
script {
Expand Down
7 changes: 6 additions & 1 deletion docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
Changelog
=========

1.3 - (2019-11-15)
--------------------------
* Feature: Python3 support
[alecghica, iulianpetcheshi, avoinea refs #110155]

1.2 - (2019-07-30)
---------------------
--------------------------
* maintain backwards compatibility with non-plone systems when checking
for anonymous
[valipod refs #102005]
Expand Down
9 changes: 7 additions & 2 deletions eea/sentry/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
""" Main product initializer
"""
import os
import six
import logging
import urllib2
from contextlib import closing
from raven.contrib.zope import ZopeSentryHandler
from zope.i18nmessageid.message import MessageFactory
if six.PY2:
from eventlet.green import urllib2 as request
else:
from eventlet.green.urllib import request

EEAMessageFactory = MessageFactory('eea')
logger = logging.getLogger()

Expand All @@ -15,7 +20,7 @@ def environment():
"""
url = "http://rancher-metadata/latest/self/stack/environment_name"
try:
with closing(urllib2.urlopen(url)) as conn:
with closing(request.urlopen(url)) as conn:
env = conn.read()
except Exception as err:
logger.warn("Couldn't get environ from rancher-metadata: %s.", err)
Expand Down
10 changes: 7 additions & 3 deletions eea/sentry/browser/sentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
"""
import os
import json
import six
import logging
import socket
from urlparse import urlparse
from eventlet.green import urllib2
from contextlib import closing
from Products.Five.browser import BrowserView
from eea.sentry.cache import ramcache
from six.moves.urllib.parse import urlparse
if six.PY2:
from eventlet.green import urllib2 as request
else:
from eventlet.green.urllib import request

logger = logging.getLogger("eea.sentry")

Expand All @@ -35,7 +39,7 @@ def environment(self):
if not self._environment:
url = RANCHER_METADATA + '/self/stack/environment_name'
try:
with closing(urllib2.urlopen(url, timeout=TIMEOUT)) as con:
with closing(request.urlopen(url, timeout=TIMEOUT)) as con:
self._environment = con.read()
except Exception as err:
logger.warn(
Expand Down
2 changes: 1 addition & 1 deletion eea/sentry/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2
1.3

0 comments on commit dc089c8

Please sign in to comment.