From 5ed0b5011068d201785013e7e5902e5264ec273f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 2 Mar 2021 15:15:54 -0500 Subject: [PATCH] Fix non-client fallback If client doesn't provide file, then we need to open by name. --- confluent_server/confluent/osimage.py | 2 +- confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 2 +- .../confluent/plugins/hardwaremanagement/redfish.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 0531f214..d3bb7f35 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -597,7 +597,7 @@ class MediaImporter(object): if cfm and media in cfm.clientfiles: medfile = cfm.clientfiles[media] else: - medfile = open(medfile, 'rb') + medfile = open(media, 'rb') identity = fingerprint(medfile) if not identity: raise exc.InvalidArgumentException('Unsupported Media') diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index 820cce51..881d336d 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -1528,7 +1528,7 @@ class IpmiHandler(object): datfile = None if filename in self.cfm.clientfiles: cf = self.cfm.clientfiles[filename] - datfile = os.fdopen(os.dup(cf.filenoe()), cf.mode) + datfile = os.fdopen(os.dup(cf.fileno()), cf.mode) if datfile is None and not os.access(filename, os.R_OK): errstr = ('{0} is not readable by confluent on {1} ' '(ensure confluent user or group can access file ' diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index 8b0f1ec0..1f7eab97 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -1373,7 +1373,7 @@ class IpmiHandler(object): datfile = None if filename in self.cfm.clientfiles: cf = self.cfm.clientfiles[filename] - datfile = os.fdopen(os.dup(cf.filenoe()), cf.mode) + datfile = os.fdopen(os.dup(cf.fileno()), cf.mode) if datfile is None and not os.access(filename, os.R_OK): errstr = ('{0} is not readable by confluent on {1} ' '(ensure confluent user or group can access file '