From 6ea6f05ddb65ef7329b4907b81980182188aa31c Mon Sep 17 00:00:00 2001 From: "peter.cy.chen" Date: Thu, 3 Aug 2023 03:56:05 +0800 Subject: [PATCH] rf_raw_request.py PATCH and PUT method not check URL before set If-Match header Signed-off-by: peter.cy.chen --- scripts/rf_raw_request.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/rf_raw_request.py b/scripts/rf_raw_request.py index ce1b492..946dba2 100644 --- a/scripts/rf_raw_request.py +++ b/scripts/rf_raw_request.py @@ -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