mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-22 09:32:21 +00:00
license install through passed fd
Allow install of licenses that confluent cannot read.
This commit is contained in:
parent
f34e184d31
commit
008089c4c0
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user