I am porting a django project over from RHEL5 to RHEL7 and python 2.5 to 2.7.5 and am having certificate problems. The bit of code I am troubleshooting is a suds Client invocation of a web service WSDL client = Client(_LDAP_URLS[env])
where LDAP_URLS is already defined in the code. I imported it using from suds.client import Client
I think this may be more of a Linux and Python interaction problem between the two versions rather than an issue with the code, but I could be wrong. Here is the full code. (this is django by the way, so this is a view.py file)
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from suds.client import Client
from suds.wsse import Security
import suds
from gaic.security.sso import BinarySecurityToken
from ud_data_extract import UDDataExtractForm
_LDAP_URLS = {WSDL URLS HARD CODED HERE}
def _get_person(env='production', hid=None, vid=None, token=None, group=None):
if env not in _LDAP_URLS:
env = 'production'
if token:
client = Client(_SSO_URLS[env])
try:
person = client.service.getPersonFromToken(token)
hid = person['hid']
except Exception:
return None
try:
client = Client(_LDAP_URLS[env])
except Exception as e:
log.error("line 165: %s", e)
if group:
grp = client.factory.create('groupDto')
grp.name = group
users = client.service.getGroupMembers(grp)
groups = []
try:
group_ = client.service.getGroup(grp)
gnamere = re.compile(r'cn=([^,]+),')
for gname in group_.uniqueMembers:
m = gnamere.match(gname)
if m:
group_name = m.groups(1)[0]
groups.append(group_name)
groups.sort()
except Exception, e:
pass # groups = [str(e)]
return [users, groups]
person = client.factory.create('personDto')
if hid:
person.hid = hid
if vid:
person.vid = vid
user = None
The issue in my logging points to around line 165, I took out some code with our company wsdl urls so it may be in the 150s. It's in a try statement.
try:
client = Client(_LDAP_URLS[env])
except Exception as e:
log.error("line 165: %s", e)
I have looked around and this page said that it may be a problem with newer version of python and pointed to this redhat documentation to fix it, but I really don't know what to do with it.
Thanks in advance for the help.