Skip to content

Commit

Permalink
updates based on review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Dec 20, 2023
1 parent e332944 commit 8ad52f9
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 218 deletions.
7 changes: 4 additions & 3 deletions hsds/attr_dn.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ async def POST_Attributes(request):
attr_list.append(des_attr)

resp_json = {"attributes": attr_list}
log.debug(f"POST attributes returning: {resp_json}")
resp = json_response(resp_json)
log.response(request, resp=resp)
return resp
Expand Down Expand Up @@ -253,7 +254,6 @@ async def PUT_Attributes(request):
raise HTTPBadRequest(message="body expected")

body = await request.json()
log.debug(f"PUT Attribute body: {body}") # remove this to avoid verbosity
if "bucket" in params:
bucket = params["bucket"]
elif "bucket" in body:
Expand Down Expand Up @@ -284,7 +284,7 @@ async def PUT_Attributes(request):
if "value" in body:
attribute["value"] = body["value"]
items[attr_name] = attribute

# validate input
for attr_name in items:
validateAttributeName(attr_name)
Expand Down Expand Up @@ -328,7 +328,7 @@ async def PUT_Attributes(request):
log.debug(f"new attribute {attr_name}")
attribute["created"] = create_time
new_attribute = True

# ok - all set, create the attributes
for attr_name in items:
log.debug(f"adding attribute {attr_name}")
Expand All @@ -349,6 +349,7 @@ async def PUT_Attributes(request):
log.response(request, resp=resp)
return resp


async def DELETE_Attribute(request):
"""HTTP DELETE method for /(obj)/<id>/attributes/<name>
"""
Expand Down
Loading

0 comments on commit 8ad52f9

Please sign in to comment.