Skip to content

Commit

Permalink
rf_raw_request.py PATCH and PUT method not check URL before set If-Ma…
Browse files Browse the repository at this point in the history
…tch header

Signed-off-by: peter.cy.chen <[email protected]>
  • Loading branch information
peter.cy.chen committed Aug 2, 2023
1 parent d872157 commit 6ea6f05
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions scripts/rf_raw_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@ def ifmatch_header(redfish_obj, path, headers=None):
if headers is None:
headers = {}
try:
actions_search = "^/redfish/v1/.*/Actions/.*$"
resault = re.search(actions_search, path)
if not resault:
response = redfish_obj.get(path)
etag = response.getheader( "ETag" )
if etag is not None:
headers[ "If-Match"] = etag
response = redfish_obj.get(path)
etag = response.getheader( "ETag" )
if etag is not None:
headers[ "If-Match"] = etag
except Exception:
pass
return headers
Expand Down

0 comments on commit 6ea6f05

Please sign in to comment.