Skip to content

Commit

Permalink
Merge "Fixes minor whitespace issues"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Mar 6, 2015
2 parents 643b0b9 + 722e995 commit e2e5b93
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion keystone/auth/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def revocation_list(self, context, auth=None):
for t in tokens:
expires = t['expires']
if not (expires and isinstance(expires, six.text_type)):
t['expires'] = timeutils.isotime(expires)
t['expires'] = timeutils.isotime(expires)
data = {'revoked': tokens}
json_data = jsonutils.dumps(data)
signed_text = cms.cms_sign_text(json_data,
Expand Down
6 changes: 3 additions & 3 deletions keystone/contrib/federation/backends/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ def create_protocol(self, idp_id, protocol_id, protocol):
protocol['id'] = protocol_id
protocol['idp_id'] = idp_id
with sql.transaction() as session:
self._get_idp(session, idp_id)
protocol_ref = FederationProtocolModel.from_dict(protocol)
session.add(protocol_ref)
self._get_idp(session, idp_id)
protocol_ref = FederationProtocolModel.from_dict(protocol)
session.add(protocol_ref)
return protocol_ref.to_dict()

def update_protocol(self, idp_id, protocol_id, protocol):
Expand Down
2 changes: 1 addition & 1 deletion keystone/tests/unit/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def skip_if_no_multiple_domains_support(f):
def wrapper(*args, **kwargs):
test_obj = args[0]
if not test_obj.identity_api.multiple_domains_supported:
raise testcase.TestSkipped('No multiple domains support')
raise testcase.TestSkipped('No multiple domains support')
return f(*args, **kwargs)
return wrapper

Expand Down
8 changes: 4 additions & 4 deletions keystone/tests/unit/fakeldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ def match_with_wildcards(norm_val, val_list):
x[len(x) - len(norm_val) + 1:]):
return True
elif norm_val.endswith('*'):
# Is the string at the start of the target?
for x in val_list:
if norm_val[:-1] == x[:len(norm_val) - 1]:
return True
# Is the string at the start of the target?
for x in val_list:
if norm_val[:-1] == x[:len(norm_val) - 1]:
return True
else:
# Is the string an exact match?
for x in val_list:
Expand Down
28 changes: 14 additions & 14 deletions keystone/tests/unit/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1950,20 +1950,20 @@ def test_create_user_invalid_name_fails(self):
user)

def test_update_project_invalid_enabled_type_string(self):
project = {'id': uuid.uuid4().hex,
'name': uuid.uuid4().hex,
'enabled': True,
'domain_id': DEFAULT_DOMAIN_ID}
self.resource_api.create_project(project['id'], project)
project_ref = self.resource_api.get_project(project['id'])
self.assertEqual(True, project_ref['enabled'])

# Strings are not valid boolean values
project['enabled'] = "false"
self.assertRaises(exception.ValidationError,
self.resource_api.update_project,
project['id'],
project)
project = {'id': uuid.uuid4().hex,
'name': uuid.uuid4().hex,
'enabled': True,
'domain_id': DEFAULT_DOMAIN_ID}
self.resource_api.create_project(project['id'], project)
project_ref = self.resource_api.get_project(project['id'])
self.assertEqual(True, project_ref['enabled'])

# Strings are not valid boolean values
project['enabled'] = "false"
self.assertRaises(exception.ValidationError,
self.resource_api.update_project,
project['id'],
project)

def test_create_project_invalid_enabled_type_string(self):
project = {'id': uuid.uuid4().hex,
Expand Down
36 changes: 18 additions & 18 deletions keystone/tests/unit/test_backend_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@


def create_group_container(identity_api):
# Create the groups base entry (ou=Groups,cn=example,cn=com)
group_api = identity_api.driver.group
conn = group_api.get_connection()
dn = 'ou=Groups,cn=example,cn=com'
conn.add_s(dn, [('objectclass', ['organizationalUnit']),
('ou', ['Groups'])])
# Create the groups base entry (ou=Groups,cn=example,cn=com)
group_api = identity_api.driver.group
conn = group_api.get_connection()
dn = 'ou=Groups,cn=example,cn=com'
conn.add_s(dn, [('objectclass', ['organizationalUnit']),
('ou', ['Groups'])])


class BaseLDAPIdentity(test_backend.IdentityTests):
Expand Down Expand Up @@ -90,18 +90,18 @@ def config_files(self):
return config_files

def get_user_enabled_vals(self, user):
user_dn = (
self.identity_api.driver.user._id_to_dn_string(user['id']))
enabled_attr_name = CONF.ldap.user_enabled_attribute

ldap_ = self.identity_api.driver.user.get_connection()
res = ldap_.search_s(user_dn,
ldap.SCOPE_BASE,
u'(sn=%s)' % user['name'])
if enabled_attr_name in res[0][1]:
return res[0][1][enabled_attr_name]
else:
return None
user_dn = (
self.identity_api.driver.user._id_to_dn_string(user['id']))
enabled_attr_name = CONF.ldap.user_enabled_attribute

ldap_ = self.identity_api.driver.user.get_connection()
res = ldap_.search_s(user_dn,
ldap.SCOPE_BASE,
u'(sn=%s)' % user['name'])
if enabled_attr_name in res[0][1]:
return res[0][1][enabled_attr_name]
else:
return None

def test_build_tree(self):
"""Regression test for building the tree names
Expand Down
2 changes: 1 addition & 1 deletion keystone/tests/unit/test_cache_backend_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def __getattr__(self, name):
return get_collection(self._dbname, name)

def __getitem__(self, name):
return get_collection(self._dbname, name)
return get_collection(self._dbname, name)


class MockMongoClient(object):
Expand Down
2 changes: 1 addition & 1 deletion keystone/tests/unit/test_ldap_livetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setUp(self):
super(LiveLDAPIdentity, self).setUp()

def _ldap_skip_live(self):
self.skip_if_env_not_set('ENABLE_LDAP_LIVE_TEST')
self.skip_if_env_not_set('ENABLE_LDAP_LIVE_TEST')

def clear_database(self):
devnull = open('/dev/null', 'w')
Expand Down
2 changes: 1 addition & 1 deletion keystone/tests/unit/test_ldap_tls_livetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def create_object(dn, attrs):
class LiveTLSLDAPIdentity(test_ldap_livetest.LiveLDAPIdentity):

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')

def config_files(self):
config_files = super(LiveTLSLDAPIdentity, self).config_files()
Expand Down
2 changes: 1 addition & 1 deletion keystone/token/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def revocation_list(self, context, auth=None):
for t in tokens:
expires = t['expires']
if expires and isinstance(expires, datetime.datetime):
t['expires'] = timeutils.isotime(expires)
t['expires'] = timeutils.isotime(expires)
data = {'revoked': tokens}
json_data = jsonutils.dumps(data)
signed_text = cms.cms_sign_text(json_data,
Expand Down

0 comments on commit e2e5b93

Please sign in to comment.