Fixed line length
This commit is contained in:
parent
96c288e985
commit
37cdc194d0
|
@ -19,8 +19,8 @@ class UserController(wsgi.Controller):
|
|||
@utils.wrap_error
|
||||
def get_users(self, req):
|
||||
marker, limit, url = get_marker_limit_and_url(req)
|
||||
users = config.SERVICE.get_users(utils.get_auth_token(req), marker, limit,
|
||||
url)
|
||||
users = config.SERVICE.get_users(utils.get_auth_token(req), marker,
|
||||
limit, url)
|
||||
return utils.send_result(200, req, users)
|
||||
|
||||
@utils.wrap_error
|
||||
|
@ -31,7 +31,8 @@ class UserController(wsgi.Controller):
|
|||
@utils.wrap_error
|
||||
def update_user(self, req, user_id):
|
||||
user = utils.get_normalized_request_content(User_Update, req)
|
||||
rval = config.SERVICE.update_user(utils.get_auth_token(req), user_id, user)
|
||||
rval = config.SERVICE.update_user(utils.get_auth_token(req), user_id,
|
||||
user)
|
||||
return utils.send_result(200, req, rval)
|
||||
|
||||
@utils.wrap_error
|
||||
|
@ -42,34 +43,34 @@ class UserController(wsgi.Controller):
|
|||
@utils.wrap_error
|
||||
def set_user_password(self, req, user_id):
|
||||
user = utils.get_normalized_request_content(User_Update, req)
|
||||
rval = config.SERVICE.set_user_password(utils.get_auth_token(req), user_id,
|
||||
user)
|
||||
rval = config.SERVICE.set_user_password(utils.get_auth_token(req),
|
||||
user_id, user)
|
||||
return utils.send_result(200, req, rval)
|
||||
|
||||
@utils.wrap_error
|
||||
def set_user_enabled(self, req, user_id):
|
||||
user = utils.get_normalized_request_content(User_Update, req)
|
||||
rval = config.SERVICE.enable_disable_user(utils.get_auth_token(req), user_id,
|
||||
user)
|
||||
rval = config.SERVICE.enable_disable_user(utils.get_auth_token(req),
|
||||
user_id, user)
|
||||
return utils.send_result(200, req, rval)
|
||||
|
||||
@utils.wrap_error
|
||||
def update_user_tenant(self, req, user_id):
|
||||
user = utils.get_normalized_request_content(User_Update, req)
|
||||
rval = config.SERVICE.set_user_tenant(utils.get_auth_token(req), user_id,
|
||||
user)
|
||||
rval = config.SERVICE.set_user_tenant(utils.get_auth_token(req),
|
||||
user_id, user)
|
||||
return utils.send_result(200, req, rval)
|
||||
|
||||
@utils.wrap_error
|
||||
def get_tenant_users(self, req, tenant_id):
|
||||
marker, limit, url = get_marker_limit_and_url(req)
|
||||
users = config.SERVICE.get_tenant_users(utils.get_auth_token(req), tenant_id,
|
||||
marker, limit, url)
|
||||
users = config.SERVICE.get_tenant_users(utils.get_auth_token(req),
|
||||
tenant_id, marker, limit, url)
|
||||
return utils.send_result(200, req, users)
|
||||
|
||||
@utils.wrap_error
|
||||
def get_user_groups(self, req, user_id):
|
||||
marker, limit, url = get_marker_limit_and_url(req)
|
||||
groups = config.SERVICE.get_user_groups(utils.get_auth_token(req), user_id,
|
||||
marker, limit, url)
|
||||
groups = config.SERVICE.get_user_groups(utils.get_auth_token(req),
|
||||
user_id, marker, limit, url)
|
||||
return utils.send_result(200, req, groups)
|
||||
|
|
|
@ -98,13 +98,10 @@ def send_error(code, req, result):
|
|||
resp.status = code
|
||||
|
||||
if result:
|
||||
|
||||
if is_xml_response(req):
|
||||
|
||||
content = result.to_xml()
|
||||
resp.headers['content-type'] = "application/xml"
|
||||
else:
|
||||
|
||||
content = result.to_json()
|
||||
resp.headers['content-type'] = "application/json"
|
||||
|
||||
|
@ -123,7 +120,6 @@ def send_result(code, req, result):
|
|||
return resp
|
||||
|
||||
if result:
|
||||
|
||||
if is_xml_response(req):
|
||||
content = result.to_xml()
|
||||
resp.headers['content-type'] = "application/xml"
|
||||
|
@ -151,10 +147,12 @@ def send_legacy_result(code, headers):
|
|||
|
||||
return resp
|
||||
|
||||
#Currently using sha1 to hash.Need to figure if there is an openstack standard.Not using salt val as of now.
|
||||
# Currently using sha1 to hash, without a salt value.
|
||||
# Need to research relevant openstack standards.
|
||||
def get_hashed_password(password):
|
||||
if password != None and len(password) > 0:
|
||||
return password
|
||||
# why is this disabled?
|
||||
#return hashlib.sha1(password).hexdigest()
|
||||
else:
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue