Browse files

Merge "Backslash continuation removal (Keystone folsom-1)"

  • Loading branch information...
2 parents 014ccd9 + 7a7a0c6 commit 33d107aa1d3e1aa2c188f9df7338a1e7d97a4ed2 Jenkins committed with openstack-gerrit May 21, 2012
View
4 keystone/identity/backends/ldap/core.py
@@ -321,8 +321,8 @@ def delete(self, id):
self.role_api.rolegrant_delete(ref.id)
def get_by_email(self, email):
- users = self.get_all('(mail=%s)' % \
- (ldap_filter.escape_filter_chars(email),))
+ users = self.get_all('(mail=%s)' %
+ (ldap_filter.escape_filter_chars(email),))
try:
return users[0]
except IndexError:
View
27 keystone/identity/backends/sql.py
@@ -176,9 +176,10 @@ def get_tenant_by_name(self, tenant_name):
def get_tenant_users(self, tenant_id):
session = self.get_session()
user_refs = session.query(User)\
- .join(UserTenantMembership)\
- .filter(UserTenantMembership.tenant_id == tenant_id)\
- .all()
+ .join(UserTenantMembership)\
+ .filter(UserTenantMembership.tenant_id ==
+ tenant_id)\
+ .all()
return [_filter_user(user_ref.to_dict()) for user_ref in user_refs]
def _get_user(self, user_id):
@@ -256,8 +257,8 @@ def get_tenants(self):
def get_tenants_for_user(self, user_id):
session = self.get_session()
membership_refs = session.query(UserTenantMembership)\
- .filter_by(user_id=user_id)\
- .all()
+ .filter_by(user_id=user_id)\
+ .all()
return [x.tenant_id for x in membership_refs]
def get_roles_for_user_and_tenant(self, user_id, tenant_id):
@@ -329,11 +330,11 @@ def delete_user(self, user_id):
session = self.get_session()
user_ref = session.query(User).filter_by(id=user_id).first()
membership_refs = session.query(UserTenantMembership)\
- .filter_by(user_id=user_id)\
- .all()
+ .filter_by(user_id=user_id)\
+ .all()
metadata_refs = session.query(Metadata)\
- .filter_by(user_id=user_id)\
- .all()
+ .filter_by(user_id=user_id)\
+ .all()
with session.begin():
if membership_refs:
@@ -378,11 +379,11 @@ def delete_tenant(self, tenant_id):
session = self.get_session()
tenant_ref = session.query(Tenant).filter_by(id=tenant_id).first()
membership_refs = session.query(UserTenantMembership)\
- .filter_by(tenant_id=tenant_id)\
- .all()
+ .filter_by(tenant_id=tenant_id)\
+ .all()
metadata_refs = session.query(Metadata)\
- .filter_by(tenant_id=tenant_id)\
- .all()
+ .filter_by(tenant_id=tenant_id)\
+ .all()
with session.begin():
if membership_refs:
View
7 keystone/middleware/s3_token.py
@@ -76,9 +76,10 @@ def deny_request(self, code):
resp = webob.Response(content_type='text/xml')
resp.status = error_table[code][0]
resp.body = error_table[code][1]
- resp.body = '<?xml version="1.0" encoding="UTF-8"?>\r\n<Error>\r\n ' \
- '<Code>%s</Code>\r\n <Message>%s</Message>\r\n</Error>\r\n' \
- % (code, error_table[code][1])
+ resp.body = ('<?xml version="1.0" encoding="UTF-8"?>\r\n'
+ '<Error>\r\n <Code>%s</Code>\r\n '
+ '<Message>%s</Message>\r\n</Error>\r\n' %
+ (code, error_table[code][1]))
return resp
def _json_request(self, creds_json):
View
6 keystone/token/backends/sql.py
@@ -73,8 +73,8 @@ def create_token(self, token_id, data):
def delete_token(self, token_id):
session = self.get_session()
token_ref = session.query(TokenModel)\
- .filter_by(id=token_id)\
- .first()
+ .filter_by(id=token_id)\
+ .first()
if not token_ref:
raise exception.TokenNotFound(token_id=token_id)
@@ -87,7 +87,7 @@ def list_tokens(self, user_id):
tokens = []
now = datetime.datetime.utcnow()
for token_ref in session.query(TokenModel)\
- .filter(TokenModel.expires > now):
+ .filter(TokenModel.expires > now):
token_ref_dict = token_ref.to_dict()
if 'user' not in token_ref_dict:
continue

0 comments on commit 33d107a

Please sign in to comment.