Skip to content

Commit

Permalink
Merge pull request #31 from christian-pinto/agents-forwarding
Browse files Browse the repository at this point in the history
This pull requests adds the logic for inferring the agent managing a specific object and forwards requests for fabric state change.
This contribution is also taking care of marking each redfish object with the managing agent ID at agent discovery time.

Signed-off-by: Christian Pinto <christian.pinto@ibm.com>
  • Loading branch information
christian-pinto committed Nov 3, 2023
2 parents 97974c9 + 47aeca1 commit d01e35b
Show file tree
Hide file tree
Showing 813 changed files with 1,434 additions and 884 deletions.
67 changes: 67 additions & 0 deletions api_emulator/agents_management.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright (c) 2023 International Business Machines, Inc. All rights reserved.

import json
import api_emulator.utils as utils
import requests

request_headers = {
'Content-Type': 'application/json'
}

# This function checks if an object is managed by a Sunfish agent and returns
# the Agent @odata.id or None if the object is not managed by an Agent
# We are assuming that the resource_path we receive is always that of a collection because according to the RedFish
# specification (v1.18.0 at the time of writing this comment): "To create a resource, services shall support the POST
# method on resource collections."
def isAgentManaged(resource_path):
resource = utils.get_object(resource_path)
if "Oem" in resource and "Sunfish_RM" in resource["Oem"] and "ManagingAgent" in resource["Oem"]["Sunfish_RM"]:
return resource["Oem"]["Sunfish_RM"]["ManagingAgent"]["@odata.id"]

return None

def requestToAgent(method, agent_id, resource_path, payload):
if agent_id is None or agent_id == "":
raise Exception("Error: Missing Agent id")
if resource_path is None or resource_path == "":
raise Exception("Error: Missing resource_path")

agent = utils.get_object(agent_id)
agent_hostname = agent["HostName"]
resource_uri = agent_hostname + "/" + resource_path
if method == "POST":
if payload is None:
# we only check if there is a payload and we assume that is correct
raise Exception("Error: Missing payload")
r = requests.post(resource_uri, headers=request_headers, data=json.dumps(payload))
elif method == "PATCH":
if payload is None:
# we only check if there is a payload and we assume that is correct
raise Exception("Error: Missing payload")
r = requests.patch(resource_uri, headers=request_headers, data=json.dumps(payload))
elif method == "DELETE":
r = requests.delete(resource_uri)
elif method == "PUT":
if payload is None:
# we only check if there is a payload and we assume that is correct
raise Exception("Error: Missing payload")
r = requests.put(resource_uri, headers=request_headers, data=json.dumps(payload))
else:
raise Exception("Invalid method for requestToAgent")

return r

# This method forwards the request to the agent specified in the arguments and returns an object config dict
# updated with the OEM field pointing to the management server.
# The function returns:
# - (None, None) if the resource is not managed by an agent
# - (agent id, (reason, status code)) if agent managed and returning the message from the agent
def forwardToAgentIfManaged(method, resource_path, config=None):
agent = isAgentManaged(resource_path)
if agent:
# This collection is managed by an agent, let's forward the request
# We just return whatever the agent returns to us
r = requestToAgent(method, agent, resource_path, config)
return agent, (r.reason, r.status_code)

