From nobody Mon Feb 9 08:57:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78068+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78068+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1626937421; cv=none; d=zohomail.com; s=zohoarc; b=M63QiX0fr5NmqhpTu4y1CHu/pudgcxWMno4y9XbDdsgiPQkYH5nLR8vGAn4n10/WXDuMOp3buMk0A/CoT+YBw3U4aTaMJipUZNrNbbUH2/s1IPXYZNJWoQQJ6WoIeLoK4PEuaeaLYol7VyEN/KT5VxLO0cuybDYIEgmyvzbjYAM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626937421; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=nyN5LtPJutJ4Z9n7tbpHfouvqWRTqMjpNya8lT63ty8=; b=OfNCMtrBhxx5uqYmtVceXzwEc/u39iWsLY2FU4QfRiVR+9HS6CIPFrX2hnbP5quZOkDxCaj8lhcq+35dX0+jpq3D+WIP52fDi+DMdvAgT9hvS3rJ4O5xFJFVnwSy2LgV0bGe513INmdho5E7BC4poyCytw8dIvTI3qLJzTGmq9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78068+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1626937421450861.4741333465416; Thu, 22 Jul 2021 00:03:41 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ADcbYY1788612xevNgGlzd4X; Thu, 22 Jul 2021 00:03:41 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web08.4638.1626937420443933563 for ; Thu, 22 Jul 2021 00:03:40 -0700 X-Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M73bC2025251; Thu, 22 Jul 2021 07:03:37 GMT X-Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 39y3rjg3h9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:03:37 +0000 X-Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3427.houston.hpe.com (Postfix) with ESMTP id 2F0F057; Thu, 22 Jul 2021 07:03:29 +0000 (UTC) X-Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 4C5734D; Thu, 22 Jul 2021 07:03:28 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Nickle Wang , Liming Gao Subject: [edk2-devel] [staging/edk2-redfish-client Tools PATCH 5/6] RedfishClientPkg/Redfish-Profile-Simulator: Add ETAG on memory resource Date: Thu, 22 Jul 2021 14:08:16 +0800 Message-Id: <20210722060817.18564-6-abner.chang@hpe.com> In-Reply-To: <20210722060817.18564-1-abner.chang@hpe.com> References: <20210722060817.18564-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: ywu1_Xm2bfMjGzDdxpWI291ZP1ScUeZq X-Proofpoint-GUID: ywu1_Xm2bfMjGzDdxpWI291ZP1ScUeZq X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@hpe.com X-Gm-Message-State: bw6BYcF65YXfzvmMny2zvHk2x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1626937421; bh=zGrZaxps3FkUZPbbVhW8MsJu/ZY+mRTwrw9ollQfO7g=; h=Cc:Date:From:Reply-To:Subject:To; b=hYjw+nY8/x35no00rswVtQQ365UFF7etQuV1OZOWFQmucwVjgQ9Dvqbu90PWSz+OeXX c+aTJl2pl3/esZUzOw2gEdQ4Wg/0TeRHPiJi0k6hn0KImsWj0oeb16LKTDvFeFCHdvsTY rDs4uC5zE5ODZbBat+VJAFcnPQNB6tqJkPs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1626938325439100002 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add ETAG support on Memory resource. Signed-off-by: Abner Chang Cc: Nickle Wang Cc: Liming Gao Reviewed-by: Nickle Wang --- .../Redfish-Profile-Simulator/v1sim/systems.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems= .py b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py index 690101fb10..de4b839aeb 100644 --- a/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py +++ b/RedfishClientPkg/Tools/Redfish-Profile-Simulator/v1sim/systems.py @@ -18,6 +18,7 @@ from .resource import RfResource, RfCollection from .storage import RfSimpleStorageCollection, RfSmartStorage import flask import json +import hashlib from collections import OrderedDict =20 class RfSystemsCollection(RfCollection): @@ -142,13 +143,25 @@ class RfMemoryCollection(RfCollection): self.res_data["Members"].append({"@odata.id":newMemoryUrl}) =20 post_data["@odata.id"] =3D newMemoryUrl + + md5 =3D hashlib.md5() + md5.update(json.dumps(post_data).encode("utf-8")) + etag_str =3D 'W/"' + md5.hexdigest() + '"' + post_data["@odata.etag"] =3D etag_str self.elements[str(newMemoryIdx)] =3D post_data =20 resp =3D flask.Response(json.dumps(post_data,indent=3D4)) resp.headers["Location"] =3D newMemoryUrl + resp.headers["ETag"] =3D etag_str + return 0, 200, None, resp =20 def patch_memory(self, Idx, patch_data): + md5 =3D hashlib.md5() + md5.update(json.dumps(patch_data).encode("utf-8")) + etag_str =3D 'W/"' + md5.hexdigest() + '"' + patch_data["@odata.etag"] =3D etag_str + self.elements[str(Idx)] =3D {**self.elements[str(Idx)], **patch_da= ta} resp =3D flask.Response(json.dumps(self.elements[str(Idx)],indent= =3D4)) return 0, 200, None, resp --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78068): https://edk2.groups.io/g/devel/message/78068 Mute This Topic: https://groups.io/mt/84374368/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-