Skip to content

Commit

Permalink
Fixed self.multipart_form_data assignment and removed redundant assig…
Browse files Browse the repository at this point in the history
…nment of self.default_prefix. Also, updated the condition for unstructured http push (not depending on ssh tunnel anymore).

Signed-off-by: Afsana Chowdhury <[email protected]>
  • Loading branch information
jitendra-nvi authored and afsanac-nv committed Apr 30, 2024
1 parent 38683fa commit 00d97d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
6 changes: 2 additions & 4 deletions ctam/interfaces/comptool_dut.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,14 @@ def __init__(
self.connection_ip_address = config["properties"]["ConnectionIPAddress"][
"value"
]
self.default_prefix = None
self.default_prefix = self.uri_builder.format_uri(redfish_str="{BaseURI}", component_type="GPU")
self.port_list = config["properties"]["SSHTunnelPortList"]["value"]
self.protocol = config["properties"]["SSHTunnelProtocol"]["value"]
self.remote_port = config["properties"]["SSHTunnelRemotePort"]["value"]
self.__user_name, _, self.__user_pass = self.net_rc.authenticators(
self.connection_ip_address
)
self.multipart_form_data = self.default_prefix = self.uri_builder.format_uri(redfish_str="{MultiPartFormData}", component_type="GPU")

self.multipart_form_data = redfish_uri_config.get("GPU", {}).get("MultiPartFormData", False)
self.binded_port = None
self.SSHTunnelRemoteIPAddress = None
self.ssh_tunnel_required = config["properties"].get("SSHTunnel", {}).get("value", False)
Expand Down Expand Up @@ -131,7 +130,6 @@ def set_up_connection(self):

# TODO investigate storing FW update files via add_software_info() in super
self.__connection_url = f"{self.protocol}://" + self.connection_ip_address
self.default_prefix = self.uri_builder.format_uri(redfish_str="{BaseURI}", component_type="GPU")
self.redfish_ifc = redfish.redfish_client(
self.__connection_url,
username=self.__user_name,
Expand Down
6 changes: 1 addition & 5 deletions ctam/interfaces/fw_update_ifc.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ def RedFishFWUpdate(self, BinPath, URI):
FileName = BinPath
JSONData = {}
URL = URI # + '"' + FileName + '"'
if (self.dut().ssh_tunnel_required \
or self.dut().redfish_uri_config.get("GPU", {}).get("UnstructuredHttpPush", False)):
if self.dut().redfish_uri_config.get("GPU", {}).get("UnstructuredHttpPush", False):
# Unstructured HTTP push update
if self.dut().multipart_form_data:
headers = None
Expand All @@ -402,9 +401,6 @@ def RedFishFWUpdate(self, BinPath, URI):
else:
headers = {"Content-Type": "multipart/form-data"}
body = {}
# files=[
# ('UpdateFile',(FileName,open(FileName,'rb'),'application/octet-stream'))
# ]
body["UpdateFile"] = (
FileName,
open(FileName, "rb"),
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ocptv-ctam"
version = "0.1.0"
version = "0.2.0"
description = "Compliance Tool for Accelerator Management"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -49,7 +49,7 @@ packages = ["ocptv_ctam"]
ocptv_ctam = "ctam"

[tool.bumpver]
current_version = "0.0.1"
current_version = "0.2.0"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "bump version {old_version} -> {new_version}"
commit = true
Expand Down

0 comments on commit 00d97d9

Please sign in to comment.