From de9759c0d2d6242ba812c7ebf3a4a7613ec99754 Mon Sep 17 00:00:00 2001 From: Mallikarjuna Reddy Kolagatla Date: Fri, 2 Sep 2022 13:30:09 +0000 Subject: [PATCH] Fix create_csr to create csr with node-uuid as name Change-Id: Ib586139ad60cafa9ac474fa9136ce52483f4d680 --- proliantutils/redfish/redfish.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/proliantutils/redfish/redfish.py b/proliantutils/redfish/redfish.py index efeb7f21..5b61477e 100644 --- a/proliantutils/redfish/redfish.py +++ b/proliantutils/redfish/redfish.py @@ -1032,16 +1032,8 @@ class RedfishOperations(operations.IloOperations): if not os.path.exists(path): os.makedirs(path, 0o755) - # Create the file name as ".csr". Here ip address - # will have the "-" instead of "." in the file name. - - ip = self.host - ip_split = ip.split('.') - csr_file_name = "" - for x in ip_split: - csr_file_name = csr_file_name + x + '-' - csr_file_name = csr_file_name[:-1] - csr_file = path + csr_file_name + '.csr' + csr_file_name = os.path.basename(path) + csr_file = os.path.join(path, csr_file_name + '.csr') with open(csr_file, 'w') as f: f.write(cert_request)