diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index a309e8e8..820cce51 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -1525,14 +1525,21 @@ class IpmiHandler(object): self.element = self.element[:-1] if self.op in ('create', 'update'): filename = self.inputdata.nodefile(self.node) - if not os.access(filename, os.R_OK): + datfile = None + if filename in self.cfm.clientfiles: + cf = self.cfm.clientfiles[filename] + datfile = os.fdopen(os.dup(cf.filenoe()), 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 ' 'and parent directories)').format( filename, socket.gethostname()) self.output.put(msg.ConfluentNodeError(self.node, errstr)) return - self.ipmicmd.apply_license(filename) + try: + self.ipmicmd.apply_license(filename, data=datfile) + finally: + datfile.close() if len(self.element) == 3: self.output.put(msg.ChildCollection('all')) i = 1 diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index f5046858..8b0f1ec0 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -1370,14 +1370,21 @@ class IpmiHandler(object): self.element = self.element[:-1] if self.op in ('create', 'update'): filename = self.inputdata.nodefile(self.node) - if not os.access(filename, os.R_OK): + datfile = None + if filename in self.cfm.clientfiles: + cf = self.cfm.clientfiles[filename] + datfile = os.fdopen(os.dup(cf.filenoe()), 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 ' 'and parent directories)').format( filename, socket.gethostname()) self.output.put(msg.ConfluentNodeError(self.node, errstr)) return - self.ipmicmd.apply_license(self.inputdata.nodefile(self.node)) + try: + self.ipmicmd.apply_license(filename, data=datfile) + finally: + datfile.close() if len(self.element) == 3: self.output.put(msg.ChildCollection('all')) i = 1