return None, None
2 changes: 1 addition & 1 deletion api_emulator/redfish/AccelerationFunction0_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ComputerSystemId, ProcessorId, AccelerationFunctionId):
if code == 200:
path = create_path(self.root, 'Systems/{0}/Processors/{1}/AccelerationFunctions/{2}').format(ComputerSystemId, ProcessorId, AccelerationFunctionId)
base_path = create_path(self.root, 'Systems/{0}/Processors/{1}/AccelerationFunctions').format(ComputerSystemId, ProcessorId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AccelerationFunction1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ProcessorId, AccelerationFunctionId):
if code == 200:
path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Processors/{1}/AccelerationFunctions/{2}').format(ResourceBlockId, ProcessorId, AccelerationFunctionId)
base_path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Processors/{1}/AccelerationFunctions').format(ResourceBlockId, ProcessorId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AccelerationFunction2_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ComputerSystemId, ProcessorId, AccelerationFun
if code == 200:
path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/Processors/{2}/AccelerationFunctions/{3}').format(ResourceBlockId, ComputerSystemId, ProcessorId, AccelerationFunctionId)
base_path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/Processors/{2}/AccelerationFunctions').format(ResourceBlockId, ComputerSystemId, ProcessorId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AccelerationFunction3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ProcessorId, AccelerationFunctionId):
if code == 200:
path = create_path(self.root, 'ResourceBlocks/{0}/Processors/{1}/AccelerationFunctions/{2}').format(ResourceBlockId, ProcessorId, AccelerationFunctionId)
base_path = create_path(self.root, 'ResourceBlocks/{0}/Processors/{1}/AccelerationFunctions').format(ResourceBlockId, ProcessorId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AccelerationFunction4_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ComputerSystemId, ProcessorId, AccelerationFun
if code == 200:
path = create_path(self.root, 'ResourceBlocks/{0}/Systems/{1}/Processors/{2}/AccelerationFunctions/{3}').format(ResourceBlockId, ComputerSystemId, ProcessorId, AccelerationFunctionId)
base_path = create_path(self.root, 'ResourceBlocks/{0}/Systems/{1}/Processors/{2}/AccelerationFunctions').format(ResourceBlockId, ComputerSystemId, ProcessorId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AddressPool_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, FabricId, AddressPoolId):
if code == 200:
path = create_path(self.root, 'Fabrics/{0}/AddressPools/{1}').format(FabricId, AddressPoolId)
base_path = create_path(self.root, 'Fabrics/{0}/AddressPools').format(FabricId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Aggregate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def delete(self, AggregateId):
if code == 200:
path = create_path(self.root, 'AggregationService/Aggregates/{0}').format(AggregateId)
base_path = create_path(self.root, 'AggregationService/Aggregates')
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AggregationSource_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def delete(self, AggregationSourceId):
if code == 200:
path = create_path(self.root, 'AggregationService/AggregationSources/{0}').format(AggregationSourceId)
base_path = create_path(self.root, 'AggregationService/AggregationSources')
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AllowDeny0_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ChassisId, NetworkAdapterId, NetworkDeviceFunctionId, AllowDeny
if code == 200:
path = create_path(self.root, 'Chassis/{0}/NetworkAdapters/{1}/NetworkDeviceFunctions/{2}/AllowDeny/{3}').format(ChassisId, NetworkAdapterId, NetworkDeviceFunctionId, AllowDenyId)
base_path = create_path(self.root, 'Chassis/{0}/NetworkAdapters/{1}/NetworkDeviceFunctions/{2}/AllowDeny').format(ChassisId, NetworkAdapterId, NetworkDeviceFunctionId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AllowDeny1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ComputerSystemId, NetworkInterfaceId, NetworkDeviceFunctionsNet
if code == 200:
path = create_path(self.root, 'Systems/{0}/NetworkInterfaces/{1}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny/{3}').format(ComputerSystemId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId, AllowDenyId)
base_path = create_path(self.root, 'Systems/{0}/NetworkInterfaces/{1}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny').format(ComputerSystemId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AllowDeny2_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, NetworkInterfaceId, NetworkDeviceFunctionsNetw
if code == 200:
path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/NetworkInterfaces/{1}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny/{3}').format(ResourceBlockId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId, AllowDenyId)
base_path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/NetworkInterfaces/{1}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny').format(ResourceBlockId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AllowDeny3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ComputerSystemId, NetworkInterfaceId, NetworkD
if code == 200:
path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/NetworkInterfaces/{2}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny/{4}').format(ResourceBlockId, ComputerSystemId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId, AllowDenyId)
base_path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/NetworkInterfaces/{2}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny').format(ResourceBlockId, ComputerSystemId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AllowDeny4_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, NetworkInterfaceId, NetworkDeviceFunctionsNetw
if code == 200:
path = create_path(self.root, 'ResourceBlocks/{0}/NetworkInterfaces/{1}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny/{3}').format(ResourceBlockId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId, AllowDenyId)
base_path = create_path(self.root, 'ResourceBlocks/{0}/NetworkInterfaces/{1}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny').format(ResourceBlockId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/AllowDeny5_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ComputerSystemId, NetworkInterfaceId, NetworkD
if code == 200:
path = create_path(self.root, 'ResourceBlocks/{0}/Systems/{1}/NetworkInterfaces/{2}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny/{4}').format(ResourceBlockId, ComputerSystemId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId, AllowDenyId)
base_path = create_path(self.root, 'ResourceBlocks/{0}/Systems/{1}/NetworkInterfaces/{2}/NetworkDeviceFunctions{NetworkDeviceFunctionId}/AllowDeny').format(ResourceBlockId, ComputerSystemId, NetworkInterfaceId, NetworkDeviceFunctionsNetworkDeviceFunctionId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Battery_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ChassisId, BatteryId):
if code == 200:
path = create_path(self.root, 'Chassis/{0}/PowerSubsystem/Batteries/{1}').format(ChassisId, BatteryId)
base_path = create_path(self.root, 'Chassis/{0}/PowerSubsystem/Batteries').format(ChassisId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/BootOption0_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ComputerSystemId, BootOptionId):
if code == 200:
path = create_path(self.root, 'Systems/{0}/BootOptions/{1}').format(ComputerSystemId, BootOptionId)
base_path = create_path(self.root, 'Systems/{0}/BootOptions').format(ComputerSystemId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/BootOption1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ComputerSystemId, BootOptionId):
if code == 200:
path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/BootOptions/{2}').format(ResourceBlockId, ComputerSystemId, BootOptionId)
base_path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/BootOptions').format(ResourceBlockId, ComputerSystemId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/BootOption2_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ComputerSystemId, BootOptionId):
if code == 200:
path = create_path(self.root, 'ResourceBlocks/{0}/Systems/{1}/BootOptions/{2}').format(ResourceBlockId, ComputerSystemId, BootOptionId)
base_path = create_path(self.root, 'ResourceBlocks/{0}/Systems/{1}/BootOptions').format(ResourceBlockId, ComputerSystemId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Cable_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def delete(self, CableId):
if code == 200:
path = create_path(self.root, 'Cables/{0}').format(CableId)
base_path = create_path(self.root, 'Cables')
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity0_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, StorageServiceId, StoragePoolId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'StorageServices/{0}/StoragePools/{1}/CapacitySources/{2}').format(StorageServiceId, StoragePoolId, CapacitySourceId)
base_path = create_path(self.root, 'StorageServices/{0}/StoragePools/{1}/CapacitySources').format(StorageServiceId, StoragePoolId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, StorageServiceId, VolumeId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'StorageServices/{0}/Volumes/{1}/CapacitySources/{2}').format(StorageServiceId, VolumeId, CapacitySourceId)
base_path = create_path(self.root, 'StorageServices/{0}/Volumes/{1}/CapacitySources').format(StorageServiceId, VolumeId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity2_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, StorageServiceId, FileSystemId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'StorageServices/{0}/FileSystems/{1}/CapacitySources/{2}').format(StorageServiceId, FileSystemId, CapacitySourceId)
base_path = create_path(self.root, 'StorageServices/{0}/FileSystems/{1}/CapacitySources').format(StorageServiceId, FileSystemId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity3_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, StorageId, StoragePoolId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'Storage/{0}/StoragePools/{1}/CapacitySources/{2}').format(StorageId, StoragePoolId, CapacitySourceId)
base_path = create_path(self.root, 'Storage/{0}/StoragePools/{1}/CapacitySources').format(StorageId, StoragePoolId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity4_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, StorageId, VolumeId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'Storage/{0}/Volumes/{1}/CapacitySources/{2}').format(StorageId, VolumeId, CapacitySourceId)
base_path = create_path(self.root, 'Storage/{0}/Volumes/{1}/CapacitySources').format(StorageId, VolumeId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity5_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, StorageId, FileSystemId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'Storage/{0}/FileSystems/{1}/CapacitySources/{2}').format(StorageId, FileSystemId, CapacitySourceId)
base_path = create_path(self.root, 'Storage/{0}/FileSystems/{1}/CapacitySources').format(StorageId, FileSystemId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity6_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ComputerSystemId, StorageId, StoragePoolId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'Systems/{0}/Storage/{1}/StoragePools/{2}/CapacitySources/{3}').format(ComputerSystemId, StorageId, StoragePoolId, CapacitySourceId)
base_path = create_path(self.root, 'Systems/{0}/Storage/{1}/StoragePools/{2}/CapacitySources').format(ComputerSystemId, StorageId, StoragePoolId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity7_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ComputerSystemId, StorageId, VolumeId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'Systems/{0}/Storage/{1}/Volumes/{2}/CapacitySources/{3}').format(ComputerSystemId, StorageId, VolumeId, CapacitySourceId)
base_path = create_path(self.root, 'Systems/{0}/Storage/{1}/Volumes/{2}/CapacitySources').format(ComputerSystemId, StorageId, VolumeId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Capacity8_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ComputerSystemId, StorageId, FileSystemId, CapacitySourceId):
if code == 200:
path = create_path(self.root, 'Systems/{0}/Storage/{1}/FileSystems/{2}/CapacitySources/{3}').format(ComputerSystemId, StorageId, FileSystemId, CapacitySourceId)
base_path = create_path(self.root, 'Systems/{0}/Storage/{1}/FileSystems/{2}/CapacitySources').format(ComputerSystemId, StorageId, FileSystemId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Certificate0_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ManagerAccountId, CertificateId):
if code == 200:
path = create_path(self.root, 'AccountService/Accounts/{0}/Certificates/{1}').format(ManagerAccountId, CertificateId)
base_path = create_path(self.root, 'AccountService/Accounts/{0}/Certificates').format(ManagerAccountId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

2 changes: 1 addition & 1 deletion api_emulator/redfish/Certificate10_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def delete(self, ResourceBlockId, ComputerSystemId, CertificateId):
if code == 200:
path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/Boot/Certificates/{2}').format(ResourceBlockId, ComputerSystemId, CertificateId)
base_path = create_path(self.root, 'CompositionService/ResourceBlocks/{0}/Systems/{1}/Boot/Certificates').format(ResourceBlockId, ComputerSystemId)
return delete_object(path, base_path)
return delete_object(path, base_path, members=members, member_ids=member_ids)
else:
return msg, code

0 comments on commit d01e35b

Please sign in to comment.