"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/test_ldap_tls_livetest.py" between
keystone-16.0.1.tar.gz and keystone-17.0.0.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Ussuri" series (latest release).

test_ldap_tls_livetest.py  (keystone-16.0.1):test_ldap_tls_livetest.py  (keystone-17.0.0)
skipping to change at line 17 skipping to change at line 17
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import ldap.modlist import ldap.modlist
from six import PY2
from keystone.common import provider_api from keystone.common import provider_api
import keystone.conf import keystone.conf
from keystone import exception from keystone import exception
from keystone import identity from keystone import identity
from keystone.tests import unit from keystone.tests import unit
from keystone.tests.unit import test_ldap_livetest from keystone.tests.unit import test_ldap_livetest
CONF = keystone.conf.CONF CONF = keystone.conf.CONF
PROVIDERS = provider_api.ProviderAPIs PROVIDERS = provider_api.ProviderAPIs
def create_object(dn, attrs): def create_object(dn, attrs):
if PY2: conn = ldap.initialize(CONF.ldap.url)
# NOTE: Once https://github.com/python-ldap/python-ldap/issues/249
# is released, we can pass bytes_strictness='warn' as a parameter to
# ldap.initialize instead of setting it after ldap.initialize.
conn = ldap.initialize(CONF.ldap.url, bytes_mode=False)
conn.bytes_strictness = 'warn'
else:
conn = ldap.initialize(CONF.ldap.url)
conn.simple_bind_s(CONF.ldap.user, CONF.ldap.password) conn.simple_bind_s(CONF.ldap.user, CONF.ldap.password)
ldif = ldap.modlist.addModlist(attrs) ldif = ldap.modlist.addModlist(attrs)
conn.add_s(dn, ldif) conn.add_s(dn, ldif)
conn.unbind_s() conn.unbind_s()
class LiveTLSLDAPIdentity(test_ldap_livetest.LiveLDAPIdentity): class LiveTLSLDAPIdentity(test_ldap_livetest.LiveLDAPIdentity):
def _ldap_skip_live(self): def _ldap_skip_live(self):
self.skip_if_env_not_set('ENABLE_TLS_LDAP_LIVE_TEST') self.skip_if_env_not_set('ENABLE_TLS_LDAP_LIVE_TEST')
 End of changes. 2 change blocks. 
9 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)