mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-26 03:19:48 +00:00
Only close datfile if datfile is a file
If going by filename alone, there will be no file handle to close. Correct by not attempting a close in such a case.
This commit is contained in:
parent
b7af6b5c27
commit
8397c5defc
@ -1539,7 +1539,8 @@ class IpmiHandler(object):
|
||||
try:
|
||||
self.ipmicmd.apply_license(filename, data=datfile)
|
||||
finally:
|
||||
datfile.close()
|
||||
if datfile is not None:
|
||||
datfile.close()
|
||||
if len(self.element) == 3:
|
||||
self.output.put(msg.ChildCollection('all'))
|
||||
i = 1
|
||||
|
@ -1384,7 +1384,8 @@ class IpmiHandler(object):
|
||||
try:
|
||||
self.ipmicmd.apply_license(filename, data=datfile)
|
||||
finally:
|
||||
datfile.close()
|
||||
if datfile is not None:
|
||||
datfile.close()
|
||||
if len(self.element) == 3:
|
||||
self.output.put(msg.ChildCollection('all'))
|
||||
i = 1
|
||||
|
Loading…
Reference in New Issue
Block a user